mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 06:43:34 +08:00
uavcan: esc: fix uavcan ESC control
This fixes a number of issues with uavcan ESC control. - Motor Testing when using a CANnode as a PWM expander now works by allowing the FunctionMotors class to perform prearm control - The esc.RawCommand message is now always published for configured uavcan ESC outputs. Previously prior to arming the message would be published empty, which causes certain ESCs to enter an error state. - Useless and redundant code has been removed and small name changes have been applied.
This commit is contained in:
@@ -602,18 +602,6 @@ UavcanNode::init(uavcan::NodeID node_id, UAVCAN_DRIVER::BusEvent &bus_events)
|
||||
PX4_DEBUG("sensor bridge '%s' init ok", br->get_name());
|
||||
}
|
||||
|
||||
#if defined(CONFIG_UAVCAN_OUTPUTS_CONTROLLER)
|
||||
|
||||
// Ensure we don't exceed maximum limits and assumptions. FIXME: these should be static assertions
|
||||
if (UavcanEscController::max_output_value() >= UavcanEscController::DISARMED_OUTPUT_VALUE
|
||||
|| UavcanEscController::max_output_value() > (int)UINT16_MAX) {
|
||||
PX4_ERR("ESC max output value assertion failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
_mixing_interface_esc.mixingOutput().setAllDisarmedValues(UavcanEscController::DISARMED_OUTPUT_VALUE);
|
||||
#endif
|
||||
|
||||
/* Set up shared service clients */
|
||||
_param_getset_client.setCallback(GetSetCallback(this, &UavcanNode::cb_getset));
|
||||
_param_opcode_client.setCallback(ExecuteOpcodeCallback(this, &UavcanNode::cb_opcode));
|
||||
|
||||
Reference in New Issue
Block a user