refactor(VehicleThrustSetpoint.msg): define NAN as motor stop

Signed-off-by: Silvan <silvan@auterion.com>
This commit is contained in:
Silvan
2026-02-16 17:43:52 +01:00
committed by Balduin
parent 3f0d0ebc10
commit 244a324ef7
2 changed files with 7 additions and 4 deletions

View File

@@ -1,8 +1,11 @@
# Vehicle thrust setpoint
#
# This is the thrust setpoint provided by the controller and fed into the control allocator.
uint64 timestamp # time since system start (microseconds)
uint64 timestamp_sample # timestamp of the data sample on which this message is based (microseconds)
uint64 timestamp # [us] Time since system start
uint64 timestamp_sample # [us] Timestamp of the data sample on which this message is based
float32[3] xyz # thrust setpoint along X, Y, Z body axis [-1, 1]
float32[3] xyz # [-] [@range -1, 1] Thrust setpoint along X, Y, Z body axis. If set to NAN the motors affecting this axis are stopped.
# TOPICS vehicle_thrust_setpoint
# TOPICS vehicle_thrust_setpoint_virtual_fw vehicle_thrust_setpoint_virtual_mc

View File

@@ -89,7 +89,7 @@ void MulticopterLandDetector::_update_topics()
vehicle_thrust_setpoint_s vehicle_thrust_setpoint;
if (_vehicle_thrust_setpoint_sub.update(&vehicle_thrust_setpoint)) {
_vehicle_thrust_setpoint_throttle = -vehicle_thrust_setpoint.xyz[2];
_vehicle_thrust_setpoint_throttle = PX4_ISFINITE(vehicle_thrust_setpoint.xyz[2]) ? -vehicle_thrust_setpoint.xyz[2] : 0.f;
_vehicle_thrust_setpoint_last_update = hrt_absolute_time();
}