ROS Based Programming and Visualization of Quadrotor Helicopters
Contents
Purpose of Thesis
Robot Operating System ( ROS )
What is Robot Operating System ( ROS ) ?
ROS structure
HOW does ROS work ?
Navigation of Robot with ROS
URDF : Unified Robot Description Format
ROS with 3D Modelling and Simulation
Quadrotor Simulation on Rviz and Gazebo with ROS
Conclusion and Recommendation
ROS publish / subscribe method
unmanned air vehicle
Robot Operating System
ATILAY MAYADAG
2024: Domino Containers - The Next Step. News from the Domino Container commu...
ROS Based Programming and Visualization of Quadrotor Helicopters
1.
2. ISTANBUL TECHNICAL UNIVERSITY
Faculty of Aeronautics and Astronautics
Department of Astronautical Engineering
Bachelor Thesis Presentation of
Atilay Mayadag
110090139
AUGUST 2015
3. ROS BASED PROGRAMMING AND
VISUALIZATION OF QUADROTOR
HELICOPTERS
Thesis Advisor: Öğr. Gör. Dr. İsmail BAYEZIT
Student : Atilay Mayadag
Student ID: 110090139
AUGUST 2015
4. ABBREVIATIONSs
API : Application programming interface
catkin_ws : Catkin Work Space
Cpp : C plus plus language
FPS : First-person camera
ISO : International Organization for Standardization
ITU : Istanbul Technical University
Msg : Message
Py : Python
ROS : Robot Operating System
Rviz : Robot Operating System Visualization
srv : Service
TF : Transform Frame
URDF : Unified Robot Description Format
UTM-30LX : Hokuyo UTM-30LX Scanning Laser Rangefinder
V-REP : Virtual Robot Experimentation Platform
XACRO : Extensible Markup Macro Language
XML : Extensible Markup Language
XML-RPC : Extensible Markup Language Remote Procedure Call
ATILAY MAYADAG , 2015
5. Contents
Purpose of Thesis
Robot Operating System ( ROS )
What is Robot Operating System ( ROS ) ?
ROS structure
HOW does ROS work ?
Navigation of Robot with ROS
URDF : Unified Robot Description Format
ROS with 3D Modelling and Simulation
Quadrotor Simulation on Rviz and Gazebo with ROS
Conclusion and Recommendation
Resources
References
ATILAY MAYADAG , 2015
6. Purpose of Thesiss
To understand that
What is Robot Operating System ?
What does ROS do ?
How does it work ?
Which methods does ROS use ?
Why is ROS robust ?
What makes ROS such special and common ?
How has changed the robotics world after ROS ?
Which softwares are useful with ROS ?
How do softwares work with ROS ?
How is used ROS in Unmanned Air Vehicle Projects ?
ATILAY MAYADAG , 2015
9. What is Robot Operating System ( ROS ) ?
• ROS is open source software and free for both
commercial and research use.
• ROS is a functional framework to write robotic
software and to operate the robot on a mission.
• ROS has widely collection of libraries, tools and
conformity with other powerful programs like as
Gazebo.
• ROS also has solution-focused community, which is
working on developing ability of ROS.
ATILAY MAYADAG , 2015
10. Original authors:
• Willow Garage Robotics Research Lab and Technology Incubator
• Stanford Artificial Intelligence Laboratory
Initial release:
• 2007 ; 8 years ago
Written in:
• C++
• Python
Operating System:
• Linux
License:
• BSD License
Website:
• www.ros.org
ATILAY MAYADAG , 2015
12. ROS structure
ROS consists of stacks, packages, nodes, topics, messages, services, headers, bags, master, manifests
and parameter server.
• Stacks : Stacks are the sum of the packages that serves the same goal.
• Packages : Packages are the basic meaningful structures of the ROS.
• Nodes : Nodes are executable processes where computation is done. Nodes can communicate
with other nodes, and other processes using topics. The important thing in this communication,
nodes have to comply with publish / subscribe protocol.
• Topics : Topics are the important basic structures of the ROS, using in transmission of the data
from the node to another node. Each topics can include many type of messages and can have
various subscribers. Each node publishes its specific topic and just particular nodes can
subscribe this topic.
• Messages : Messages are basic components of topic. They convey the information between
nodes.
• Services : The services give special interaction with the nodes.
• Headers : By headers, messages can be numbered, thus the developers can understand which
node is sending message.
• Bags : Developer can save and play back the project data with bags. Bags are significant tool
for storing data, for example joystick data or sensor data.
ATILAY MAYADAG , 2015
13. ROS structure
• Master : Master has the responsibility of all the process. The Master pursues the methods of
publishing and subscribing topics, publisher and subscriber nodes, messages and services. The
Master runs with the roscore command. If the master is not active , ROS does not work!
• Manifest: Manifest gives information related with the package. Manifests are generated with
the manifest.xml file. Every packages must include manifest rules and their own manifest.xml
document. Manifest includes two basic tags in its inside, which are <depend> and <export>.
<depend> tag shows that the package depends which kind of packages. And <export> tag shows
which packages get data from the package.
• Parameter server : Parameter Server provides to configure nodes, while they are running or
gives to developer permission to change the working methods of the node. It serves with the
command of rosparam
Master start command : roscore
ATILAY MAYADAG , 2015
19. HOW does ROS work ?
Tell the master that we are going to be publishing a message of type std_msgs/String
on the topic chatter. This lets the master tell any nodes listening on chatter that we
are going to publish data on that topic. The second argument is the size of our
publishing queue. In this case if we are publishing too quickly it will buffer up a
maximum of 1000 messages before beginning to throw away old ones.
NodeHandle::advertise() returns a ros::Publisher object, which serves two
purposes: firstly, it contains a publish() method that lets you publish messages onto
the topic it was created with, and secondly, when it goes out of scope, it will
automatically unadvertise.
[3]Resource :http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29
ATILAY MAYADAG , 2015
20. HOW does ROS work ?
Subscribe to the chatter topic with the master. ROS will call the chatterCallback()
function whenever a new message arrives.
The callback function gets called when a new message has arrived on the chatter topic.
NodeHandle::subscribe() returns a ros::Subscriber object, that you must hold on to
until you want to unsubscribe.
[3]Resource :http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29ATILAY MAYADAG , 2015
21. Navigation of Robot with ROS
There is one of most powerful tools of ROS, navigation stack. It simply provides to
robot autonomous maneuvers. In basic explanation, navigation stack takes reports
from odometry and sensor streams, makes calculations and publishes to new
outputs to robot. It controls the velocity of robot and draws a new trajectory to
avoid obstacles.
Navigation stack operating plan.
[4]Resource :http://wiki.ros.org/navigation/Tutorials/RobotSetupATILAY MAYADAG , 2015
22. Navigation of Robot with ROS
Transform frames are the relative frames to robot base frames. All necessary parts,
all moving or rotating parts of robot, must to have transform frames for success of
navigation stack.
[5]Resource :http://www.pirobot.org/blog/0018/
Transform Frame
[6]Resource :http://library.isr.ist.utl.pt/docs/roswiki/tf.html/
[7]Resource :http://library.isr.ist.utl.pt/docs/roswiki/tf2.html
[8]Resource :http://www.romin.upm.es/wiki/index.php?title=File%3ATf_grips.png
[5]
[7][6]
[8]
ATILAY MAYADAG , 2015
23. Navigation of Robot with ROS
Robot perceives the world by their sensor. A sensor continously publishes information
messages in form of these classes, which are ‘sensor_msgs/LaserScan’ and
‘sensor_msgs/PointCloud’ over ROS. Moreover, navigation stack listens these
message types and gets the value from these messages then makes calculations and
set a new value to send to robot for moving.
The continously published data is essential for navigation stack. Otherwise,
navigation stack drives robot blindly.
[9]Resource :http://www.pirobot.org/blog/contests/TR2010/
Sensor Streams
[10]Resource :http://sysmagazine.com/posts/204250/
[9]
[10]
Odometry Source
Navigation stack operates transform frame library to calculate the robot’s
position in the world and peruses the published datas from sensors to
estimate the location of robot in static map. Nonetheless, these do not
publish any value of velocity of robot. Therefore, there requires any
odometry source to publish both velocity information and values of
transform. Hence, there is the particular message type
‘nav_msgs/Odometry’ publishes a value over the ROS.
ATILAY MAYADAG , 2015
24. Navigation of Robot with ROS
Base Controller nodes subscribe the ‘cmd_vel’ topic and gets the values which are
carried by the variables ; ‘cmd_vel.linear.x, cmd_vel.linear.y, cmd_vel.angular.z’.
These values are axial velocities and Base Controller nodes convert them into
motor commands.
Base Controller
Costmap
The navigation stack operates two costmaps to comprehend obstacles in
the world.
1. Global Costmap provides long-term trajectory planning.
2. Local Costmap provides avoiding nearby obstacles.
Base Local Planner
Responsible for computing velocity commands and publishing the values to base of the robot.
Global Planner
Takes the calculated long-term trajectory values from global costmap and computes the values.
Then sends the output values to local panner.
ATILAY MAYADAG , 2015
25. Navigation of Robot with ROS
The Amcl is used to make high performance of localization.
It takes in transform messages, laser scans, laser-based map and emits prediction of
poses. It subscribes scan, tf, initialpose, map topics. And publishes amcl_pose,
particlecloud, tf topics. It has also global_localization service. It includes many
parameters which are related with laser range, laser beam, distance and model types
of odometry.
AMCL
ATILAY MAYADAG , 2015
26. URDF : Unified Robot Description Format
[11]Resource : http://wiki.ros.org/urdf
When the developer has written the
behavior of robot. There is necessary to
analyze it. However it is dangerous that
to test with hardwares in the beginning
as known. Thus developers prefer
simulation programs. There is the XML
format which provides that ROS
programmers can design their own
robot with full sensors and actuators and
perform it through simulation programs.
URDF documents takeover this
mission.
[11]
ATILAY MAYADAG , 2015
27. URDF : Unified Robot Description Format
URDF documents have to obey the
hierarchy of XML format and
syntax.
URDF documents have to be saved
in the “/urdf” file of related
package.
URDF documents have codes about
robot’s sensors, links, transmissions,
joints, frictions, collisions and
models
The limits of objects have to be well
calculated.
After written, URDF documents
have to be familiarized to ROS
Master with the terminal commands.
Sensor/proposals
Describes a sensor, such as a camera, ray sensor, etc.
Link
Describes the kinematic and dynamic properties of a link.
Transmission
Transmissions link actuators to joints and represents their mechanical
coupling
Joint
Describes the kinematic and dynamic properties of a joint.
Gazebo
Describes simulation properties, such as damping, friction, etc
Model_state
Describes the state of a model at a certain time
Model
Describes the kinematic and dynamic properties of a robot structure.
Related code macros in URDF
ATILAY MAYADAG , 2015
28. URDF : Unified Robot Description Format
(Basic URDF code explanation)
Next pages present the codes related
with the robot on the picture. There will
be pointed some important main tags .
And there will be also clarified the
hierarchy of urdf document. It is
recommended that to pay attention to
parent /child tags which are high
significant codes to assemble the parts of
robot.
[12]Resource : http://www.romin.upm.es/wiki/index.php?title=ROS%3ATutorials/Build_Your_Own_URDF_Robot
[12]
ATILAY MAYADAG , 2015
33. ROS with 3D Modelling and Simulation
RVIZ
Quadrotor model on Rviz
ATILAY MAYADAG , 2015
34. ROS with 3D Modelling and Simulation
RVIZ
Rviz Add pop-up menu
Rviz Add pop-up menu description box
ATILAY MAYADAG , 2015
35. ROS with 3D Modelling and Simulation
RVIZ
ATILAY MAYADAG , 2015
Rviz LaserScan Status and details
36. ROS with 3D Modelling and Simulation
RVIZ
ATILAY MAYADAG , 2015
Rviz, quadrotor pose estimation
37. ROS with 3D Modelling and Simulation
GAZEBO
Gazebo Simulation program with outdoor map
ATILAY MAYADAG , 2015
38. ROS with 3D Modelling and Simulation
GAZEBO
Gazebo Simulation program with quadrotor and outdoor map
ATILAY MAYADAG , 2015
39. ROS with 3D Modelling and Simulation
GAZEBO
Gzserver, gzclient and gazebo terminal commands for Gazebo Simulation program
ATILAY MAYADAG , 2015
40. ROS with 3D Modelling and Simulation
GAZEBO
Gzserver, gzclient and gazebo terminal commands for Gazebo Simulation program
ATILAY MAYADAG , 2015
41. Quadrotor Simulation on Rviz and Gazebo with ROS
Hector Quadrotor Package
The Hector Quadrotor Package is developed in
Technische Universit¨at Darmstadt in Germany.
This Package is developed by considering physical
behavior of quadrotor and real world calcuation of
sensors.
The Hector Quadrotor Package consists of four
main stacks which are relevant to modeling,
control and simulation of quadrotor system.
1. The “hector_quadrotor_description” stack
2. The “hector_quadrotor_gazebo” stack
3. The “hector_quadrotor_teleop” stack
4. The hector_quadrotor_gazebo_plugin stack
Quadrotor Simulation
ATILAY MAYADAG , 2015
42. Quadrotor Simulation on Rviz and Gazebo with ROS
1. The “hector_quadrotor_description” stack
The hector_quadrotor_description stack includes quadrotor
model description which are written based on URDF format
using xacro macros. The stack incapsulates three documents.
The “quadrotor_base.urdf.xacro” stack : The
quadrotor_base.urdf.xacro is the basic model, contains
meshes and inertias to form various quadrotor bases.
The “quadrotor.urdf.xacro” stack : The
quadrotor.urdf.xacro just declares quadrotor robot description
parameter, ensures simply quadrotor base however does not
include any sensor definition.
The “quadrotor_hokuyo_utm30lx.urdf.xacro” stack: The
quadrotor_hokuyo_utm30lx.urdf.xacro supplies a model
which is already equipped by sensors, ready to use. It also
includes a Hokuyo UTM-30LX LIDAR and forward facing
camera.
[14]Resource :http://carnegierobotics.com/multisense-sl/
[15]Resource :https://www.hokuyo-aut.jp/02sensor/07scanner/download/products/utm-30lx-ew/
[16]Resource :http://www.gkmm.tu-darmstadt.de/publications/files/meyer2012quadrotorsimulation.pdf
[14] MultiSense SL[15] UTM-30LX-EW
[16] Quadrotor and UTM-30LX Lidar on Simulation
ATILAY MAYADAG , 2015
43. Quadrotor Simulation on Rviz and Gazebo with ROS
2. The “hector_quadrotor_gazebo” stack
The hector_quadrotor_gazebo stack is
used to simulate the quadrotor model
in Gazebo Simulation Program. The
Stack incloses significant launch files
and dependency datas to serve
simulation process. The codes which
are included into this stack, process
that URDF files and collada quadrotor
meshes move in defined world in
Gazebo via the controller codes,
calculate via the sensor codes, publish
location and environmental
information into the ROS terminal.
Quadrotor model on Gazebo and Rviz
ATILAY MAYADAG , 2015
44. Quadrotor Simulation on Rviz and Gazebo with ROS
3. The “hector_quadrotor_teleop” stack
The “hector_quadrotor_teleop” stack is responsible stack
to control the model in simulation via gamepad. There are
already available controller APIs for both Logitech and
Xbox Gamepads.
3. The “hector_quadrotor_gazebo_plugin” stack
The hector_quadrotor_gazebo_plugin stack contains particular plugins
to make simulation more real. For instance, barometer plugin to
measure altitude, simple controller plugin specifies quadrotor flight
control and quadrotor propulsion plugin simulates motor voltages and
propeller revolution.
ATILAY MAYADAG , 2015
45. Quadrotor Simulation on Rviz and Gazebo with ROS
Downloading, building and compiling of hector-quadrotor model
To use the Hector-quadrotor model , first of all developer
has to download related operation packages through
his/her ros folder from github protocol.Then developer has
to create a folder in catkin workspace of his/her system.
After then move there and download source codes through
the folder via terminal program. When source code
downloaded, developer has to compile it with the catkin
workspace command ‘catkin_ws’. Then developer has to
initilize the folder with the command ‘source
devel/setup.bash’ in terminal.
Downloading, building and compiling of hector-quadrotor model.
ATILAY MAYADAG , 2015
46. Quadrotor Simulation on Rviz and Gazebo with ROS
List of necessary packages for smoothly working of
quadrotor model simulation
The selection menu upon outdoor and indoor flight mission of hector-quadrotor model on
Rviz.
ATILAY MAYADAG , 2015
47. Conclusion and Recommendation
ROS is open source software.
ROS has common core and it can be extended via
packages.
ROS already has various pre-defined packages and skills.
Developer can make changes inside of these packages to
increase its ability.
There is the community which is grown out of the
developers using ROS software. Developers can easily
consult to this community about problems.
Advantages
Χ It is not enough user-friendly.
Χ It is not enough handly for last user on the industrial
market.
Χ If any line of codes are changed, then whole package has
to be compiled again.
Χ When any mistake is done through the codes in package.
To find the mistake out , can persist hours.
Χ Nowadays, ROS runs just in the Linux.
Χ Disadvantages
ATILAY MAYADAG , 2015