Offboard problem MAVLink + PX4 Autopilot v1.15.0

Hello! I’m encountering a problem when sending the SET_POSITION_TARGET_LOCAL_NED MAVLink command in offboard mode.
When I try to send a SET_POSITION_TARGET_LOCAL_NED message with velocity using the type mask 0b0000110111000111, the POSITION_TARGET_LOCAL_NED message in QGroundControl’s MAVLink Inspector shows a frequency of 0.0 Hz. The mode does switch to Offboard, but the plane just freezes.
This issue did not occur in previous PX4 versions with the same code. Here is the snippet I’m using:

mavlink_set_position_target_local_ned_t msg;
	msg.time_boot_ms = (uint32_t) (microsSinceEpoch() / 1000);
	msg.x = NAN; 
	msg.y = NAN; 
	msg.z = NAN; 
	msg.vx = vx;
	msg.vy = vy;
	msg.vz = vz;
	msg.afx = NAN; 
	msg.afy = NAN; 
	msg.afz = NAN; 
	msg.yaw = NAN; 
	msg.yaw_rate = NAN; 
	msg.type_mask = MAVLINK_MSG_SET_POSITION_TARGET_LOCAL_NED_VELOCITY;
	msg.target_system = 1; 
	msg.target_component = 1; 
	msg.coordinate_frame = 1; //MAV_FRAME_LOCAL_NED = 1 MAV_FRAME_BODY_NED = 8;
mavlink_message_t message;
mavlink_msg_set_position_target_local_ned_encode(1, MAV_COMP_ID_ONBOARD_COMPUTER, &message, &msg);
send(message);
//PX4_CUSTOM_MAIN_MODE_OFFBOARD = 6

_commander.sendLong(MAV_CMD_DO_SET_MODE, MAV_MODE_FLAG_CUSTOM_MODE_ENABLED, PX4_CUSTOM_MAIN_MODE_OFFBOARD, 0);

My current build is px4_sitl_default gazebo-classic_plane_cam_mcmillan_airfield.

I’ve noticed that PX4’s offboard logic may have changed. In particular, vehicle_local_position_setpoints was replaced with trajectory_setpoints in the mavlink_receiver. Could that be causing the problem?

I also tested the MAVSDK offboard mode example and observed identical behavior in PX4 v1.15.0+—the plane freezes, and the messages do not appear.

Question: How do I get this working again? Is there a new parameter that needs adjusting, or should I be using a different MAVLink command with the new PX4 changes?

Any advice on how to restore velocity-based offboard movement in PX4 v1.15.0+ would be greatly appreciated. Thank you!

1 Like