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

Revision history [back]

If you are using python why do you want to use the following command?

rostopic pub -r 5 /uav1/sug_cmd_vel geometry_msgs/Twist -- '[0.0, 0.2, 0.0]' '[0.0, 0.0, 0.0]'

This command is meant to be used directly from the command line

You could just use rospy directly

import rospy
import roslib
roslib.load_manifest('your_package')
from geometry_msgs.msg import Twist
rospy.init_node('dummy')
# publish to cmd_vel
p = rospy.Publisher('/uav1/sug_cmd_vel', Twist)
# create a twist message, fill in the details
twist = Twist()
twist.linear.x =0.0;                 
twist.linear.y = 0.2; 
twist.linear.z = 0.0;   
twist.angular.x = 0; 
twist.angular.y = 0;  
twist.angular.z = 0; 
p.publish(twist)

don't forget to add geometry_msgs as dependency to your package in the manifest.xml.