Intrusive changes made for UAVCAN profiling. Will be reverted in the next commit (this one is needed to keep the changes in history)

This commit is contained in:
Pavel Kirienko
2015-01-21 14:54:23 +01:00
committed by Lorenz Meier
parent 543cb23128
commit 6bbacc4271
4 changed files with 20 additions and 7 deletions
+5 -5
View File
@@ -98,11 +98,11 @@ void UavcanEscController::update_outputs(float *outputs, unsigned num_outputs)
/*
* Rate limiting - we don't want to congest the bus
*/
const auto timestamp = _node.getMonotonicTime();
if ((timestamp - _prev_cmd_pub).toUSec() < (1000000 / MAX_RATE_HZ)) {
return;
}
_prev_cmd_pub = timestamp;
// const auto timestamp = _node.getMonotonicTime();
// if ((timestamp - _prev_cmd_pub).toUSec() < (1000000 / MAX_RATE_HZ)) {
// return;
// }
// _prev_cmd_pub = timestamp;
/*
* Fill the command message
+10
View File
@@ -357,6 +357,16 @@ int UavcanNode::run()
_actuator_direct_poll_fd_num = add_poll_fd(_actuator_direct_sub);
}
_esc_controller.arm_all_escs(true);
while (true) {
for (int i = 0; i < 1000; i++) {
node_spin_once();
_outputs.noutputs = 8;
_esc_controller.update_outputs(_outputs.output, _outputs.noutputs);
}
::usleep(1000);
}
while (!_task_should_exit) {
// update actuator controls subscriptions if needed
if (_groups_subscribed != _groups_required) {