High speed logging

As you know that pixhawk can log with a speed of 50HZ but it generates with a speed of 1khz how can i modify the speed of logging so that i can access the values at high frequency .
i am using pixhawk 4 mini please help with this issue to increase logging rate more thn 500hz

Hi @Tella_Sai_Shankar ,

There is no limit on all the topics to 50Hz, which message are you looking at?

You can change the logging rate of a couple of pre-defined sets using SDLOG_PROFILE; otherwise you can change it in the firmware code here: PX4-Autopilot/logged_topics.cpp at 2870b5bbb167d0571d22790d4c350600fbffe684 · PX4/PX4-Autopilot · GitHub (where add_topic("topic_name", 100); means that the time between 2 samples is at least 100ms).

See Logging | PX4 User Guide for more details.

Actually i am from a mechanical background , for my project i need to get the values of pwm and gyro at the same rate which the pixhawk is generating either it is 200HZ or 300 HZ actually when i see in QGC mavlink inspector the pwm output is around 50HZ but i need for every 2.5ms one reading that the pixhawk generates the values . So can I do it in QGC or do I want to do it by using ROS? If it is in QGC can you please help me with this issue

  • If you need the data at high speed for post processing, best is to get the log file from the SD card and then open the .ulg file using a log analysis tool (Flight Log Analysis | PX4 User Guide). You can also create a python script to make more advanced manipulations of the data.

  • If you need to process the data online on a separate embedded computer, you can run ROS or MAVSDK on a RPi or other board connected through UART to the flight controller

1 Like

px4-autopilot / src / modules / logger / logged_topics.cpp
i went into this file and created new one
but when it is logging it is creating unwanted files to be logged but i want only pwm values and the gyro readings in this code

what are the lines to be removed to get only pwm and gyro readings

Just ignore the topics that are not of immediate interest for you.
You can use one of those software Flight Log Analysis | PX4 User Guide (e.g.PlotJuggler) and look for the following fields:

  • actuator_outputs (PWM values)
  • vehicle_angular_velocity (bias-corrected gyro data).
1 Like

Thanks for the help it made my work a lot easier.

Hi bresch
As you said previously its working fine i am getting the data at high speed only logging the data of PWM outputs and IMU gyro readings

But it is not storing both data at same timestamp .The gap between the two values of gyro and pwm outputs and the timestamp values of gyro and pwm outputs are also not getting correspondingly for one value it is getting 5ms and for another two values I am getting 11ms . Random values are getting with different timestamp , if this is not possible I dont want time stamp but atleast i want same gap between the values either with 4ms one value or 5ms one value but it should be equal values of PWM and GYRO values