File tree 2 files changed +8
-0
lines changed
src/systems/odometry_publisher
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -467,6 +467,10 @@ void OdometryPublisherPrivate::UpdateOdometry(
467
467
msgCovariance.mutable_pose_with_covariance ()->
468
468
mutable_pose ()->mutable_position ()->set_z (msg.pose ().position ().z ());
469
469
470
+ // Copy orientation from odometry msg.
471
+ msgs::Set (msgCovariance.mutable_pose_with_covariance ()->mutable_pose ()->
472
+ mutable_orientation (), pose.Rot ());
473
+
470
474
// Copy twist from odometry msg.
471
475
msgCovariance.mutable_twist_with_covariance ()->
472
476
mutable_twist ()->mutable_angular ()->set_x (msg.twist ().angular ().x ());
Original file line number Diff line number Diff line change @@ -495,11 +495,14 @@ class OdometryPublisherTest
495
495
496
496
std::vector<math::Vector3d> odomLinVels;
497
497
std::vector<math::Vector3d> odomAngVels;
498
+ std::vector<math::Quaterniond> odomAngs;
498
499
google::protobuf::RepeatedField<float > odomTwistCovariance;
499
500
// Create function to store data from odometry messages
500
501
std::function<void (const msgs::OdometryWithCovariance &)> odomCb =
501
502
[&](const msgs::OdometryWithCovariance &_msg)
502
503
{
504
+ odomAngs.push_back (msgs::Convert (_msg.pose_with_covariance ().
505
+ pose ().orientation ()));
503
506
odomLinVels.push_back (msgs::Convert (_msg.twist_with_covariance ().
504
507
twist ().linear ()));
505
508
odomAngVels.push_back (msgs::Convert (_msg.twist_with_covariance ().
@@ -521,6 +524,7 @@ class OdometryPublisherTest
521
524
522
525
// Verify the Gaussian noise.
523
526
ASSERT_FALSE (odomLinVels.empty ());
527
+ ASSERT_FALSE (odomAngs.empty ());
524
528
ASSERT_FALSE (odomAngVels.empty ());
525
529
int n = odomLinVels.size ();
526
530
You can’t perform that action at this time.
0 commit comments