Mavros setpoint_position/global not working

asked 2019-03-21 18:40:16 -0500

rezenders gravatar image

Hello everyone,

I'm trying to use mavros with rospy in order to make my drone takeoff and go to some waypoints. Right now I'm running my experiments in STIL, not a real drone.

However, I can't manage to make the drone move to the desired waypoint. I'm trying to use the topic '/mavros/setpoint_position/global' to publish the coordinates, like this:

setpoint_global_pub = rospy.Publisher(
            '/mavros/setpoint_position/global',
            mavros_msgs.msg.GlobalPositionTarget,
            queue_size=1,
            latch=True)

setpoint_global_pub.publish(latitude= -27.603683, longitude= -48.518052, altitude=40)

I get this message in mavros:

 [WARN] [1553207581.536736778]: SPG: sp not sent.

Any suggestions?

Btw I'm setting the mode to GUIDED and taking off first

edit retag flag offensive close merge delete