mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
IOCTL for Hardpoint controller and instantiation for UavcanHardpointController as a field of UavcanNode
This commit is contained in:
@@ -69,6 +69,7 @@ px4_add_module(
|
|||||||
|
|
||||||
# Actuators
|
# Actuators
|
||||||
actuators/esc.cpp
|
actuators/esc.cpp
|
||||||
|
actuators/hardpoint.cpp
|
||||||
|
|
||||||
# Sensors
|
# Sensors
|
||||||
sensors/sensor_bridge.cpp
|
sensors/sensor_bridge.cpp
|
||||||
|
|||||||
@@ -1107,6 +1107,12 @@ UavcanNode::ioctl(file *filp, int cmd, unsigned long arg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case UAVCANIOC_HARDPOINT_SET:
|
||||||
|
const auto& cmd = *reinterpret_cast<uavcan::equipment::hardpoint::Command*>(arg);
|
||||||
|
_hardpoint_controller.set_command(cmd.hardpoint_id, cmd.command);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ret = -ENOTTY;
|
ret = -ENOTTY;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -70,6 +70,11 @@
|
|||||||
|
|
||||||
// we add two to allow for actuator_direct and busevent
|
// we add two to allow for actuator_direct and busevent
|
||||||
#define UAVCAN_NUM_POLL_FDS (NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN+2)
|
#define UAVCAN_NUM_POLL_FDS (NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN+2)
|
||||||
|
|
||||||
|
// no idea something to do with hardpoint controller
|
||||||
|
static constexpr unsigned UAVCANIOCBASE = 0x7800;
|
||||||
|
static constexpr unsigned UAVCANIOC_HARDPOINT_SET = PX4_IOC(UAVCANIOCBASE, 0x10);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A UAVCAN node.
|
* A UAVCAN node.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user