mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 05:43:34 +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 # [us] Time since system start
|
||||||
uint64 timestamp_sample # timestamp of the data sample on which this message is based (microseconds)
|
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
|
||||||
# TOPICS vehicle_thrust_setpoint_virtual_fw vehicle_thrust_setpoint_virtual_mc
|
# 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;
|
vehicle_thrust_setpoint_s vehicle_thrust_setpoint;
|
||||||
|
|
||||||
if (_vehicle_thrust_setpoint_sub.update(&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_control_mode_s vehicle_control_mode;
|
vehicle_control_mode_s vehicle_control_mode;
|
||||||
|
|||||||
Reference in New Issue
Block a user