-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Description
Describe the bug
When sending a vehicle_command with MAV_CMD_DO_SET_MODE (command ID 176) from a ROS 2 node, PX4 acknowledges the command as ACCEPTED, but the flight mode does not change. The navigation state remains unchanged (Navstate = 15).
To Reproduce
Create and publish a vehicle_command message with:
command = 176 (MAV_CMD_DO_SET_MODE)
param1 = 1.0 (base mode)
param2 = 262144.0 (custom mode)
target_system = 24
target_component = 1
source_system = 24
source_component = 191
from_external = false
Observe PX4 console output and vehicle status.
Expected behavior
PX4 should switch to the requested flight mode after acknowledging the command.
Or deny the command with a reason.
Sending other commands (e.g., VEHICLE_CMD_NAV_PRECLAND / command ID 23) works as expected and changes mode.
Tried:
Different target_system, source_system, and component IDs
Changing from_external flag
Screenshot / Media
Console log:
[INFO] [1764765859.886371898] [rc_commander]: Mode change requested: 16
[DEBUG] [1764765860.213064037] [rc_commander]: Vehicle Status: Navstate=15; Time in state=1764765667.312 sec
[DEBUG] [1764765860.474694807] [rc_commander]: VehicleCommand: ts=1764765860474687, command=176, param1=1.000, param2=262144.000, param3=0.000, target_system=24, target_component=1, source_system=24, source_component=191, from_external=false
[INFO] [1764765860.475026322] [rc_commander]: Mode change requested: 2
[DEBUG] [1764765860.488467163] [rc_commander]: COMMAND_ACK: ts=1764765860480765, cmd=176 (MAV_CMD_DO_SET_MODE), result=0 (ACCEPTED), result_param1=0, target_sys=24, target_comp=191
[DEBUG] [1764765860.488678923] [rc_commander]: Vehicle Status: Navstate=15; Time in state=1764765667.587 sec
Flight Log
No response
Software Version
PX4 version 1.15+ dev
ROS2 Jazzy
Cyclone DDS (Communication
Flight controller
Holybro Pixhawk 6X-RT
Vehicle type
Multicopter
How are the different components wired up (including port information)
FMU_V6XRT
NAVQplus
Connected via Ethernet
Additional context
No response