Problem with exercise 7.6

hello,

i tried to execute the action client to move the robot and also take photos.
i used the “Twist” message and a while loop but the robot doesn’t move.

this is the while loop i created:

state_result = client.get_state()

rate = rospy.Rate(1)

rospy.loginfo("state_result: "+str(state_result))
pub.publish(move)
while state_result < DONE:
rospy.loginfo(“Doing Stuff while waiting for the Server to give a result…”)
pub.publish(move)
rate.sleep()
state_result = client.get_state()
rospy.loginfo("state_result: "+str(state_result))
move.linear.x = 0
move.angular.z = 0
pub.publish(move)

do u see a problem?
thanks!

@yuval.shlomo,

Welcome to the Community!

Please check for the following:

  • Did you create a publisher for the cmd_vel topic?
  • Also, did you take off the drone before trying to move it? You need to create a separate publisher for this as well.
  • Please also take note that publishing to a topic once might not work. See this post on how to publish once and get it to work.

thank you very much! it’s working:)

1 Like