rate_ctrl performance test

This commit is contained in:
Igor Mišić
2024-10-31 16:50:12 +01:00
parent 79ec39e561
commit 76d09c8638
5 changed files with 13 additions and 0 deletions
+1
View File
@@ -166,6 +166,7 @@ set(msg_files
ParameterSetValueRequest.msg
ParameterSetValueResponse.msg
ParameterUpdate.msg
Performance.msg
Ping.msg
PositionControllerLandingStatus.msg
PositionControllerStatus.msg
+2
View File
@@ -0,0 +1,2 @@
uint64 timestamp # time since system start (microseconds)
uint64 delta_time
@@ -308,6 +308,12 @@ ControlAllocator::Run()
perf_begin(_loop_perf);
performance_s performance;
performance.timestamp = hrt_absolute_time();
performance.delta_time = performance.timestamp - _last_perf_timestamp;
_performance_pub.publish(performance);
_last_perf_timestamp = performance.timestamp;
#ifndef ENABLE_LOCKSTEP_SCHEDULER // Backup schedule would interfere with lockstep
// Push backup schedule
ScheduleDelayed(50_ms);
@@ -77,6 +77,7 @@
#include <uORB/topics/vehicle_torque_setpoint.h>
#include <uORB/topics/vehicle_thrust_setpoint.h>
#include <uORB/topics/vehicle_status.h>
#include <uORB/topics/performance.h>
#include <uORB/topics/failure_detector_status.h>
class ControlAllocator : public ModuleBase<ControlAllocator>, public ModuleParams, public px4::ScheduledWorkItem
@@ -184,6 +185,7 @@ private:
uORB::Publication<actuator_motors_s> _actuator_motors_pub{ORB_ID(actuator_motors)};
uORB::Publication<actuator_servos_s> _actuator_servos_pub{ORB_ID(actuator_servos)};
uORB::Publication<actuator_servos_trim_s> _actuator_servos_trim_pub{ORB_ID(actuator_servos_trim)};
uORB::Publication<performance_s> _performance_pub{ORB_ID(performance)};
uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s};
@@ -205,6 +207,7 @@ private:
hrt_abstime _last_run{0};
hrt_abstime _timestamp_sample{0};
hrt_abstime _last_status_pub{0};
hrt_abstime _last_perf_timestamp{0};
ParamHandles _param_handles{};
Params _params{};
+1
View File
@@ -97,6 +97,7 @@ void LoggedTopics::add_default_topics()
add_topic("offboard_control_mode", 100);
add_topic("onboard_computer_status", 10);
add_topic("parameter_update");
add_topic("performance");
add_topic("position_controller_status", 500);
add_topic("position_controller_landing_status", 100);
add_topic("goto_setpoint", 200);