[ros-users] Problems publishing topics

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


Thanks a lot!

2011/10/21 Benoit Larochelle <Benoit.Larochelle at dfki.de>

>   Hi Manuel.....
>
> Maybe this post will help you:
> http://answers.ros.org/question/2151/how-do-i-publish-exactly-one-message
>
> Benoit
>
>  *From:* Manuel Rodríguez <mrodriguez at robotnik.es>
> *Sent:* Friday, October 21, 2011 10:35 AM
> *To:* User discussions <ros-users at code.ros.org>
> *Subject:* [ros-users] Problems publishing topics
>
> 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
>
>
>
> *
> *
>
> ------------------------------
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20111021/242f2c40/attachment-0004.html>


More information about the ros-users mailing list