In ArduPilot guided mode, I’m publishing to /mavros/setpoint_raw/local and setting msg.position.x = 1.0 to tell it to continously go forward one meter from current position (for 10 seconds). Instead, the drone increases altitude. In the logs, after “Started flu_move”, you can see that the z position increases from 1.8 to 45 meters. Does anyone have any idea why this is happening?
msg = PositionTarget()
msg.header.frame_id = "body_frame"
msg.coordinate_frame = PositionTarget.FRAME_BODY_OFFSET_NED
# Use position only
msg.type_mask = 0b111111111000
msg.position.x = 1.0
msg.position.y = 0.0
msg.position.z = 0.0
log.txt (46.0 KB)
msg.header.stamp = self.get_clock().now().to_msg()
self.flu_position_publisher.publish(msg)