A MATLAB script to plot graph from ROSbag easily.
From a command line:
git clone https://github.com/MukilSaravanan/rosbag_plotter_matlab.git
- Go the directory where you have cloned the repository
cd <absolute_path_to_the_respository>
-
To open the Set Path dialog box, on the Home tab, in the Environment section, click Set Path
-
Click on Add Folder and select the directory you have cloned the repository
If the above are performed correctly, you see the path as shown the below image. Click on Save
- Run the command in the command window
plot_rosbag()
-
In the pop-up window, select the ROS bag that you want to visualize
-
From the rostopics displayed in the command window, select a rostopic that you want to visualize. For eg., For
/odom, enter 2 in the command window. -
Now, you will see all the variables in the selected rostopic. For eg., to plot
twist/twist/linear/xin/odomrostopic, enterTwist.Twist.Linear.Xin the command window -
Enter the name of the quantity and its unit, enclosed with quotes. For eg.,
'velocity,m/s'; This will appear asvelocity (in m/s)in the graph