[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

[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?”]

[ROS in 5 mins] 043 – What is tf view_frames?

[ROS in 5 mins] 043 – What is tf view_frames?

In today’s video we’re going to see what is tf view_frame 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 TF ROS 101 unit 4 as an example today.

Step 1. TF

To publish tf topic, you have to execute the following command in this example.

roslaunch pi_robot_pkg pi_robot_control.launch

Then check it with

rostopic echo /tf -n1

It will public all the coordinate frame available in the simulation, but it’s a mass.

We can also use RViz to visualize the TF by launching

rosrun rviz rviz

But it also looks not so nice.

It turns out the tf put the coordinate frames in a tree structure. You can run the following command to plot the tree.

rosrun tf view_frames

If you open the .pdf file it generated, you all see all the frames in tf and their relationship.

Want to learn more?

If you are new to ROS, I highly recommend you to 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++)

 

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

[ROS in 5 mins] 041 – What is rqt_graph

[ROS in 5 mins] 041 – What is rqt_graph

In today’s video we’re going to see what is rqt_graph and how to use it.

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 in 5 Days unit 9  as an example today.

Step 1. rqt_graph

The rqt_graph is a debugging tool in ROS. To show how it works, we’ll create some node first. Please type the following command to create a publisher

rostopic pub /news std_msgs/String "data: 'Welcome to ROSCon 2018'" -r1 __name:=news_pub

This command will create a publisher node named new_pub which publishes the string type message: Welcome to ROSCon 2018 to the topic called /news.

Then we create a subscriber node named news_sub subscribes to the topic news

rostopic echo /news __name:=news_sub

You should see the subscriber prints out the message published by the news_pub node.

If you have some problem and you want to debug, then you can use the following tools:

rosnode list

This command prints out the name of all nodes.

You can see more detailed information with

rosnode info /news_sub

This command will show not only the name of the node but also the topic published of subscribed by this node.

The last one is

rqt_graph

This tool will plot the relationship between each node and the topics that they communicated with. In this example, if you’ve done correctly, you should see the /news_pub and /news_sub nodes and in between is the /news topic on the arrow.

Want to learn more?

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++)

 

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

Pin It on Pinterest