mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 19:43:34 +08:00
uavcan: remove actuator_direct (no publisher)
This commit is contained in:
@@ -139,8 +139,6 @@ UavcanNode::~UavcanNode()
|
||||
} while (_task != -1);
|
||||
}
|
||||
|
||||
(void)orb_unsubscribe(_actuator_direct_sub);
|
||||
|
||||
// Removing the sensor bridges
|
||||
_sensor_bridges.clear();
|
||||
|
||||
@@ -763,8 +761,6 @@ UavcanNode::run()
|
||||
// XXX figure out the output count
|
||||
_output_count = 2;
|
||||
|
||||
_actuator_direct_sub = orb_subscribe(ORB_ID(actuator_direct));
|
||||
|
||||
actuator_outputs_s outputs{};
|
||||
|
||||
// Set up the time synchronization
|
||||
@@ -808,14 +804,6 @@ UavcanNode::run()
|
||||
*/
|
||||
add_poll_fd(busevent_fd);
|
||||
|
||||
/*
|
||||
* setup poll to look for actuator direct input if we are
|
||||
* subscribed to the topic
|
||||
*/
|
||||
if (_actuator_direct_sub != -1) {
|
||||
_actuator_direct_poll_fd_num = add_poll_fd(_actuator_direct_sub);
|
||||
}
|
||||
|
||||
update_params();
|
||||
|
||||
while (!_task_should_exit) {
|
||||
@@ -886,23 +874,6 @@ UavcanNode::run()
|
||||
}
|
||||
}
|
||||
|
||||
// see if we have any direct actuator updates
|
||||
actuator_direct_s actuator_direct{};
|
||||
|
||||
if (_actuator_direct_sub != -1 &&
|
||||
(_poll_fds[_actuator_direct_poll_fd_num].revents & POLLIN) &&
|
||||
orb_copy(ORB_ID(actuator_direct), _actuator_direct_sub, &actuator_direct) == OK &&
|
||||
!_test_in_progress) {
|
||||
|
||||
if (actuator_direct.nvalues > actuator_outputs_s::NUM_ACTUATOR_OUTPUTS) {
|
||||
actuator_direct.nvalues = actuator_outputs_s::NUM_ACTUATOR_OUTPUTS;
|
||||
}
|
||||
|
||||
memcpy(&outputs.output[0], &actuator_direct.values[0], actuator_direct.nvalues * sizeof(float));
|
||||
outputs.noutputs = actuator_direct.nvalues;
|
||||
new_output = true;
|
||||
}
|
||||
|
||||
// can we mix?
|
||||
if (_test_in_progress) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user