Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
By
Leong Yik Mun
10 June 2015
Integration of a Radiation Sensor with a Mobile Robot under ROS
Author:
Supervisor:
Hochschule Aschaffenburg
Fakultät Ingenieurwissenschaften
Würzburger Straße 45
D-63743 Aschaffenburg
Declaration of Authorship
I solemnly certify that this thesis has been written by me only without any help
other than stated. Any use of external sources are acknowledged and credited in
this thesis.
…………………………………… ……………………………………
Date Signature
Contents
1 Introduction ........................................................................................................ 1
2 Requirements Specifications.............................................................................. 2
2.1 System Interface .......................................................................................... 2
2.2 Hardware Interface ..................................................................................... 3
3 Software Design ................................................................................................. 5
4 Implementation .................................................................................................. 8
5 Verification ....................................................................................................... 11
6 Conclusion ........................................................................................................ 12
7 References ......................................................................................................... 13
1 Introduction
The EtaBot is a mobile robot which has been developed in a project by the
research team, ETARA. It has been designed to conduct search and rescue
operations autonomously. One of the abilities planned for the EtaBot is that it
should be capable of detecting radiation sources. Therefore, a radiation sensor
has to be integrated with the mobile robot. The radiation sensor has to
constantly provide the measure of radiation in a certain location to the robot for
it to move accordingly in order to find the radioactive source.
However, dealing with radiation sources can be potentially hazardous.
Hence, the EtaBot will first be installed with a light sensor and deal with light
sources. It is assumed that the search algorithm used to seek light sources can
later be applied to that of the radiation sources.
Figure 1: EtaBot
2 Requirements Specifications
2.1 System Interface
There are two devices to be implemented with the EtaBot. The first one is the
gamma scout which is illustrated on Figure 3.
The gamma scout is a radiation detector and can be used to determine radiation
sources in an area. The device has a USB port which can be connected directly to
the computer. The communication between the gamma scout and the computer
behaves like a serial connection.
Data sent and received by the gamma scout has to be in the form of 7-E-1 which
means, 7 bits, even parity bit, 1 stop bit. Therefore, every character sent or
received by the gamma scout has 8 bits, whereby the most significant bit (MSB)
is the parity bit. The parity bit is 0 when the number of 1 bit from the 0th bit till
the 6th bit is even.
The gamma scout has to receive the character “O” before it starts sending its
read value. Since the value is only valid until the 6th bit, the MSB or the parity
bit has to be inserted manually. The values of “O” in different number bases are
shown in the table below.
Once the gamma scout receives the “O”, it begins sending the values read. The
data sent contains the time interval and the radiation count. The node should
extract only the radiation count and publish this value to the topic.
The light follower is designed to imitate the gamma scout. Therefore the
connection between the light follower and computer is the same as the gamma
scout. It connects to the computer via USB and communicates like a serial port.
Instead of detecting radiation, the light follower has a photodiode which is
connected to an analogue digital converter. The measure of light is read and sent
through the USB connection.
The light follower sends and receives data in the form of 8-N-1 which resembles,
8 bit, no parity bit, 1 stop bit. It must also receive the character “O” before it
starts sending the read value. The value that has to be sent to the light follower
is displayed in different number bases below.
3 Software Design
The software design of the publisher node is explained using flow charts.
The reading process is an endless loop. For the light follower, the read process
starts by reading a line from the buffer.
The line read is handled as a string and the data sent by the light follower has a
null terminator at the start. Therefore, the string pointer is shifted once to the
right to ignore the first null terminator.
After that, the string can be converted to unsigned long int and the value is
published onto the topic.
The endless loop can be interrupted by unplugging the device which would raise
an exception or by pressing ctrl-c on the terminal which the node is running on.
4 Implementation
In this section, the implementation of the ROS nodes on the EtaBot are
explained step-by-step. The computer used to implement these nodes must be
running under Ubuntu with ROS Indigo installed.
There should already be a catkin workspace under home. If not, the workspace
can be made and initialized by typing the following commands on the terminal.
$ source /opt/ros/indigo/setup.bash
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace
Next, the source files that has been done in this assignment are copied to the
workspace. The exact path where the files are copied to is:
~/catkin_ws/src
There are two folders which are copied and they are shown in the image below.
After that, the gamma-scout/light follower is plugged in to the USB port on the
EtaBot. For the node to work, the USB device path is determined. This is done
by using the command:
$ dmesg
$ gedit ~/catkin_ws/src/gammascout/src/publisher.cpp
On line 35, the “ttyUSB0” is changed to the one obtained from the previous step.
Reading from the serial port requires permission. Therefore, a check is carried
out to see if the user has permission by keying in the line:
$ groups ${USER}
If it is not stated there, the user is added to the group by running the following
command and the computer is restarted.
The ROS node is finally compiled and installed using these commands one line at
a time:
$ source /opt/ros/indigo/setup.bash
$ cd ~/catkin_ws
$ catkin_make
$ cd devel
$ source setup.bash
$ cd ~/catkin_ws
$ catkin_make install
The nodes are then ready to be started after the installation. Before they are
executed, the ROS Core has to be started with the command below.
$ roscore
Using another tab on the terminal, the publisher node is started by keying in the
following line.
5 Verification
The nodes are tested for both of the devices on the EtaBot.
6 Conclusion
The integration of the radiation sensor and the light sensor is considered to
be successful, since both of the devices could be read by the node programmed in
this assignment. The data received by the node is also correctly interpreted and
published to the ROS topic. Any other further development can easily be
continued from here on because the value published on the ROS topic can be
obtained by any other nodes.
There is however one bug which was discovered but can easily be solved.
When reading from the light follower, the device should be unplugged when the
node is stopped. If it is left plugged in, when the node is started, the device will
be detected as the gamma scout. This is because the light follower continues to
send data to the buffer even without the node running.
7 References
http://wiki.ros.org/
http://www.gamma-scout.it/images/immagini_struttura/gamma-scout-online.jpg