[ROS in 5 mins] 049 – How to learn ROS basics using the turtlesim package

[ROS in 5 mins] 049 – How to learn ROS basics using the turtlesim package

In this video, we’ll see how to use the turtlesim package (wiki.ros.org/turtlesim) for learning the basics of ROS. Get set to have some fun as you try out things for yourself!

Commands used:
* rostopic list
* rostopic pub
* rosmsg list
* rosmsg show
* rosservice list
* rosservice call

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:

Let’s go!


Links mentioned in the video and other useful links:

Robot Ignite Academy, the place to learn to program robots using only a web browser (the environment used in the video for demonstration)

ROS Development Studio (ROSDS), another powerful online tool for pushing your ROS learning in a practical way

Feedback

Did you like this video? Whatever the case, please leave a comment in 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.

Thank you!

[ROS in 5 mins] 047 – What is rqt plot

[ROS in 5 mins] 047 – What is rqt plot

In this video we’re going to see what is rqt_plot and how it works.

Before we start, if you are new to ROS, I highly recommend you to take any of the following courses on Robot Ignite Academy

ROS Basics In 5 Days (Python)
ROS Basics In 5 Days (C++)

The commands used during the video to create the package were the following:

cd ~/catkin_ws/src/
catkin_create_pkg tutorial rospy
cd tutorial/src/
touch learning.py
chmod +x learning.py
source ~/catkin_ws/devel/setup.bash

The content of learning.py is:

#! /usr/bin/env python
import rospy
from std_msgs.msg import Float32
from random import random

rospy.init_node(‘learning’)
pub = rospy.Publisher(‘reward’, Float32, queue_size=1)
rate = rospy.Rate(1)

while not rospy.is_shutdown():
pub.publish( random() * 50 )
rate.sleep()

And to see rqt_plot, the command was:

rqt_plot /reward

We love feedback, so, whether you like the video or not, please share your thoughts on the comments section below.

Thanks for watching.

[ROS in 5 mins] 046 – What is ROS Namespace

[ROS in 5 mins] 046 – What is ROS Namespace

Hello Everyone

In today’s video we’re going to see what is ROS Namespace and how it works.

Step 0. Create a project in Robot Ignite Academy(RIA)

We have the best online ROS course available in RIA. It helps you learn ROS in the easiest way without setting up 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 unit0 as an example today.

Step 1. Create a package for the code

At first, let’s create a ROS package with dependencies for our code and a source file called robot.py under the src folder in the pakcage with the following command

cd ~/catkin_ws/src
catkin_create_pkg tutorial rospy geometry_msgs
cd tutorial/src
touch robot.py

In robot.py, please create the following content

#! /usr/bin/env python
import rospy 
from geometry_msgs.msg import Pose

rospy.init_node('robot', anonymous=True)
pub = rospy.Publisher('my_position', Pose, queue_size=1)
rate = rospy.Rate(1) # 1hz

while not rospy.is_shutdown():
pub.publish(Pose())
rate.sleep()

You can then give the permission and run the code with the following commands.

chmod +x robot.py
source ~/catkin_ws/devel/setup.bash
rosrun tutorial robot.py

It will publish the robot pose in my_position topic which you can check with

rostopic list | grep my_pos

Let’s imagine you have two different robot and you want to reuse the code. How can you distinguish between this two topics?

The answer is that you can use the namespace. To specify the different namespace, you can run the following command

rosrun tutorial robot.py __ns:=robot1
rosrun tutorial robot.py __ns:=robot2

Now if you see into the topic list, you should see two different topics called

/robot1/my_position

and

/robot2/my_position

Want to learn more?

If you are interested in this kind of tutorial, I highly recommend you to take any of the following courses on Robot Ignite Academy:

ROS Basics In 5 Days (Python)
ROS Basics In 5 Days (C++)

We love feedback, so, whether you like the video or not, please share your thoughts on the comments section below.

Thanks for watching.

 

 

Edited by: Tony Huang

What is rosbag? How to record and playback ROS topics

What is rosbag? How to record and playback ROS topics

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...

  1. record
  2. play
  3. 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:

Further resources

ROS Development Studio (ROSDS), another powerful online tool for pushing your ROS learning in a practical way

We love feedback!

Did you like this video? Whatever the case, please leave a comment in 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 in the comments area and we will do a post or video about it.

Thank you!

[ROS in 5 mins] 044 – What is ROS tf?

[ROS in 5 mins] 044 – What is ROS tf?

In this video, we’ll see what the ROS tf package is, and what it does, and how to use one of its tools (rqt_tf_tree), in just about 5 minutes!

Let’s go!

Step 0. Create a project in Robot Ignite Academy(RIA)

We have the best online ROS course available in RIA. It helps you learn ROS in the easiest way without setting up 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 TF ROS 101 as an example today.

Step 1. What is TF?

The TF

  1. It’s a Ros Package
  2. It lets the user keep tracking of multiple coordinate frames over time.
  3. It allows making computations in one frame and then transforming to another.

You can see the available TF in ROS by typing the following command

rosrun rqt_tf_tree rqt_tf_tree

You can see that there are 3 coordinate frames in this simulation world, turtle 1 and turtle 2. The rqt_tf_tree will only show the relationship for a particular timestep.

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:

TF ROS 101

ROS Basics In 5 Days (Python) 

ROS Basics In 5 Days (C++)

 

Edited by: Tony Huang


Links mentioned in the video and other useful links:

 

We love feedback, so, whether you like the video or not, please share your thoughts on the comments section below.

Thanks for watching.

[irp posts=”11242″ name=”[ROS in 5 mins] 043 – What is tf view_frames?”]

Pin It on Pinterest