Package com.irurueta.ar.slam
Class VelocityPredictor
java.lang.Object
com.irurueta.ar.slam.VelocityPredictor
Utility class to predict velocity of device.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intNumber of components of acceleration.static final intNumber of components of speed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]predict(double[] v, double[] a, double dt) Predicts the updated velocity.static voidpredict(double[] v, double[] a, double dt, double[] result) Predicts the updated velocity.static voidpredict(double[] v, double[] a, double dt, double[] result, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.static double[]predict(double[] v, double[] a, double dt, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.static double[]predict(double vx, double vy, double vz, double ax, double ay, double az, double dt) Predicts the updated velocity.static voidpredict(double vx, double vy, double vz, double ax, double ay, double az, double dt, double[] result) Predicts the updated velocity.static voidpredict(double vx, double vy, double vz, double ax, double ay, double az, double dt, double[] result, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.static double[]predict(double vx, double vy, double vz, double ax, double ay, double az, double dt, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.static double[]predictWithVelocityAdjustment(double[] v, double[] dv, double[] a, double dt) Predicts the updated velocity.static voidpredictWithVelocityAdjustment(double[] v, double[] dv, double[] a, double dt, double[] result) Predicts the updated velocity.static voidpredictWithVelocityAdjustment(double[] v, double[] dv, double[] a, double dt, double[] result, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianDV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.static double[]predictWithVelocityAdjustment(double[] v, double[] dv, double[] a, double dt, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianDV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.static double[]predictWithVelocityAdjustment(double vx, double vy, double vz, double dvx, double dvy, double dvz, double ax, double ay, double az, double dt) Predicts the updated velocity.static voidpredictWithVelocityAdjustment(double vx, double vy, double vz, double dvx, double dvy, double dvz, double ax, double ay, double az, double dt, double[] result) Predicts the updated velocity.static voidpredictWithVelocityAdjustment(double vx, double vy, double vz, double dvx, double dvy, double dvz, double ax, double ay, double az, double dt, double[] result, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianDV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.static double[]predictWithVelocityAdjustment(double vx, double vy, double vz, double dvx, double dvy, double dvz, double ax, double ay, double az, double dt, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianDV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.
-
Field Details
-
SPEED_COMPONENTS
public static final int SPEED_COMPONENTSNumber of components of speed.- See Also:
-
ACCELERATION_COMPONENTS
public static final int ACCELERATION_COMPONENTSNumber of components of acceleration.- See Also:
-
-
Constructor Details
-
VelocityPredictor
private VelocityPredictor()Constructor.
-
-
Method Details
-
predict
public static void predict(double vx, double vy, double vz, double ax, double ay, double az, double dt, double[] result, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.- Parameters:
vx- current velocity in x-axis. Expressed in m/s.vy- current velocity in y-axis. Expressed in m/s.vz- current velocity in z-axis. Expressed in m/s.ax- acceleration in x-axis. Expressed in m/s^2.ay- acceleration in y-axis. Expressed in m/s^2.az- acceleration in z-axis. Expressed in m/s^2.dt- time interval to compute prediction expressed in seconds.result- instance where updated velocity is stored. Must have length 3.jacobianV- jacobian wrt velocity. Must be 3x3.jacobianA- jacobian wrt acceleration. Must be 3x3.- Throws:
IllegalArgumentException- if any of provided jacobians does not have proper size or if result does not have length 3.- See Also:
-
predict
public static void predict(double vx, double vy, double vz, double ax, double ay, double az, double dt, double[] result) Predicts the updated velocity.- Parameters:
vx- current velocity in x-axis. Expressed in m/s.vy- current velocity in y-axis. Expressed in m/s.vz- current velocity in z-axis. Expressed in m/s.ax- acceleration in x-axis. Expressed in m/s^2.ay- acceleration in y-axis. Expressed in m/s^2.az- acceleration in z-axis. Expressed in m/s^2.dt- time interval to compute prediction expressed in seconds.result- instance where updated velocity is stored.- Throws:
IllegalArgumentException- if result does not have length 3.- See Also:
-
predict
public static void predict(double[] v, double[] a, double dt, double[] result, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.- Parameters:
v- array containing 3 components of velocity. Expressed in m/s. Must have length 3.a- array containing 3 components of acceleration. Expressed in m/s^2. Must have length 3.dt- time interval to compute prediction expressed in seconds.result- instance where updated velocity is stored.jacobianV- jacobian wrt velocity. Must be 3x3.jacobianA- jacobian wrt acceleration. Must be 3x3.- Throws:
IllegalArgumentException- if any of provided jacobians does not have proper size or if v, a or result do not have length 3.- See Also:
-
predict
public static void predict(double[] v, double[] a, double dt, double[] result) Predicts the updated velocity.- Parameters:
v- array containing 3 components of velocity. Expressed in m/s. Must have length 3.a- array containing 3 components of acceleration. Expressed in m/s^2. Must have length 3.dt- time interval to compute prediction expressed in seconds.result- instance where updated velocity is stored.- Throws:
IllegalArgumentException- if v, a or result do not have length 3.- See Also:
-
predict
public static double[] predict(double vx, double vy, double vz, double ax, double ay, double az, double dt, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.- Parameters:
vx- current velocity in x-axis. Expressed in m/s.vy- current velocity in y-axis. Expressed in m/s.vz- current velocity in z-axis. Expressed in m/s.ax- acceleration in x-axis. Expressed in m/s^2.ay- acceleration in y-axis. Expressed in m/s^2.az- acceleration in z-axis. Expressed in m/s^2.dt- time interval to compute prediction expressed in seconds.jacobianV- jacobian wrt velocity. Must be 3x3.jacobianA- jacobian wrt acceleration. Must be 3x3.- Returns:
- a new instance containing updated velocity.
- Throws:
IllegalArgumentException- if any of provided jacobians does not have proper size.- See Also:
-
predict
public static double[] predict(double vx, double vy, double vz, double ax, double ay, double az, double dt) Predicts the updated velocity.- Parameters:
vx- current velocity in x-axis. Expressed in m/s.vy- current velocity in y-axis. Expressed in m/s.vz- current velocity in z-axis. Expressed in m/s.ax- acceleration in x-axis. Expressed in m/s^2.ay- acceleration in y-axis. Expressed in m/s^2.az- acceleration in z-axis. Expressed in m/s^2.dt- time interval to compute prediction expressed in seconds.- Returns:
- a new instance containing updated velocity.
- See Also:
-
predict
public static double[] predict(double[] v, double[] a, double dt, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.- Parameters:
v- array containing 3 components of velocity. Expressed in m/s. Must have length 3.a- array containing 3 components of acceleration. Expressed in m/s^2. Must have length 3.dt- time interval to compute prediction expressed in seconds.jacobianV- jacobian wrt velocity. Must be 3x3.jacobianA- jacobian wrt acceleration. Must be 3x3.- Returns:
- a new instance containing updated velocity.
- Throws:
IllegalArgumentException- if any of provided jacobians does not have proper size or if v or a do not have length 3.- See Also:
-
predict
public static double[] predict(double[] v, double[] a, double dt) Predicts the updated velocity.- Parameters:
v- array containing 3 components of velocity. Expressed in m/s. Must have length 3.a- array containing 3 components of acceleration. Expressed in m/s^2. Must have length 3.dt- time interval to compute prediction expressed in seconds.- Returns:
- a new instance containing updated velocity.
- Throws:
IllegalArgumentException- if a or v do not have length 3.- See Also:
-
predictWithVelocityAdjustment
public static void predictWithVelocityAdjustment(double vx, double vy, double vz, double dvx, double dvy, double dvz, double ax, double ay, double az, double dt, double[] result, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianDV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.- Parameters:
vx- current velocity in x-axis. Expressed in m/s.vy- current velocity in y-axis. Expressed in m/s.vz- current velocity in z-axis. Expressed in m/s.dvx- velocity adjustment in x-axis. Expressed in m/s.dvy- velocity adjustment in y-axis. Expressed in m/s.dvz- velocity adjustment in z-axis. Expressed in m/s.ax- acceleration in x-axis. Expressed in m/s^2.ay- acceleration in y-axis. Expressed in m/s^2.az- acceleration in z-axis. Expressed in m/s^2.dt- time interval to compute prediction expressed in seconds.result- instance where updated velocity is stored. Must have length 3.jacobianV- jacobian wrt velocity. Must be 3x3.jacobianDV- jacobian wrt velocity adjustment. Must be 3x3.jacobianA- jacobian wrt acceleration. Must be 3x3.- Throws:
IllegalArgumentException- if any of provided jacobians does not have proper size or if result does not have length 3.
-
predictWithVelocityAdjustment
public static void predictWithVelocityAdjustment(double vx, double vy, double vz, double dvx, double dvy, double dvz, double ax, double ay, double az, double dt, double[] result) Predicts the updated velocity.- Parameters:
vx- current velocity in x-axis. Expressed in m/s.vy- current velocity in y-axis. Expressed in m/s.vz- current velocity in z-axis. Expressed in m/s.dvx- velocity adjustment in x-axis. Expressed in m/s.dvy- velocity adjustment in y-axis. Expressed in m/s.dvz- velocity adjustment in z-axis. Expressed in m/s.ax- acceleration in x-axis. Expressed in m/s^2.ay- acceleration in y-axis. Expressed in m/s^2.az- acceleration in z-axis. Expressed in m/s^2.dt- time interval to compute prediction expressed in seconds.result- instance where updated velocity is stored. Must have length 3.- Throws:
IllegalArgumentException- if result does not have length 3.
-
predictWithVelocityAdjustment
public static void predictWithVelocityAdjustment(double[] v, double[] dv, double[] a, double dt, double[] result, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianDV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.- Parameters:
v- current velocity (in x,y,z axes). Expressed in m/s. Must have length 3.dv- velocity adjustment (in x,y,z axes). Expressed in m/s. Must have length 3.a- acceleration (in x,y,z axes). Expressed in m/s. Must have length 3.dt- time interval to compute prediction expressed in seconds.result- instance where updated velocity is stored. Must have length 3.jacobianV- jacobian wrt velocity. Must be 3x3.jacobianDV- jacobian wrt velocity adjustment. Must be 3x3.jacobianA- jacobian wrt acceleration. Must be 3x3.- Throws:
IllegalArgumentException- if any of provided jacobians does not have proper size, or if result "v", "dv" or "a" do not have length 3.
-
predictWithVelocityAdjustment
public static void predictWithVelocityAdjustment(double[] v, double[] dv, double[] a, double dt, double[] result) Predicts the updated velocity.- Parameters:
v- current velocity (in x,y,z axes). Expressed in m/s. Must have length 3.dv- velocity adjustment (in x,y,z axes). Expressed in m/s. Must have length 3.a- acceleration (in x,y,z axes). Expressed in m/s. Must have length 3.dt- time interval to compute prediction expressed in seconds.result- instance where updated velocity is stored. Must have length 3.- Throws:
IllegalArgumentException- if v, dv, a or result do not have length 3.
-
predictWithVelocityAdjustment
public static double[] predictWithVelocityAdjustment(double vx, double vy, double vz, double dvx, double dvy, double dvz, double ax, double ay, double az, double dt, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianDV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.- Parameters:
vx- current velocity in x-axis. Expressed in m/s.vy- current velocity in y-axis. Expressed in m/s.vz- current velocity in z-axis. Expressed in m/s.dvx- velocity adjustment in x-axis. Expressed in m/s.dvy- velocity adjustment in y-axis. Expressed in m/s.dvz- velocity adjustment in z-axis. Expressed in m/s.ax- acceleration in x-axis. Expressed in m/s^2.ay- acceleration in y-axis. Expressed in m/s^2.az- acceleration in z-axis. Expressed in m/s^2.dt- time interval to compute prediction expressed in seconds.jacobianV- jacobian wrt velocity. Must be 3x3.jacobianDV- jacobian wrt velocity adjustment. Must be 3x3.jacobianA- jacobian wrt acceleration. Must be 3x3.- Returns:
- a new array containing updated velocity.
- Throws:
IllegalArgumentException- if any of provided jacobians does not have proper size.
-
predictWithVelocityAdjustment
public static double[] predictWithVelocityAdjustment(double vx, double vy, double vz, double dvx, double dvy, double dvz, double ax, double ay, double az, double dt) Predicts the updated velocity.- Parameters:
vx- current velocity in x-axis. Expressed in m/s.vy- current velocity in y-axis. Expressed in m/s.vz- current velocity in z-axis. Expressed in m/s.dvx- velocity adjustment in x-axis. Expressed in m/s.dvy- velocity adjustment in y-axis. Expressed in m/s.dvz- velocity adjustment in z-axis. Expressed in m/s.ax- acceleration in x-axis. Expressed in m/s^2.ay- acceleration in y-axis. Expressed in m/s^2.az- acceleration in z-axis. Expressed in m/s^2.dt- time interval to compute prediction expressed in seconds.- Returns:
- a new array containing updated velocity.
-
predictWithVelocityAdjustment
public static double[] predictWithVelocityAdjustment(double[] v, double[] dv, double[] a, double dt, com.irurueta.algebra.Matrix jacobianV, com.irurueta.algebra.Matrix jacobianDV, com.irurueta.algebra.Matrix jacobianA) Predicts the updated velocity.- Parameters:
v- current velocity (in x,y,z axes). Expressed in m/s. Must have length 3.dv- velocity adjustment (in x,y,z axes). Expressed in m/s. Must have length 3.a- acceleration (in x,y,z axes). Expressed in m/s. Must have length 3.dt- time interval to compute prediction expressed in seconds.jacobianV- jacobian wrt velocity. Must be 3x3.jacobianDV- jacobian wrt velocity adjustment. Must be 3x3.jacobianA- jacobian wrt acceleration. Must be 3x3.- Returns:
- a new array containing updated velocity.
- Throws:
IllegalArgumentException- if any of provided jacobians does not have proper size, or if "v", "dv" or "a" do not have length 3.
-
predictWithVelocityAdjustment
public static double[] predictWithVelocityAdjustment(double[] v, double[] dv, double[] a, double dt) Predicts the updated velocity.- Parameters:
v- current velocity (in x,y,z axes). Expressed in m/s. Must have length 3.dv- velocity adjustment (in x,y,z axes). Expressed in m/s. Must have length 3.a- acceleration (in x,y,z axes). Expressed in m/s. Must have length 3.dt- time interval to compute prediction expressed in seconds.- Returns:
- a new array containing updated velocity.
- Throws:
IllegalArgumentException- if v, dv or a do not have length 3.
-