mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 03:13:33 +08:00
uavcan: limit actuator controls poll interval
* rather than only in UavcanEscController updates
This commit is contained in:
@@ -73,6 +73,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
void set_rotor_count(uint8_t count) { _rotor_count = count; }
|
void set_rotor_count(uint8_t count) { _rotor_count = count; }
|
||||||
|
|
||||||
|
static constexpr unsigned MAX_RATE_HZ = 200; ///< XXX make this configurable
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* ESC status message reception will be reported via this callback.
|
* ESC status message reception will be reported via this callback.
|
||||||
@@ -89,7 +91,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
uint8_t check_escs_status();
|
uint8_t check_escs_status();
|
||||||
|
|
||||||
static constexpr unsigned MAX_RATE_HZ = 200; ///< XXX make this configurable
|
|
||||||
static constexpr unsigned ESC_STATUS_UPDATE_RATE_HZ = 10;
|
static constexpr unsigned ESC_STATUS_UPDATE_RATE_HZ = 10;
|
||||||
static constexpr unsigned UAVCAN_COMMAND_TRANSFER_PRIORITY = 5; ///< 0..31, inclusive, 0 - highest, 31 - lowest
|
static constexpr unsigned UAVCAN_COMMAND_TRANSFER_PRIORITY = 5; ///< 0..31, inclusive, 0 - highest, 31 - lowest
|
||||||
|
|
||||||
|
|||||||
@@ -1058,6 +1058,7 @@ UavcanNode::subscribe()
|
|||||||
|
|
||||||
if (_control_subs[i] >= 0) {
|
if (_control_subs[i] >= 0) {
|
||||||
_poll_ids[i] = add_poll_fd(_control_subs[i]);
|
_poll_ids[i] = add_poll_fd(_control_subs[i]);
|
||||||
|
orb_set_interval(_control_subs[i], 1000000 / UavcanEscController::MAX_RATE_HZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user