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

Publish message on geometry_msgs/TwistStamped from terminal

asked 2018-01-25 07:51:00 -0500

eirikaso gravatar image

updated 2018-01-25 07:55:34 -0500

Hi there I'm back to using ROS after a few years break and would appreciate some help.

I'm trying to publish a message from the terminal but are having trouble getting the arguments right. Could anyone help me with this?

The message is geometry_msgs/TwistStamped: http://docs.ros.org/jade/api/geometry...

std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
geometry_msgs/Twist twist
  geometry_msgs/Vector3 linear
    float64 x
    float64 y
    float64 z
  geometry_msgs/Vector3 angular    
    float64 x
    float64 y
    float64 z

I have tried all sorts of combinations but no luck.

One example:

rostopic pub -r 100 /mavros/setpoint_velocity/cmd_vel geometry_msgs/TwistStamped "{header: auto, twist.linear:[1, 2, 3], twist.angular:[1, 1, 1]}"
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2018-01-25 09:14:29 -0500

AndyZe gravatar image

updated 2018-01-25 09:15:15 -0500

After entering this much of the command:

rostopic pub -r 100 /mavros/setpoint_velocity/cmd_vel

You should be able to press Tab a couple times and it will fill in a blank message for you. I don't think you need to specify geometry_msgs/TwistStamped.

edit flag offensive delete link more

Comments

That worked, thanks.

eirikaso gravatar image eirikaso  ( 2018-01-25 09:31:09 -0500 )edit
0

answered 2018-01-25 09:00:05 -0500

devious_archangel gravatar image

I think it is supposed to be like this without the square brackets:

rostopic pub -r 100 /mavros/setpoint_velocity/cmd_vel geometry_msgs/TwistStamped"{header: auto,  twist.linear: {x: 1, y: 2, z: 3}, twist.angular: {x: 1,y: 1,z: 1}"
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-01-25 07:51:00 -0500

Seen: 4,899 times

Last updated: Jan 25 '18