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:
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.
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
It’s a Ros Package
It lets the user keep tracking of multiple coordinate frames over time.
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:
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:
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
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: