ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

If you change the id of the visualization_msgs/Marker, it might work. referring to the MakerClient code, it seems to erase markers with the same ns and id in the callback.

https://github.com/RobotWebTools/ros3djs/blob/2dc003cc7190137bf789c33c3637e254d676f285/src/markers/MarkerClient.js#L71-L97

If you change the id of the visualization_msgs/Marker, it might work. referring to the MakerClient code, it seems to erase markers with the same ns and id in the callback.

https://github.com/RobotWebTools/ros3djs/blob/2dc003cc7190137bf789c33c3637e254d676f285/src/markers/MarkerClient.js#L71-L97

Update

Perhaps your hypothesis is correct. The base_link is changing, so the marker is probably being recorded in the same place all the time. I have thought of a way to deal with this.

Idea

  1. change frame_id to map from base_link
  2. use tf2 to calculate the difference (geometry_msgs/TransformStamped) between map and base_link ( ref: http://wiki.ros.org/tf2/Tutorials/Writing%20a%20tf2%20listener%20%28C%2B%2B%29 )
  3. Set the difference calculated above to Marker's pose. (Set the translation of TransformStamped to the position of the pose, and set the rotation of TransformStamped to the orientation of the pose.)
  4. Set frame_locked back to true