diff --git a/src/modules/logger/logger.cpp b/src/modules/logger/logger.cpp index cecde367812a72239abf40a726a256808476b647..fb266099026bd1c4abde65e4ca57b0edd3c75a60 100644 --- a/src/modules/logger/logger.cpp +++ b/src/modules/logger/logger.cpp @@ -580,6 +580,24 @@ void Logger::add_common_topics() add_topic("wind_estimate", 200); } +void Logger::add_high_rate_topics() +{ + // maximum rate to analyze fast maneuvers (e.g. for racing) + add_topic("actuator_controls_0"); + add_topic("actuator_outputs"); + add_topic("manual_control_setpoint"); + add_topic("vehicle_attitude"); + add_topic("vehicle_attitude_setpoint"); + add_topic("vehicle_rates_setpoint"); +} + +void Logger::add_debug_topics() +{ + add_topic("debug_key_value"); + add_topic("debug_value"); + add_topic("debug_vect"); +} + void Logger::add_estimator_replay_topics() { // for estimator replay (need to be at full rate) @@ -601,7 +619,6 @@ void Logger::add_estimator_replay_topics() void Logger::add_thermal_calibration_topics() { - // Note: try to avoid setting the interval where possible, as it increases RAM usage add_topic("sensor_accel", 100); add_topic("sensor_baro", 100); add_topic("sensor_gyro", 100); @@ -741,6 +758,15 @@ void Logger::run() add_common_topics(); add_system_identification_topics(); + } else if (sdlog_profile == SDLogProfile::HIGH_RATE) { + add_common_topics(); + add_estimator_replay_topics(); + add_high_rate_topics(); + + } else if (sdlog_profile == SDLogProfile::DEBUG_TOPICS) { + add_common_topics(); + add_debug_topics(); + } else { add_common_topics(); add_estimator_replay_topics(); diff --git a/src/modules/logger/logger.h b/src/modules/logger/logger.h index e1d7b0e70afd168472f451f880518b510976072e..b87ad542e368f2cf1fffbf3ff934d3f48f750434 100644 --- a/src/modules/logger/logger.h +++ b/src/modules/logger/logger.h @@ -65,6 +65,8 @@ enum class SDLogProfile : int32_t { DEFAULT = 0, THERMAL_CALIBRATION, SYSTEM_IDENTIFICATION, + HIGH_RATE, + DEBUG_TOPICS, N_PROFILES }; @@ -270,6 +272,8 @@ private: void add_estimator_replay_topics(); void add_thermal_calibration_topics(); void add_system_identification_topics(); + void add_high_rate_topics(); + void add_debug_topics(); void ack_vehicle_command(orb_advert_t &vehicle_command_ack_pub, vehicle_command_s *cmd, uint32_t result); diff --git a/src/modules/logger/params.c b/src/modules/logger/params.c index 58a5cdefb0d3c1fd47d4f19b42763ffe9da57165..6f5e274c0967bb4aa329206491a2f4c87ced5d2c 100644 --- a/src/modules/logger/params.c +++ b/src/modules/logger/params.c @@ -78,9 +78,11 @@ PARAM_DEFINE_INT32(SDLOG_MODE, 0); * @value 0 default * @value 1 thermal calibration * @value 2 system identification + * @value 3 high rate + * @value 4 debug topics * * @min 0 - * @max 2 + * @max 4 * @reboot_required true * @group SD Logging */