simulating a mobile robot platform and operating environment by ROS
- configure the platform on the simulator
- control the drone fly
- read measurements from different sensors mounted on the platform
- add items to the simulation environment
- apply a simple scenario: e.g. trajectory following or obstacle avoidance algorithm
Water Industry Process Automation & Control Monthly - April 2024
Simulating TUM Drone 2.0 by ROS
1. Premaster team
Under the supervision of prof: Sherine Rady
eng: Mohammed Aly
Implemented,documented and edited by : Esraa
Tarek Sadek
2.
Robot Operating System (ROS) is a collection
of software frameworks for robot software
development providing operating system-like
functionality.
ROS provides standard operating system services
such as hardware abstraction, low-level device
control, implementation of commonly used
functionality, message-passing between processes,
and package management.
What is ROS?
8.
Software in ROS is organized in packages.
A package might contain ROS nodes, a ROS-
independent library, a dataset, configuration files, a
third-party piece of software, or anything else that
logically constitutes a useful module.
The goal of these packages it to provide this useful
functionality in an easy-to-consume manner so that
software can be easily reused.
Packages
9.
joy_node(joy) and ardrone_joystick(ardrone): They
are the joystick driver and the command information
translator for the Ardrone.
rviz: A 3d visualization environment for the
simulated flying robots.
Common Packages
10.
Nodes: Nodes are processes that perform
computation.
ROS is designed to be modular at a fine-grained
scale; a robot control system usually comprises many
nodes. For example, one node controls a laser range-
finder, one node controls the wheel motors, one node
performs localization, one node performs path
planning, one Node provides a graphical view of the
system, and so on.
A ROS node is written with the use of a ROS client
library, such as roscpp or rospy.
Nodes
12.
Messages: Nodes communicate with each other by
passing messages.
A message is simply a data structure, comprising
typed fields. Standard primitive types (integer,
floating point, boolean, etc.) are supported, as are
arrays of primitive types.
Messages can include arbitrarily nested structures
and arrays (much like C structs).
Messages
14. Topics: Messages are routed via a transport system with
publish / subscribe semantics.
A node sends out a message by publishing it to a given topic.
The topic is a name that is used to identify the content of the
message.
A node that is interested in a certain kind of data will subscribe
to the appropriate topic.
There may be multiple concurrent publishers and subscribers
for a single topic, and a single node may publish and/or
subscribe to multiple topics.
In general, publishers and subscribers are not aware of each
others' existence.
The idea is to decouple the production of information from its
consumption. Logically, one can think of a topic as a strongly
typed message bus. Each bus has a name, and anyone can
connect to the bus to send or receive messages as long as they
are the right type.
Topics
16.
TUM
TUM_SIMULATOR: This package contains the
implementation of a gazebo simulator for the Ardrone 2.0
TUM_ARDRONE: This package contains the
implementations of controlling techinques for drones .
Packages Used
17.
gazebo, ground_truth_to_tf, robot_state_publisher:
The simulator program.
rviz: A 3d visualization environment for the
simulated flying robots.
joy_node, ardrone_joystick: They are the joystick
driver and the command information translator for
the Ardrone.
tum_simulator main nodes
18.
drone_stateestimation: Drone State-estimation,
including PTAM & Visualization.
drone_autopilot: Drone Controller, requires
drone_stateestimation
drone_gui: GUI for controlling the drone (with a
Joystick or KB) and for controlling the autopilot and
the stateestimation node
tum_ardrone main nodes
19.
Real quadrocopter
structure: The
AR.Drone2.0 connects
with a computer via
WIFI, while the user
manipulate a joystick
which is via USB
connecting with the
same computer. ROS is
running in this
computer.
Real Scenario
20.
Simulated
quadrocopter
manipulation: After the
simulation is started.
The user can use a
joystick to manipulate
the simulated
quadrocopter.
The button functions of
the joystick are the
same as manipulating
the real AR.Drone2.0.
22.
It is required to investigate the robot simulator
environment ROS (Robot Operating System) for
simulating a mobile robot platform and operating
environment.
The selected platform is the drone model by TUM
(Technische Universität München), Germany.
Task Description
23.
It is required to learn practical skills on how to:
configure the platform on the simulator
control the drone fly
read measurements from different sensors mounted
on the platform
add items to the simulation environment
apply a simple scenario: e.g. trajectory following or
obstacle avoidance algorithm
Objectives
24.
ROS/Installation
Getting familiar with ROS
TUM Package Installation
TUM_SIMULATOR
TUM_ARDRONE
Control the drone
Add items to the simulation environment
Apply a simple scenario
Task Flow
25. In one terminal do the following :
Make sure that you are on your home directory
Type : source fuerte_workspace/setup.bash
Type : roscd
Type : export
ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:`pwd`/ardr
one_autonomy
Type : export
ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:`pwd`/ardr
one_helpers
Type : export
ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:`pwd`/tum
_simulator
Then You can start the simulator with one of flying
scenarios:here
How To Run The Scenario ?
28.
In another terminal :
Make sure that you are on your home directory
Type : source fuerte_workspace/setup.bash
Type : roscd
Type : export
ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:`pwd`/ardrone_autono
my
Type : export
ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:`pwd`/ardrone_helper
s
Type : export
ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:`pwd`/tum_simulator
Type : export
ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:`pwd`/tum_ardrone
Type : roslaunch tum_ardrone tum_ardrone.launch
Run the tum_ardrone
33.
KB control requires the GUI window to have focus, but NOT
the upper-left text field (press ECS)
q,a: fly up & down.
i,j,k,l: fly horizontally.
u,o: rotate yaw.
F1: toggle emergency
s: takeoff
d: land
Focus the GUI window and press ESC to immediately enable
KB control and set focus such that KB control works properly.
This can be used for safety (autopilot does wired stuff -> press
ESC and immediately take over, disabling the autopilot and
enabling manual control).
Keyboard
34.
Joystick control requires a connected joystick and running
rosrun joy joy_node. We use a PS3 six-axis controller.
left joystick is horizontal position control; right joystick
is height and yaw control.
L1 to take off, release L1 to land.
R1 to toggle emergency state.
By moving any of the two joysticks, the Control Source is
immediately sent to Joystick. This can be used for safety
(autopilot does wired stuff -> immediately take over by
hand, disabling the autopilot and enabling manual
control).
Joystick
35.
Using the text-field on the left side, commands can be sent to
the autopilot node, for example a given trajectory of way-
points.
write commands in top-left text field (or load an example
from one of the files). You can simply add .txt files to
flightplans/.
click Send to transmit commands to the autopilot's command
queue (automatically sets Control Source to Autopilot).
click Clear to clear autopilot command queue and current
target.
click Reset to reset Autopilot, PTAM and EKF.
Autopilot
36.
# The output camera
rosrun image_view image_view image:=/ardrone/image_raw
# The front camera
rosrun image_view image_view image:=/ardrone/front/image_raw
# The buttom camera
rosrun image_view image_view image:=/ardrone/bottom/image_raw
# The height sensor
rostopic echo /sonar_height
#The navigation info
rostopic echo /ardrone/navdata
Add items to the simulation
environment
37.
Nodes :
image_view: Simple image viewer for ROS
sensor_msgs/Image topics.
disparity_view: Simple viewer for
stereo_msgs/DisparityImage topics. Color-maps the
disparity image for visualization.
stereo_view :Viewer for stereo images. Shows the
synchronized left/right image pair and the disparity
image (color-mapped) computed from them.
image_view package