Ask Your Question

Revision history [back]

What exactly didn´t you understand? The tutorial:

http://www.ros.org/wiki/ROS/Tutorials/WritingPublisherSubscriber%28python%29

tells you everything you need to know. You can use the same code to write a simple publisher with the only difference that instead of a string you will need to post a pose. Code should look similar to the following:

import roslib; roslib.load_manifest('geometry_msgs')    
(...)
from geometry_msgs.msg import PoseStamped
(...) 
my_pose = Pose()
my_pose.position.x = 0.1
my_pose.position.y = 0.2
(...)
        pub.publish(my_pose)
(...)

Get it?

What exactly didn´t you understand? The I know there is a way to publish such messages via command line, but for more complex messages i recommend to write a simple publisher like in the tutorial:

http://www.ros.org/wiki/ROS/Tutorials/WritingPublisherSubscriber%28python%29

tells you everything you need to know. You can use the same code to write a simple publisher with the only difference that instead of a string you will need to post a pose. Code should look similar to the following:

import roslib; roslib.load_manifest('geometry_msgs')    
(...)
from geometry_msgs.msg import PoseStamped
(...) 
my_pose = Pose()
my_pose.position.x = 0.1
my_pose.position.y = 0.2
(...)
        pub.publish(my_pose)
(...)

Get it?