Skip to content

3. Processing Data Logs

dologan edited this page Jul 7, 2023 · 5 revisions

Running the MATLAB data logger

Quad Logger also contains a script to process the bags and generate MATLAB figures and animations, and automatically saves them into our specified file structure. Run

roscd quad_logger/bags
cp quad_log.bag <bag_name>.bag
roscd quad_logger/scripts
matlab

In MATLAB, open the processLog.m script and set the following variables:

  • Set the trialName variable to your <bag_name>, or leave as a blank string (this will open a UI where you can select your bagfile directly).
  • Set the namespace variable to your <robot_ns> (the namespace of the robot set in quad_gazebo.launch).
  • set bAnimate to true or false depending on whether you would like to see the trajectory animated in the body frame (MATLAB is unable to visualize floating base URDFs).
  • set bSave to true or false depending on whether you would like to save all the data and figures to a video. If yet, this will create (or overwrite) a folder named trialName in quad_logger/logs with all your data.

You can also run matlab without the desktop GUI (matlab -nodesktop), and call processLog(<bag_name>) from the command window. This will automatically animate and save the data.

The folder created from bSave = true will be ignored by git.

Replay bag file in RViz

Record data:

roslaunch quad_utils logging.launch

Visualize data:

roslaunch quad_utils quad_visualization.launch
roscd quad_logger/bags
rosbag play quad_log.bag

Use the "Reset" button in RViz to flash and rerun a new bag.