mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-22 06:14:14 +08:00
uavcan: remove actuator_direct (no publisher)
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
set(msg_files
|
||||
actuator_armed.msg
|
||||
actuator_controls.msg
|
||||
actuator_direct.msg
|
||||
actuator_outputs.msg
|
||||
adc_report.msg
|
||||
airspeed.msg
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint8 NUM_ACTUATORS_DIRECT = 16
|
||||
uint32 nvalues # number of valid values
|
||||
float32[16] values # actuator values, from -1 to 1
|
||||
@@ -3,8 +3,6 @@ rtps:
|
||||
id: 0
|
||||
- msg: actuator_controls
|
||||
id: 1
|
||||
- msg: actuator_direct
|
||||
id: 2
|
||||
- msg: actuator_outputs
|
||||
id: 3
|
||||
- msg: adc_report
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
@@ -65,15 +65,14 @@
|
||||
#include <uORB/Subscription.hpp>
|
||||
#include <uORB/topics/actuator_armed.h>
|
||||
#include <uORB/topics/actuator_controls.h>
|
||||
#include <uORB/topics/actuator_direct.h>
|
||||
#include <uORB/topics/actuator_outputs.h>
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
#include <uORB/topics/test_motor.h>
|
||||
|
||||
#define NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN 4
|
||||
|
||||
// we add two to allow for actuator_direct and busevent
|
||||
#define UAVCAN_NUM_POLL_FDS (NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN+2)
|
||||
// we add 1 to allow for busevent
|
||||
#define UAVCAN_NUM_POLL_FDS (NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN+1)
|
||||
|
||||
/**
|
||||
* A UAVCAN node.
|
||||
@@ -204,10 +203,6 @@ private:
|
||||
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)};
|
||||
uORB::Subscription _test_motor_sub{ORB_ID(test_motor)};
|
||||
|
||||
int _actuator_direct_sub{-1}; ///< uORB subscription of the actuator_direct topic
|
||||
uint8_t _actuator_direct_poll_fd_num{0};
|
||||
|
||||
|
||||
perf_counter_t _cycle_perf;
|
||||
perf_counter_t _interval_perf;
|
||||
perf_counter_t _control_latency_perf;
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
#define NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN 1
|
||||
#define UAVCAN_DEVICE_PATH "/dev/uavcan/esc"
|
||||
|
||||
// we add two to allow for actuator_direct and busevent
|
||||
#define UAVCAN_NUM_POLL_FDS (NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN+2)
|
||||
// we add 1 to allow for busevent
|
||||
#define UAVCAN_NUM_POLL_FDS (NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN+1)
|
||||
|
||||
/**
|
||||
* A UAVCAN node.
|
||||
|
||||
@@ -51,8 +51,8 @@
|
||||
#define NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN 1
|
||||
#define UAVCAN_DEVICE_PATH "/dev/uavcan/node"
|
||||
|
||||
// we add two to allow for actuator_direct and busevent
|
||||
#define UAVCAN_NUM_POLL_FDS (NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN+2)
|
||||
// we add 1 to allow for busevent
|
||||
#define UAVCAN_NUM_POLL_FDS (NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN+1)
|
||||
|
||||
/**
|
||||
* A UAVCAN node.
|
||||
|
||||
Reference in New Issue
Block a user