mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 18:03:33 +08:00
msg: extend field definition in msg/esc_report (arming & failure states)
Signed-off-by: Claudio Micheli <claudio@auterion.com>
This commit is contained in:
committed by
Beat Küng
parent
4e091a369d
commit
dc29a994b7
@@ -604,6 +604,7 @@ void DShotOutput::handleNewTelemetryData(int motor_index, const DShotTelemetry::
|
||||
++esc_status.counter;
|
||||
// FIXME: mark all ESC's as online, otherwise commander complains even for a single dropout
|
||||
esc_status.esc_online_flags = (1 << esc_status.esc_count) - 1;
|
||||
esc_status.esc_armed_flags = (1 << esc_status.esc_count) - 1;
|
||||
|
||||
_telemetry->esc_status_pub.update();
|
||||
|
||||
|
||||
@@ -611,6 +611,8 @@ MK::task_main()
|
||||
esc.timestamp = hrt_absolute_time();
|
||||
esc.esc_count = (uint8_t) _num_outputs;
|
||||
esc.esc_connectiontype = esc_status_s::ESC_CONNECTION_TYPE_I2C;
|
||||
esc.esc_online_flags = (1 << esc.esc_count) - 1;
|
||||
esc.esc_armed_flags = (1 << esc.esc_count) - 1;
|
||||
|
||||
for (unsigned int i = 0; i < _num_outputs; i++) {
|
||||
esc.esc[i].esc_address = (uint8_t) BLCTRL_BASE_ADDR + i;
|
||||
|
||||
@@ -573,6 +573,8 @@ void TAP_ESC::cycle()
|
||||
_esc_feedback.esc_connectiontype = esc_status_s::ESC_CONNECTION_TYPE_SERIAL;
|
||||
_esc_feedback.counter++;
|
||||
_esc_feedback.esc_count = num_outputs;
|
||||
_esc_feedback.esc_online_flags = (1 << num_outputs) - 1;
|
||||
_esc_feedback.esc_armed_flags = (1 << num_outputs) - 1;
|
||||
|
||||
_esc_feedback.timestamp = hrt_absolute_time();
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ UavcanEscController::orb_pub_timer_cb(const uavcan::TimerEvent &)
|
||||
_esc_status.counter += 1;
|
||||
_esc_status.esc_connectiontype = esc_status_s::ESC_CONNECTION_TYPE_CAN;
|
||||
_esc_status.esc_online_flags = check_escs_status();
|
||||
_esc_status.esc_armed_flags = (1 << _rotor_count) - 1;
|
||||
|
||||
_esc_status_pub.publish(_esc_status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user