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

Revision history [back]

click to hide/show revision 1
initial version

You can take example on this command:

rostopic pub <topic_name> <topic-type> "{header: {stamp: now, frame_id: 'value'}}"

Here you can define the parameters for your header (you can also write {header: auto} if you don't care about those parameters).

For your application this should be:

rostopic pub -r 1 /mavros/setpoint_position/local  geometry_msgs/PoseStamped "{header:{stamp: now, frame_id: 'value'}, pose: {position: {x: 1.0, y:5.0, z: 2.0}, orientation: {x: 0.0, y:1.0, z: 5.0, w: 10.0}}}"

This is to answer your question but you should really consider writing a simple publisher with parameters/arguments that you could define when executing a rosrun/roslaunch command.

You can take example on this command:

rostopic pub <topic_name> <topic-type> "{header: {stamp: now, frame_id: 'value'}}"

Here you can define the parameters for your header (you can also write {header: auto} if you don't care about those parameters).

For your application this should be:

rostopic pub -r 1 /mavros/setpoint_position/local  geometry_msgs/PoseStamped "{header:{stamp: now, frame_id: 'value'}, pose: {position: {x: 1.0, y:5.0, y: 5.0, z: 2.0}, orientation: {x: 0.0, y:1.0, y: 1.0, z: 5.0, w: 10.0}}}"

This is to answer your question but you should really consider writing a simple publisher with parameters/arguments that you could define when executing a rosrun/roslaunch command.