diff options
author | Pavel Kirienko <pavel.kirienko@gmail.com> | 2015-01-17 04:04:48 +0300 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-21 14:54:23 +0100 |
commit | d87bb4dfcb59601bc51d46332bbe0db78d11294a (patch) | |
tree | 8bc5a1c08de9bcb8fbb0a8bb20b022c995d711b5 /src/modules/uavcan | |
parent | 6bbacc4271680cc262094af7f9a34807ff5c34ed (diff) | |
download | px4-firmware-d87bb4dfcb59601bc51d46332bbe0db78d11294a.tar.gz px4-firmware-d87bb4dfcb59601bc51d46332bbe0db78d11294a.tar.bz2 px4-firmware-d87bb4dfcb59601bc51d46332bbe0db78d11294a.zip |
Revert "Intrusive changes made for UAVCAN profiling. Will be reverted in the next commit (this one is needed to keep the changes in history)"
This reverts commit 4c301d9dcf180e39186fa6753c7a3d3215b3cfa7.
Diffstat (limited to 'src/modules/uavcan')
-rw-r--r-- | src/modules/uavcan/actuators/esc.cpp | 10 | ||||
-rw-r--r-- | src/modules/uavcan/uavcan_main.cpp | 10 |
2 files changed, 5 insertions, 15 deletions
diff --git a/src/modules/uavcan/actuators/esc.cpp b/src/modules/uavcan/actuators/esc.cpp index f7adbed76..995c8987c 100644 --- a/src/modules/uavcan/actuators/esc.cpp +++ b/src/modules/uavcan/actuators/esc.cpp @@ -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 diff --git a/src/modules/uavcan/uavcan_main.cpp b/src/modules/uavcan/uavcan_main.cpp index c29cd8323..af5f2ec96 100644 --- a/src/modules/uavcan/uavcan_main.cpp +++ b/src/modules/uavcan/uavcan_main.cpp @@ -357,16 +357,6 @@ 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) { |