mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 10:26:52 +08:00
[uavcan] Param for interface mask of ESC actuators
This commit is contained in:
committed by
Niklas Hauser
parent
38bcc50127
commit
62c9bf8a47
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include "esc.hpp"
|
#include "esc.hpp"
|
||||||
#include <systemlib/err.h>
|
#include <systemlib/err.h>
|
||||||
|
#include <parameters/param.h>
|
||||||
#include <drivers/drv_hrt.h>
|
#include <drivers/drv_hrt.h>
|
||||||
|
|
||||||
#define MOTOR_BIT(x) (1<<(x))
|
#define MOTOR_BIT(x) (1<<(x))
|
||||||
@@ -66,6 +67,12 @@ UavcanEscController::init()
|
|||||||
|
|
||||||
_esc_status_pub.advertise();
|
_esc_status_pub.advertise();
|
||||||
|
|
||||||
|
int32_t iface_mask{0xFF};
|
||||||
|
|
||||||
|
if (param_get(param_find("UAVCAN_ESC_IFACE"), &iface_mask) == OK) {
|
||||||
|
_uavcan_pub_raw_cmd.getTransferSender().setIfaceMask(iface_mask);
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,29 @@
|
|||||||
module_name: UAVCAN
|
module_name: UAVCAN
|
||||||
|
parameters:
|
||||||
|
- group: UAVCAN
|
||||||
|
definitions:
|
||||||
|
UAVCAN_ESC_IFACE:
|
||||||
|
description:
|
||||||
|
short: Which CAN interfaces to output ESC messages on.
|
||||||
|
long: |
|
||||||
|
Since ESC messages are high priority and sent at a high rate, it is
|
||||||
|
recommended to only enable the interfaces that are actually used.
|
||||||
|
Otherwise, the ESC messages will arbitrate lower priority messages and
|
||||||
|
starve other nodes on the bus.
|
||||||
|
type: bitmask
|
||||||
|
bit:
|
||||||
|
0: CAN1
|
||||||
|
1: CAN2
|
||||||
|
2: CAN3
|
||||||
|
3: CAN4
|
||||||
|
4: CAN5
|
||||||
|
5: CAN6
|
||||||
|
6: CAN7
|
||||||
|
7: CAN8
|
||||||
|
default: 255
|
||||||
|
min: 1
|
||||||
|
max: 255
|
||||||
|
reboot_required: true
|
||||||
actuator_output:
|
actuator_output:
|
||||||
show_subgroups_if: 'UAVCAN_ENABLE>=3'
|
show_subgroups_if: 'UAVCAN_ENABLE>=3'
|
||||||
config_parameters:
|
config_parameters:
|
||||||
|
|||||||
Reference in New Issue
Block a user