diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-07 17:15:42 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-11 11:03:55 +0100 |
commit | 76821607130eab7916b70d789a189b2a52a115da (patch) | |
tree | 57d125bf69a97ebc1d46c2df8034f54198a2ef7c /src/modules/mc_att_control | |
parent | 2bff39d562f1d7c0ffa5e8875d355eb3271c70fe (diff) | |
download | px4-firmware-76821607130eab7916b70d789a189b2a52a115da.tar.gz px4-firmware-76821607130eab7916b70d789a189b2a52a115da.tar.bz2 px4-firmware-76821607130eab7916b70d789a189b2a52a115da.zip |
mc attitude controller: Log the controller latency
Diffstat (limited to 'src/modules/mc_att_control')
-rw-r--r-- | src/modules/mc_att_control/mc_att_control_main.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp index 82d2ff23a..cfb237711 100644 --- a/src/modules/mc_att_control/mc_att_control_main.cpp +++ b/src/modules/mc_att_control/mc_att_control_main.cpp @@ -141,6 +141,7 @@ private: struct vehicle_status_s _vehicle_status; /**< vehicle status */ perf_counter_t _loop_perf; /**< loop performance counter */ + perf_counter_t _controller_latency_perf; math::Vector<3> _rates_prev; /**< angular rates on previous step */ math::Vector<3> _rates_sp; /**< angular rates setpoint */ @@ -289,7 +290,8 @@ MulticopterAttitudeControl::MulticopterAttitudeControl() : _actuators_0_circuit_breaker_enabled(false), /* performance counters */ - _loop_perf(perf_alloc(PC_ELAPSED, "mc_att_control")) + _loop_perf(perf_alloc(PC_ELAPSED, "mc_att_control")), + _controller_latency_perf(perf_alloc_once(PC_ELAPSED, "ctrl_latency")) { memset(&_v_att, 0, sizeof(_v_att)); @@ -890,6 +892,7 @@ MulticopterAttitudeControl::task_main() if (!_actuators_0_circuit_breaker_enabled) { if (_actuators_0_pub > 0) { orb_publish(_actuators_id, _actuators_0_pub, &_actuators); + perf_end(_controller_latency_perf); } else if (_actuators_id) { _actuators_0_pub = orb_advertise(_actuators_id, &_actuators); |