24 using namespace gtsam;
29 static const Vector g = Vector::Unit(3,2)*(-9.81);
32 TEST(testIMUSystem, instantiations) {
41 Vector accel = Vector::Ones(3), gyro = Vector::Ones(3);
55 TEST( testIMUSystem, optimize_chain ) {
57 const double dt = 1.0;
61 pose4(
Point3(3.0, 3.0, 0.0), Rot3::Ypr(0.3, 0.0, 0.0),
Velocity3(2.0, 2.0, 0.0));
67 Vector6 imu34 =
pose3.imuPrediction(pose4,
dt);
84 true_values.insert(
x4, pose4);
101 TEST( testIMUSystem, optimize_chain_fullfactor ) {
103 const double dt = 1.0;
107 pose4(
Point3(3.0, 0.0, 0.0), Rot3::Ypr(0.0, 0.0, 0.0),
Velocity3(1.0, 0.0, 0.0));
113 Vector6 imu34 =
pose3.imuPrediction(pose4,
dt);
127 true_values.insert(
x4, pose4);
146 TEST( testIMUSystem, linear_trajectory) {
149 const double dt = 1.0;
152 Vector accel = Vector::Unit(3,0)*0.5;
153 Vector gyro = Vector::Unit(3,0)*0.1;
156 Values true_traj, init_traj;
165 for (
size_t i=1;
i<nrPoses; ++
i) {
166 Key xA =
i-1, xB =
i;
169 true_traj.
insert(xB, cur_pose);