<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE: 10pt">
<DIV>Hi Manuel.....</DIV>
<DIV> </DIV>
<DIV>Maybe this post will help you: <A 
title=http://answers.ros.org/question/2151/how-do-i-publish-exactly-one-message 
href="http://answers.ros.org/question/2151/how-do-i-publish-exactly-one-message">http://answers.ros.org/question/2151/how-do-i-publish-exactly-one-message</A></DIV>
<DIV> </DIV>
<DIV>Benoit</DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=mrodriguez@robotnik.es 
href="mailto:mrodriguez@robotnik.es">Manuel Rodríguez</A> </DIV>
<DIV><B>Sent:</B> Friday, October 21, 2011 10:35 AM</DIV>
<DIV><B>To:</B> <A title=ros-users@code.ros.org 
href="mailto:ros-users@code.ros.org">User discussions</A> </DIV>
<DIV><B>Subject:</B> [ros-users] Problems publishing topics</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">Hi 
all, 
<DIV> </DIV>
<DIV>
<DIV>I'm trying to publishing to a topic but I have an absurd 
problem:</DIV></DIV>
<DIV> </DIV>
<DIV>When I use this:</DIV>
<BLOCKQUOTE 
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 40px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0px" 
class=webkit-indent-blockquote>
  <DIV><I>self.pub = rospy.Publisher('arm_controller/command', 
  JointTrajectory)</I></DIV>
  <DIV><I>msg = JointTrajectory()</I></DIV>
  <DIV><I>self.pub.publish(msg)</I></DIV></BLOCKQUOTE>it does not publish 
absolutly nothing. 
<DIV> </DIV>
<DIV>But, if I use the pub.publish inside an infinite loop, it works:</DIV>
<BLOCKQUOTE 
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 40px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0px" 
class=webkit-indent-blockquote>
  <DIV>
  <DIV><I>self.pub = rospy.Publisher('arm_controller/command', 
  JointTrajectory)</I></DIV></DIV>
  <DIV>
  <DIV><I>msg = JointTrajectory()</I></DIV></DIV>
  <DIV>
  <DIV><I><B>while True:</B></I></DIV>
  <DIV><I>          
  self.pub.publish(msg)</I></DIV></DIV></BLOCKQUOTE>
<DIV> </DIV>
<DIV> </DIV>
<DIV>I can publish with -rostopic pub- without problems, so it's a code problem? 
What I should change?</DIV>
<DIV> </DIV>
<DIV>Best regards</DIV>
<DIV>manuel</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><BR><B><BR></B></DIV>
<P>
<HR>
_______________________________________________<BR>ros-users mailing 
list<BR>ros-users@code.ros.org<BR>https://code.ros.org/mailman/listinfo/ros-users<BR></DIV></DIV></DIV></BODY></HTML>