[ros-users] Problems publishing topics

Manuel Rodríguez mrodriguez at robotnik.es
Fri Oct 21 08:35:42 UTC 2011


Hi all,

I'm trying to publishing to a topic but I have an absurd problem:

When I use this:

*self.pub = rospy.Publisher('arm_controller/command', JointTrajectory)*
*msg = JointTrajectory()*
*self.pub.publish(msg)*

it does not publish absolutly nothing.

But, if I use the pub.publish inside an infinite loop, it works:

*self.pub = rospy.Publisher('arm_controller/command', JointTrajectory)*
*msg = JointTrajectory()*
*while True:*
*          self.pub.publish(msg)*



I can publish with -rostopic pub- without problems, so it's a code problem?
What I should change?

Best regards
manuel



*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20111021/46f9eede/attachment-0003.html>


More information about the ros-users mailing list