# Can't get a working log file out of gazebo simulations

**URL:** <https://discuss.px4.io/t/cant-get-a-working-log-file-out-of-gazebo-simulations/34069>\
**Category:** PX4 Autopilot\
**Created:** [September 1, 2023, 10:02pm UTC](https://discuss.px4.io/t/cant-get-a-working-log-file-out-of-gazebo-simulations/34069 "2023-09-01T22:02:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Kakavitsas](https://discuss.px4.io/user_avatar/discuss.px4.io/nick_kakavitsas/32/11002_2.png) [@Nick\_Kakavitsas](https://discuss.px4.io/u/Nick_Kakavitsas)\
**Post date:** [September 1, 2023, 10:02pm UTC](https://discuss.px4.io/t/cant-get-a-working-log-file-out-of-gazebo-simulations/34069/1 "2023-09-01T22:02:00Z")

</div>

I’ve tried legacy gazebo installation, gazeob-classic, and the updated gazebo simulation instructions, but for all of them (on both Ubuntu 20.04 and 22.04) the following happens when I try to extract data from a log file:

1. I start the simulation with whatever instructions are listed on the following pages:  
[Gazebo Simulation Main Page](https://dev.px4.io/v1.11_noredirect/en/simulation/gazebo.html#taking-it-to-the-sky)/ [Gazebo Simulation (most recent?) Main Page](https://docs.px4.io/main/en/sim_gazebo_gz/) / [Gazebo Classic Main Page](https://docs.px4.io/main/en/sim_gazebo_classic/)

2. I open qgroundcontrol to make sure that my controller is working, and to make sure I’ve got the parameters set to record the log files. I just recently changed SYS\_HITL to SIH enabled to see if that would make a difference, but this didn’t work.  
 ![image](https://discuss.px4.io/uploads/default/original/2X/3/3485d08258b8604dfe2daefe625b3f491e5b421a.png)

3. Perform a simple flight

4. Download the log file from the “Analyze Tools” tab of qgc. I’ve also tried copying the log file from /PX4-Autopilot/build/px4\_sitl\_default/rootfs/log, but the same things happen

5. Open MATLAB, and use the ulogreader function to read the extracted ulog file. I know this works, as I have previous log files which I can read, but the for the most recent gazebo logs, I get the following output:  
 ![image](https://discuss.px4.io/uploads/default/original/2X/b/b0938f24562c31f5c7ff69ea9ecd3d974012b585.png)

When trying to import the data directly, I get the following:

 ![image](https://discuss.px4.io/uploads/default/original/2X/a/a2539508bac158d6b6c559de7f152ec6dcfba848.png)

But when using the ulog flight review tool, it seems to work:

 ![image](https://discuss.px4.io/uploads/default/original/2X/a/a0c261d68627886ad02c54b9bffbb702da3fc380.jpeg)

Alternatively, with a log file that I know the matlab function works with, from an older version of px4 and gazebo (~Summer 2022, not sure exact version numbers):  
 ![image](https://discuss.px4.io/uploads/default/original/2X/2/26999b2d26ba95ed15a197cacd815393bca9f256.png)

Can someone point me in the right direction regarding what I need to change to get the log files to properly output their data in matlab?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Nick\_Kakavitsas](https://discuss.px4.io/user_avatar/discuss.px4.io/nick_kakavitsas/32/11002_2.png) [@Nick\_Kakavitsas](https://discuss.px4.io/u/Nick_Kakavitsas)\
**Post date:** [September 5, 2023, 2:55pm UTC](https://discuss.px4.io/t/cant-get-a-working-log-file-out-of-gazebo-simulations/34069/2 "2023-09-05T14:55:52Z")

</div>

UPDATE: It seems like this is just a Matlab issue. The default ulogreader function hasn’t been updated to account for whatever changes happened to ulog files between when I last successfully used it in 2022 and now. Moving on to using [pyulog](https://github.com/PX4/pyulog) to read/convert ulogs to csv files for future work. Thanks!
