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

Revision history [back]

For any message with a header, you should set the frame_id and stamp. You can ignore seq; it will be set automatically. Reusing the same object, and updating the relevant fields each time you publish should be fine, as long as it hasn't gone out of scope.

For any message with a header, you should set the frame_id and stamp. You can ignore seq; it will be set automatically. Reusing the same object, and updating the relevant fields each time you publish should be fine, as long as it hasn't gone out of scope.

The stamp can be set with ros::Time::now(), and frame_id can be set with a string like you did in your question.

For any message with a header, you should set the frame_id and stamp. You can ignore seq; it will be set automatically. Reusing the same object, and updating the relevant fields each time you publish should be fine, as long as it hasn't gone out of scope.

The stamp can be set with a ros::Time object like ros::Time::now(), and frame_id can be set with a string like you did in your question.