mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-09-24 10:58:09 +08:00
refactor(VehicleThrustSetpoint.msg): define NAN as motor stop
Signed-off-by: Silvan <silvan@auterion.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user