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:
I think may be the problem of typemask and coordinate_frame?
I used try to do “forward” behavior ,use (’'mavros/setpoint_raw/local")
(Right-Forward-Up: How mavros understands raw (velocity) setpoints,so y – forward)
from https://github.com/mavlink/mavros/issues/792#issuecomment-414213693
vel = PositionTarget()
vel.header.stamp = rospy.Time.now()
vel.coordinate_frame = PositionTarget.FRAME_BODY_NED
vel.type_mask = PositionTarget.IGNORE_PX + PositionTarget.IGNORE_PY + PositionTarget.IGNORE_PZ + PositionTarget.IGNORE_AFY + PositionTarget.IGNORE_AFZ + PositionTarget.FORCE + PositionTarget.IGNORE_YAW +PositionTarget.IGNORE_YAW_RATE
vel.velocity.x = 0.0
vel.velocity.y = 1.0
vel.velocity.z = 0.0
set_v_pub.publish(vel)
rate.sleep()