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

Revision history [back]

click to hide/show revision 1
initial version

I changed my while not rospy.is_shutdown(): to

while not rospy.is_shutdown(): self.cmd_vel.publish(move_cmd) if bump==True: #45 deg/s in radians/s # publish the velocity self.cmd_vel.publish(move_cmd2) self.cmd_vel.publish(turn_cmd) # wait for 0.1 seconds (10 HZ) an #d publish again

        else: 
            continue 

    r.spin()

It seems like this logic is better but Im still not sure why my node will only publish this last command. It seems like my script does not go into this while loop at all.....

I changed my while not rospy.is_shutdown(): to

while not rospy.is_shutdown():
         self.cmd_vel.publish(move_cmd)
         if bump==True:
                   #45 deg/s in radians/s
             # publish the velocity
             self.cmd_vel.publish(move_cmd2)
             self.cmd_vel.publish(turn_cmd)
             # wait for 0.1 seconds (10 HZ) an
             #d publish again 

         else: 
            continue 

    r.spin()

It seems like this logic is better but Im still not sure why my node will only publish this last command. It seems like my script does not go into this while loop at all.....