aau-cns / mars_ros

A ROS wrapper for the MaRS Library
Other
56 stars 12 forks source link

[Question] Shouldn't stamped messages have a frame id? #3

Closed dantenoguera closed 2 years ago

dantenoguera commented 2 years ago

Here is a geometry_msgs/PoseStamped message I get running an instance of a gps_node:

header: 
  seq: 12188
  stamp: 
    secs: 1661984306
    nsecs: 715818644
  frame_id: ''
pose: 
  position: 
    x: -0.6634237632091935
    y: 3.4947216960559073
    z: 0.06363313476750493
  orientation: 
    x: -0.005933376892896241
    y: 0.18921987844821742
    z: 0.02400976216308664
    w: 0.9816232291259008

(Notice the empty frame_id)

Without frame_id we can't visualize poses, for example.

Chris-Bee commented 2 years ago

Hello @dantenoguera, thank you for pointing this out. For the pose, we can usually visualize the location with RVIS despite not having a frame_id. However, the conversion to Odometry messages does require a child frame id (see for ref.):

static inline nav_msgs::Odometry EigenVec3dToOdomMsg(const double& t, const Eigen::Vector3d& position)
  {
    nav_msgs::Odometry odom_msg;

    odom_msg.header.stamp.fromSec(t);
    odom_msg.header.frame_id = "map";
    odom_msg.child_frame_id = "map";

However, if this does not work correctly on your side, we'll add the reference to the conversion soon.

Chris-Bee commented 2 years ago

The update is prepared from @mascheiber and will be online soon.

Chris-Bee commented 2 years ago

Added in b0642a04, feel free to check out the addition of rviz and tf2 publishing done by @mascheiber in a2fe758