Vous êtes sur la page 1sur 36

ROS For Absolute Beginners

(Robot Operating System)

Lentin Joseph
http://robocademy.com Founder/Instructor of Robocademy
Founder of Qbotics Labs
Day 5
Simulation and Visualization in
ROS

http://robocademy.com
Agenda

• What is a Robot simulation?

• List of popular robot simulators

• ROS Simulator: Gazebo

http://robocademy.com
Agenda

• Getting started with Gazebo simulator

• What is URDF & Xacro robot model?

• Basic Demo of URDF & Xacro in Gazebo

• Rviz: ROS Visualization

http://robocademy.com
Agenda

• Turtlebot Demonstration and inspection

• Controlling of Turtlebot in Gazebo

• Visualizing sensor data of Turtlebot

http://robocademy.com
Robotics Simulation

http://robocademy.com
What is Robotics simulation?
• Process of creating a virtual robot prototype to verify the
accuracy and efficiency of robot design/model

• Simulation is done before the production of actual robot


to perfect the robot design

• We can check the project viable or not

• Simulation involves very less expense compared to the


hardware prototyping

http://robocademy.com
List of popular robot simulators
• Gazebo Simulator: http://gazebosim.org/

• V-REP: http://www.coppeliarobotics.com/

http://robocademy.com
List of popular robot simulators
• Webots: https://www.cyberbotics.com/overview
• Actin: http://www.energid.com/software/actin-robot-
control/
• Open Rave: http://openrave.org/

http://robocademy.com
ROS Simulator: Gazebo

http://robocademy.com
Features of Gazebo
• FREE & Open Source

• Dynamics Simulation: ODE, Bullet,


Simbody physics engines support

• Advanced 3D Graphics: Using OGRE

• Sensors and Noise: Can generate various


types of sensor data
http://robocademy.com
Features of Gazebo
• Plugins support

• Robot Models: Inbuilt models or can


create custom models

• TCP/IP Transport

• ROS Support

http://robocademy.com
Getting started with Gazebo
simulator
• Launching Gazebo simulator

• $ gazebo

OR
• $ gzserver [Running physics engine]
• $ gzclient [GUI]

http://robocademy.com
Getting started with Gazebo
simulator
• Launching Gazebo simulator with ROS
support

• $ roslaunch gazebo_ros
empty_world.launch

http://robocademy.com
GUI Controls in Gazebo

http://robocademy.com
Robot Modelling in ROS

http://robocademy.com
What is URDF and Xacro?
• Unified Robot Description Format (URDF),
which is an XML format for representing a
robot model in ROS

• It is a XML based description

• Xacro simplifies URDF by adding macros

http://robocademy.com
URDF Example: Pan & Tilt
<link name="base_link">
<visual>
…………….
</visual>

<collision>
…………….
</collision>
</link>

<joint name="pan_joint" type="revolute">


…………….
</joint>

http://robocademy.com
Converting Xacro to URDF

Starting roscore
$ roscore

Converting from Xacro to URDF


$ rosrun xacro xacro model.xacro > model.urdf

http://robocademy.com
Adding a URDF model into Gazebo
Launching an empty world
• $ roslaunch gazebo_ros empty_world.launch

Spawning the robot model to Gazebo


• $ rosrun gazebo_ros spawn_model –file
./pan_tilt.urdf –urdf –z 1 –model pan_tilt

http://robocademy.com
Rviz: ROS Visualization
• 3D Visualization tool for ROS

• Launching Rviz
• $ roscore

• $ rosrun rviz rviz

http://robocademy.com
Rviz: ROS Visualization

• Visualizing a robot model in Rviz

• $roslaunch urdf_tutorial display.launch


model:=pan_tilt.urdf

http://robocademy.com
Rviz: ROS Visualization

http://robocademy.com
Rviz: GUI Controls

http://robocademy.com
Turtlebot Simulation

$ roslaunch turtlebot_gazebo
turtlebot_world.launch

http://robocademy.com
Installing Turtlebot simulation
Installing apt GUI package manager
• $ sudo apt-get install synaptic

Install Turtlebot packages


• $ sudo apt-get install ros-kinetic-turtlebot-
gazebo

http://robocademy.com
Turtlebot Visualization in Rviz

• $ roslaunch turtlebot_rviz_launchers
view_model.launch

http://robocademy.com
Turtlebot Visualization in Rviz

http://robocademy.com
Turtlebot Teleoperation

• $ roslaunch turtlebot_teleop
keyboard_teleop.launch

http://robocademy.com
Robot Simulation Demos

http://robocademy.com
Turtlebot 3 Simulation

http://robocademy.com
Turtlebot 3 Simulation
Launching simulation
• $ roslaunch turtlebot3_gazebo
turtlebot3_world.launch

Launching Teleoperation
• $ roslaunch turtlebot3_teleop
turtlebot3_teleop_key.launch

http://robocademy.com
Thormang3 Simulation

http://robocademy.com
Thormang3 Simulation
Launching the simulation
• $ roslaunch thormang3_gazebo
robotis_world.launch

Moving a joint
$ rostopic pub topic_name/command
std_msgs/Float64 joint_value

http://robocademy.com
Exercise - 1

• Install Turtlebot 3 and Thormang3


packages in your system

• Teleoperate Turtlebot 3

• Move Joints of Thormang3 using rostopic


command tool

http://robocademy.com
Conclusion
• Discussed Robotics Simulation

• Discussed basics of Gazebo and


demonstrated basic robot model

• ROS Visualization: Rviz

• Turtlebot simulation and visualization

http://robocademy.com

Vous aimerez peut-être aussi