Hello ROS Developers! In this video post, we’ll see what rosbag is, what it does, and how to use it to record and playback ROS topics.
Key commands that you will learn: rosbag...
record
play
info
Let’s go!
Step 1: Create a project in Robot Ignite Academy (RIA)
We have the best online ROS courses available in RIA. It helps you learn ROS in the easiest way without setting up a ROS environment locally. The only thing you need is a browser! Create an account here and start to browse the trial course for free now! We’ll use the ROS Basics in 5 Days course as an example today.
Step 2: Record Bag file with rosbag
The ROS Bag is a powerful tool for you to record and playback your simulation. To start the recording all topic available, simply type the following command in the terminal.
rosbag record -a
As an example, we’ll move the turtlebot in the simulation with
roslaunch turtlebot_teleop keyboard_teleop.launch
You can now move around to generate the data. To finish recording, simply press CTRL+C to terminate the rosbag.
Step 3: Play the rosbag bag file
In the video, the recorded bag file is saved as 2018-10-06-05-04-57.bag (be sure to use your own name 🙂 ). To playback, type the following command in a terminal
rosbag play 2018-10-06-05-04-57.bag
You should see the robot moving around as how you did.
If you want to see more information about the .bag file. The following command will print all the topic available in the .bag file.
rosbag info 2018-10-06-05-04-57.bag
Video
See it happening live in this video, in case you are stuck or just want to sit back and watch a “movie” instead!
Want to learn more?
If you are a ROS beginner and want to learn ROS basics fast, we recommend you take any of the following courses on Robot Ignite Academy:
We Love Feedback
Did you like this video? Do you have questions about what is explained? Whatever the case, please leave a comment on the comments section below, so we can interact and learn from each other.
If you want to learn about other ROS topics, please let us know on the comments area and we will do a video about it.
HKPC is the Hong Kong Productivity Council, a multi-disciplinary organization which is tasked with promoting and assisting the Hong Kong business sector through the introduction of more efficient and updated business and technological methods.
More than a company we are an organization. We provide technical support to Hong Kong companies that want to improve their technology methods.
Why are you learning ROS?
We decide to create a new line of research on autonomous cars, and we believe that self-driving cars are going to be ruled by ROS. Since our team did not have knowledge on ROS, we had to start by learning it, so later we can apply it to the cars.
(photo credit: HKPC)
Which ROS methods have you tried?
We used the official ROS wiki page provided by ros.org and some videos scattered around.
What were you struggling with those learning methods?
The main problem is that the wiki tutorials do not provide a step by step sequence that allows you to understand a subject. It is kind of scattered parts that you later have to put together. And that is difficult as a beginner.
Why did you choose to learn with Robot Ignite Academy?
Mainly for two reasons: one is the interactivity. Since the academy provides simulations of the robots, we can see the result of our programs in real time. Another one is that the tutorials are very well done, step-by-step. The tutorials shows how to do every step until you get the program running on the simulated robot.
I would also say that we liked very much the amount of tutorials that you have showing how to apply ROS to some application (like drones or autonomous cars).
What are you missing at Robot Ignite Academy?
Nothing yet. We started to learn some weeks ago and so far, it has been a nice experience. Actually is not only me who is learning with your academy. We have three other people that started learning ROS in your academy before myself. And next week, another colleague is going to start learning.
Which ROS subjects are you interested in?
At present we are concentrated on learning the ROS basics. Later we may be more interested in learning how to apply ROS to autonomous cars.
Which computer type (O.S.) are you using to learn ROS?
We use Linux machines for programming, but for the learning, we are using Windows computers. It is nice to run ROS on Windows!
Have you applied what you learned to real robots? Which ones?
Not yet. As I mentioned, we are still in the process to build the pieces that we need for the creation of autonomous cars. We already have some cars that we will use in the close future for experimentation, and we will use our ROS skills with them.
(photo credit: HKPC)
Thank you for your time!
And for all of you reading this case study, consider the amount of time you will save if you use the Robot Ignite Academy to train your engineers on ROS based robotics. We have courses for learning the basics of ROS, but we also have more advanced courses that teach how to apply it to self-driving cars, drones, deep learning with robots, Reinforcement Learning applied to ROS robots, industrial robots and many more. Just check our current list of courses in this page and give it a free try.
Other companies that use our academy to train their teams
—
Feedback
—
Did you like this video? Do you have questions about what is explained? Whatever the case, please leave a comment on the comments section below, so we can interact and learn from each other.
If you want to learn about other ROS topics, please let us know on the comments area and we will do a video about it.
Did you like this video? Do you have questions about what is explained? Whatever the case, please leave a comment on the comments section below, so we can interact and learn from each other.
If you want to learn about other ROS topics, please let us know on the comments area and we will do a video about it.