diff options
author | Pavel Kirienko <pavel.kirienko@gmail.com> | 2015-01-17 04:04:31 +0300 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-21 14:54:23 +0100 |
commit | 6bbacc4271680cc262094af7f9a34807ff5c34ed (patch) | |
tree | a443289301c45920629d4f1428789832241b0210 | |
parent | 543cb231282fdb899557f42003f53ac2f7a7dcc7 (diff) | |
download | px4-firmware-6bbacc4271680cc262094af7f9a34807ff5c34ed.tar.gz px4-firmware-6bbacc4271680cc262094af7f9a34807ff5c34ed.tar.bz2 px4-firmware-6bbacc4271680cc262094af7f9a34807ff5c34ed.zip |
Intrusive changes made for UAVCAN profiling. Will be reverted in the next commit (this one is needed to keep the changes in history)
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rcS | 5 | ||||
-rw-r--r-- | makefiles/toolchain_gnu-arm-eabi.mk | 2 | ||||
-rw-r--r-- | src/modules/uavcan/actuators/esc.cpp | 10 | ||||
-rw-r--r-- | src/modules/uavcan/uavcan_main.cpp | 10 |
4 files changed, 20 insertions, 7 deletions
diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 2c9387ff0..02f4649d5 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -8,7 +8,7 @@ # # Default to auto-start mode. # -set MODE autostart +set MODE none set FRC /fs/microsd/etc/rc.txt set FCONFIG /fs/microsd/etc/config.txt @@ -656,6 +656,9 @@ then # End of autostart fi +param set UAVCAN_ENABLE 1 +sh /etc/init.d/rc.uavcan + # There is no further processing, so we can free some RAM # XXX potentially unset all script variables. unset TUNE_ERR diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk index fbe378f50..1bbc5437d 100644 --- a/makefiles/toolchain_gnu-arm-eabi.mk +++ b/makefiles/toolchain_gnu-arm-eabi.mk @@ -105,7 +105,7 @@ ARCHDEFINES += -DCONFIG_ARCH_BOARD_$(CONFIG_BOARD) # optimisation flags # ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ - -g \ + -g3 \ -fno-strict-aliasing \ -fno-strength-reduce \ -fomit-frame-pointer \ diff --git a/src/modules/uavcan/actuators/esc.cpp b/src/modules/uavcan/actuators/esc.cpp index 995c8987c..f7adbed76 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 af5f2ec96..c29cd8323 100644 --- a/src/modules/uavcan/uavcan_main.cpp +++ b/src/modules/uavcan/uavcan_main.cpp @@ -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) { |