3 #include <Eigen/Geometry> 13 #define REV_CONDITIONAL_VAR_DIM 7 14 #define REV_NUM_CONDITIONAL_ARGS 2 30 ColumnVector state = ConditionalArgumentGet(0);
32 double phi = state(1);
33 double theta = state(2);
36 double st =
sin(theta);
37 double ct =
cos(theta);
43 Eigen::Vector3d rev_joint_orientation = Eigen::Vector3d(cp * st, sp * st, ct);
44 Eigen::Vector3d rev_joint_position = Eigen::Vector3d(px, py, pz);
48 Eigen::Vector3d joint_translation = (-rv * rev_joint_orientation).
cross(rev_joint_position);
50 Eigen::Twistd joint_pose = Eigen::Twistd(rv * rev_joint_orientation.x(),
51 rv * rev_joint_orientation.y(),
52 rv * rev_joint_orientation.z(),
53 joint_translation.x(),
54 joint_translation.y(),
55 joint_translation.z());
58 expected_pose(1) = joint_pose.vx();
59 expected_pose(2) = joint_pose.vy();
60 expected_pose(3) = joint_pose.vz();
61 expected_pose(4) = joint_pose.rx();
62 expected_pose(5) = joint_pose.ry();
63 expected_pose(6) = joint_pose.rz();
65 return expected_pose + this->AdditiveNoiseMuGet();
72 double phi = ConditionalArgumentGet(0)(1);
73 double theta = ConditionalArgumentGet(0)(2);
76 double st =
sin(theta);
77 double ct =
cos(theta);
79 double px = ConditionalArgumentGet(0)(3);
80 double py = ConditionalArgumentGet(0)(4);
81 double pz = ConditionalArgumentGet(0)(5);
82 double rv = ConditionalArgumentGet(0)(6);
86 dfx(1, 1) = -rv * cp * st * pz;
87 dfx(2, 1) = -rv * sp * st * pz;
88 dfx(3, 1) = rv * st * (cp * px + sp * py);
89 dfx(4, 1) = -rv * sp * st;
90 dfx(5, 1) = rv * cp * st;
92 dfx(1, 2) = -rv * (st * py + sp * ct * pz);
93 dfx(2, 2) = rv * (cp * ct * pz + st * px);
94 dfx(3, 2) = rv * ct * (sp * px - cp * py);
95 dfx(4, 2) = rv * cp * ct;
96 dfx(5, 2) = rv * sp * ct;
100 dfx(3, 3) = rv * sp * st;
103 dfx(3, 4) = -rv * cp * st;
105 dfx(1, 5) = -rv * sp * st;
106 dfx(2, 5) = rv * cp * st;
108 dfx(1, 6) = ct * py - sp * st * pz;
109 dfx(2, 6) = cp * st * pz - ct * px;
110 dfx(3, 6) = st * (sp * px - cp * py);
126 "The derivative is not implemented for the " << i <<
"th conditional argument");
#define REV_CONDITIONAL_VAR_DIM
NonLinearRevoluteMeasurementPdf(const Gaussian &additiveNoise)
#define ROS_ERROR_STREAM_NAMED(name, args)
TFSIMD_FORCE_INLINE Vector3 cross(const Vector3 &v) const
virtual ~NonLinearRevoluteMeasurementPdf()
MatrixWrapper::Matrix dfx
virtual MatrixWrapper::ColumnVector ExpectedValueGet() const
Get the expected value E[x] of the pdf Get low order statistic (Expected Value) of this AnalyticPdf...
virtual MatrixWrapper::Matrix dfGet(unsigned int i) const
Returns derivative from function to n-th conditional variable.
#define REV_NUM_CONDITIONAL_ARGS
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)