International Master’s Thesis

Gas Dispersal Simulation in ROS

Ali Abdul Khaliq Technology

Studies from the Department of Technology at Örebro University 0 örebro 2011

Gas Dispersal Simulation in ROS

Studies from the Department of Technology at Örebro University 0

Ali Abdul Khaliq

Gas Dispersal Simulation in ROS

© Ali Abdul Khaliq, 2011 Title: Gas Dispersal Simulation in ROS ISSN

1650-8580

Abstract This work presents a 3-D gas dispersal simulation and olfactory detection system implemented in ROS. Gas dispersal simulation integrates OpenFOAM flow simulation and a filament-based gas propagation model to simulate gas dispersion for compressible flows with a realistic turbulence model. The olfactory detection system models the response of metal oxide gas sensor to the simulated gas. Olfaction related experiments in mobile robots can be highly complex and hazardous due to the involvement of flammable and toxic gases. Moreover, the results of mobile olfaction task depends on the characteristics of environment and on the characteristics of odor detection system. The precision of results of this task is usually effected due to the variability of interrelationships between these characteristics which can create complications to focus on task aspect. The motivation behind the development of this simulation package is to make environment and odor detection system controllable, where experiments can be repeated under identical conditions, bypassing the environmental hazards so that the research work can concentrate on task aspect. The simulation package is validated through the results obtained by various tests including constant concentrations in ideal conditions as well as changing concentration in turbulent environment.

i

Acknowledgements First, I would like to show my deepest gratitude to my supervisors, Sepideh Pashami and Achim J. Lilienthal, for their precious academic support, fruitful discussions and suggestions throughout the project work and thesis writing. I would like to thank Sahar Asadi and Marco Trincavelli for their guidance and help. I would also like to thank researchers at AASS lab for their valuable ideas and comments. Many thanks to my classmates for pleasant time we spent together in these two years. I also like to thank my friends here in Sweden for their support and friends back home because they always make me feel their presence, especially when I needed it. I also thank my sisters and brother Khuram Abdul Khaliq for their unconditional love, for supporting and cheering me up during these years. Finally, I am grateful to my parents who have supported me remarkably. I am thankful for their love, prayers and moral support which gave me the strength in difficult times. They encouraged me to pursue my Masters studies and without their encouragement and faith on me, I would not be able to achieve this.

iii

Contents 1 Introduction 1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Related research . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1 1 2 4

2 Gas Dispersal Simulation 2.1 Introduction . . . . . . . . . . . . . . . . . . 2.2 Gas Propagation Model . . . . . . . . . . . 2.2.1 OpenFOAM Turbulent Flow Model 2.2.2 Filament-base Gas Dispersion . . . . 2.3 Three-dimensional Gas Dispersion . . . . . 2.3.1 Acceleration Rate Estimation . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

5 5 5 6 6 7 8

3 Gas Sensor Model 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . 3.2 Gas Sensor Model Implementation . . . . . . . . 3.2.1 Filament-based Concentration Calculation 3.2.2 Gas Sensor Model Description . . . . . . . 3.2.3 Nonlinear Least-Squares Method . . . . . 3.2.4 Sensor Response Generation . . . . . . . . 3.2.5 Low Pass Filter . . . . . . . . . . . . . . . 3.2.6 Rise and Decay Time Estimation . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

11 11 12 12 12 13 14 14 16

4 Three-Dimensional Gas Dispersion Package in ROS 4.1 Introduction . . . . . . . . . . . . . . . . . . . 4.1.1 Robot Operating System (ROS) . . . . 4.1.2 Used ROS Packages and Terminologies 4.2 Stack Implementation in ROS . . . . . . . . . 4.2.1 Environment . . . . . . . . . . . . . . 4.2.2 Dispersal_Simulation . . . . . . . . . . 4.2.3 Simulated_MOX . . . . . . . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

19 19 19 19 21 22 22 23

v

. . . . . .

. . . . . .

. . . . . . .

. . . . . . .

vi

CONTENTS

4.2.4 Path_Planning . . . . . . . . . . . . . . . . . . . . . . 4.3 Detailed Description of Message Pass System between Nodes 4.3.1 User Input: Source height . . . . . . . . . . . . . . . 4.3.2 Node: Environment . . . . . . . . . . . . . . . . . . . 4.3.3 Topic: Environment visualization . . . . . . . . . . . 4.3.4 User Input: Name of the gas for simulation . . . . . . 4.3.5 Node: Dispersal_Simulation . . . . . . . . . . . . . . 4.3.6 Topic: Dispersion visualizatio . . . . . . . . . . . . . 4.3.7 Topic: Chemical value . . . . . . . . . . . . . . . . . 4.3.8 User Input: Sensor height and sensor model . . . . . 4.3.9 Node: Simulated_MOX . . . . . . . . . . . . . . . . 4.3.10 Topic: robot/odom . . . . . . . . . . . . . . . . . . . 4.3.11 Service: Odor value . . . . . . . . . . . . . . . . . . . 4.3.12 Topic: Sensor display . . . . . . . . . . . . . . . . . . 4.3.13 Topic: Sensor readings . . . . . . . . . . . . . . . . . 4.3.14 Rxplot . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.15 Log file . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.16 Way points . . . . . . . . . . . . . . . . . . . . . . . 4.3.17 Node: Path_Planning . . . . . . . . . . . . . . . . . . 4.3.18 Node: rviz . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

23 27 27 27 27 27 28 28 28 28 28 29 30 30 30 30 30 30 30 31

5 Results 5.1 Gas Dispersal Simulation Results . . . . . . . . . . . . . . . . . 5.1.1 Visualization of Changing Width of Filaments . . . . . . 5.1.2 Visualization of Changing Concentration . . . . . . . . . 5.1.3 Results without Considering Air Resistance and Density 5.1.4 Results with Considering Air Resistance and Density . . 5.2 Gas Sensor Simulation Results . . . . . . . . . . . . . . . . . . . 5.2.1 Sensor Response against Constant Concentration . . . . 5.2.2 Sensor Response against Changing Concentrations . . . 5.2.3 Sensor Response in Turbulent Environment . . . . . . .

33 33 33 33 34 35 39 39 39 40

6 Discussions and summary 6.1 Discussions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.1 Why ROS (Robot Operating System)? . . . . . . . . . . 6.1.2 Why another Olfaction simulator for ROS . . . . . . . . 6.1.3 Code reusability . . . . . . . . . . . . . . . . . . . . . . 6.1.4 Why Time Constants from Mark III are used? . . . . . . 6.1.5 What is the Reason for Creating Path_Planning Package? 6.1.6 What are the Future Works? . . . . . . . . . . . . . . . . 6.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

51 51 51 52 55 56 57 58 60

CONTENTS

A

Manual for 3-D Gas Dispersal Simulation in ROS A.1 Introduction . . . . . . . . . . . . . . . . . . A.2 Getting Started . . . . . . . . . . . . . . . . A.2.1 Prerequisites . . . . . . . . . . . . . . A.2.2 Downloading Odor Simulation . . . A.2.3 Installing Odor Simulation . . . . . . A.2.4 Executing Odor Simulation . . . . .

References

vii

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

63 63 63 63 64 64 64 69

List of Figures 1.1 Entities that effect the result of a mobile robot experiment. . . .

2

2.1 Free-falling motion of objects of different weights . . . . . . . . 2.2 Buoyant and gravitational forces acting on an object . . . . . . .

8 10

3.1 3.2 3.3 3.4 3.5

Typical sensitivity chatacterstics of gas sensor TGS 2620. Sensor responce without any delay against concentration. Traditional three phase sampling process. . . . . . . . . . Filtered sensor response. . . . . . . . . . . . . . . . . . . Final sensor response. . . . . . . . . . . . . . . . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

13 15 16 17 17

4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8

Visualization of environment Simulation in rviz . . . . . . 2-D simulation of environment in stageros. . . . . . . . . . Simulation of gas dispersion displayed in rviz. . . . . . . . Simulation of gas sensor collecting data from environment. Gas sensor response represented in rxplot. . . . . . . . . . Path plan of a robot for a given goal in environment. . . . Simplified input/output flow of ”Simulated_MOX” node. . Simulation process flow diagram. . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

23 24 25 25 26 26 29 32

5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.10 5.11

Change in width of each filament indicate by change in color. Top view of concentration levels of the plume. . . . . . . . . Plume acceleration without air resistance and density . . . . Plume acceleration with density and air resistance. . . . . . . Heights of plumes of gases with different densities. . . . . . Response of different model sensors at same concentration. . Response of sensors against steps concentration. . . . . . . . Response of sensors against upstairs concentration. . . . . . Response of sensors against downstairs concentration. . . . Response of sensors against random concentration. . . . . . Robots crossing plume for data collection. . . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . . .

34 35 36 37 38 40 43 44 45 46 47

ix

LIST OF FIGURES

x

5.12 Response of TGS sensors while crossing the plume . . . . . . . . 5.13 Robots placed in the way of plume for data collection. . . . . . 5.14 Response of TGS 2611 gas sensors placed accros the plume . . .

48 49 49

6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8

Plume generated with PlumeSim. . . . . . . . . . . . . . . . . . 53 Odor sensing setup with PlumeSim. . . . . . . . . . . . . . . . . 54 rxplots of rise and decay time of odor sensor used in PlumeSim. 55 3-D dispersal simulation with obstacle in Dispersal simulation. . 56 3-D visualization setup for gas sensor with Dispersal simulation. 57 rxplots of rise/decay time of sensor response in Dispersal simulation 58 rxgraph of each node of package that is working separately. . . 59 Visualization of each node that is simulated separately. . . . . . 60

A.1 A.2 A.3 A.4

Visualization of environment Simulation . . . . . Visualization of three MOX gas sensors in rviz. . rxplot of a MOX gas sensor response. . . . . . . Visualization of gas dispersion simulation in rviz.

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

65 66 67 68

List of Tables 5.1 Environment configuration for data collection test. . . . . . . . 5.2 Constants estimated by curve fitting. . . . . . . . . . . . . . . .

xi

41 42

Chapter 1

Introduction This chapter is composed of the motivation, related research and the outline of the thesis.

1.1 Motivation Olfaction plays an important role in the survival of most of the living creatures. Animals use sense of olfaction for tracking their hunt, mate or predator avoidance etc. Despite the fact that olfaction plays an important role in natural life, researchers are investigating sense of smell and trying to use this property artificially with mobile robots to achieve certain goals. Artificial devices that mimic the functionality of olfactory system are known as electronic noses (e-noses) [10]. The metal oxide (MOX) gas sensors are extensively used in electronic noses applications. Metal oxide (MOX) gas sensors equipped on mobile robot can be used in different applications which are described below: Mobile robots with olfaction can be beneficial for the applications where humans work with the collaboration of well trained animals having well developed sense of smell. These applications includes detection of explosives and finding buried land mines [39], security, surveillance or finding people in search and rescue operations [22]. Furthermore, integration of olfaction in mobile robotics is carried-out in chemically related tasks, such as environmental monitoring [34]. Mobile robot olfaction mainly focuses on search and tracking of odor plumes and localization of their source; the mapping of odor fields and the tracking of volatile chemical trails [6]. Additionally, some gases which are harmful for human health, cannot be sensed by humans. Carbon monoxide is one of these gases, is responsible of the deaths and poisonings reported throughout the world each year. It is also purposed that prolonged exposure to low concentrations of carbon monoxide may have unfavorable effects on the brain [44]. Normally at homes, accidental carbon monoxide poisoning can be caused by deficient ventilation. The simplest way to overcome this issue is by installing olfaction sensors i.e. stationary carbon monoxide detectors [26]. 1

CHAPTER 1. INTRODUCTION

2

Figure 1.1: Entities that effect the result of a mobile robot experiment [6].

From the above paragraph, the perception is revived that toxic, flammable and explosive chemicals are involved in olfaction related tasks which enhances the environmental hazards and risk of life. Moreover, experiments conducted by mobile robotics can be notably complicated and the precision of the results of repeated experiments usually show large degree of variations. It is due to the variability of the relationships between the entities involved in experiments [6]. Figure 1.1 shows the entities that effect the result of a mobile robot experiment. The results of mobile robot olfaction tasks depends upon the environment and olfactory detection system equipped on a mobile robot. If the environment and olfaction system is kept in control, research attention can be more focused towards the task [6]. This thesis focuses on the simulation of odor transport environment and olfaction detection system to make them controllable. The used simulation framework is Robot Operation System (ROS). ROS was designed to meet a specific set of challenges encountered when developing large-scale service robots as part of the STAIR project [37] at Stanford University and the Personal Robots Program [48] at Willow Garage, but the resulting architecture is far more general than the service-robot and mobile-manipulation domains. ROS is not just a simulation environment; actually, it is a complete Robot Operating System that supports messaging infrastructure and provides means to develop and share solutions with other researchers [35].

1.2 Related research Research in the field of olfaction is continuing in various directions including trail odor source localization, trail following, mapping of odor distributions, odor plume simulation and tracking. Number of experiments are performed using both 2-dimensional [36] and 3-dimensional [17] environments. Experimental setups use both single [27] and multiple [30] mobile robots. Goncalo Cabrita, Pedro Sousa and Lino Marques [6] described a Player/Stage simulation framework for mobile robot olfactory experiments. They

1.2. RELATED RESEARCH

3

work on PlumeSim framework which does not only simulate odor transport in the environment, but includes also an olfactory detection systems. The odor sensing process is modeled against data received by different time response sensors gas sensors. They performed the experiments which showed that the PlumeSim framework is able to feed real-like simulations of chemical plumes into Stage. From the experiments they observed that the plume used for the simulated experiment is very similar to the plume measured during the real world experiment. There package is able to provide plumes based on Meandering algorithm and Gaussian algorithm. It also allows to reading a log file and fluent log files designed specifically for this application. However, their model can be more improved. They suggested that future works will focus on enhancing the current sensor modeling package, movement of the robot itself and the airflow that it generates by the movement of robot. Furthermore, Player/Stage provides 2-dimensional simulation platform. Working with simulation in 3-dimensional platform such as Robot Operating System (ROS) can provide the simulation which is more near to real world as compare to 2-dimensional simulation. After the success of Plumesim framework in Player/Stage, they implemented their framework in ROS in order to get more robust and detailed simulation. In the paper [8], a computationally efficient Filament based plume simulation model is designed to mimic both the short-time and long-time exposure statistics of an odor plume in turbulent medium. Filament is a collection of molecules or particles. The interaction of gas with its surrounding is dominated by three physical effects. First, molecular diffusion which slowly mixes the gas with the surroundings. Second, turbulent air flow that breaks the gas into segments of patches of high concentration with steep gradients at their edges. Third, flow advection that moves these patches. A continuous wind field that varies with location and time in both magnitude and direction is involved in the model. The plume shape is determined by the integrated effect of these three effects. The objective behind the development of this simulation model was to simulate a plume that is able to reproduce the long-term time-averaged plume data accurately, reproduce the short time-scale signature for sensed concentrations realistically and to evaluate various source localization and plume tracing algorithms under identical conditions. The paper [36] presents a gas dispersal simulation package. This package integrates OpenFOAM flow simulation and a filament-based gas propagation model to simulate gas dispersion. This gas dispersal model simulates gas dispersion for compressible flows with a realistic turbulence model based on filamentbased gas dispersal model [8]. Furthermore, the governing equations of turbulent flow model, the gas propagation model, implementation of gas dispersal simulation method and the results under the compressible flow are also discussed. Derived data- driven statistical gas distribution models are also shown in the paper. The objective behind the development of this gas dispersal simulation package was the evaluation of statistical gas distribution models and to provide comprehensive information about a large number of gas sensor mea-

CHAPTER 1. INTRODUCTION

4

surements. The statistical distribution model can also be useful for gas source localizations and for estimating where to take the future measurement. Moreover, the simulation package is published as open source software. The paper also describes the future work as; using the simulation package to evaluate sensor planning methods and different temporal and spatial sampling approaches and to extend the gas dispersion to 3-dimensions and to integrate the gas dispersion package with a robot simulation tool.

1.3 Contributions Ambition of the thesis lies in the extension the gas dispersal simulation package discussed in [36] and integration of this extended package with a robot simulation tool. The essential extended sections are: • Visualization of gas dispersion from 2-dimensions to 3-dimensions. The already existing 2-dimensional simulation engine that integrates OpenFOAM flow simulation and a filament-based gas propagation model to simulate the gas dispersion is extended from 2-dimensions to 3-dimensions. • Acceleration estimation for various gas plumes. Different gases accelerate with different rates depending upon their density and the air resistance. Gases denser than air tends to move towards the ground and gases less denser than air moves upwards in the presence of air resistance. The acceleration for different gases is introduces in the simulation by taking air resistance and density into account. • Implementation of olfaction detection system. The olfactory detection system models the response of metal oxide gas sensors to the simulated gas. • Integration of the extended gas dispersion package with ROS. The simulation of gas dispersion and olfation detection system is useful for many applications, therefore, it is intended to publish this package as open source software and integrate with a robot simulation tool.

Chapter 2

Gas Dispersal Simulation This chapter discusses the turbulent flow model and filament-based gas dispersal simulation [8] in detail and the implementation of filament-base gas dispersion without and with acceleration considering the air resistance.

2.1 Introduction The combination of gas sensors and mobile robots is useful for a number of application areas which are described in Chapter 1. Inspired by these applications, the research in mobile robotics has been focused on Gas source Localization, Gas Discrimination and Sensor planning etc [46]. Odor source localization with mobile robots is a search problem, with the goal of finding a source that releases some chemical substance which can be measured by an appropriate sensor [31]. Gas discrimination is a classification problem that discriminates one gas or gas source from another [46]. Sensor planning involves with what to sense and when to sense [21]. Complex experiments are performed where environmental hazards are also involved in the development of these applications. Moreover, results of the experiments shows fluctuations where repetition of experiments are involved due to the variability of relationship between environment and olfaction detection system. Making the environment controllable is one of the approaches to deal with the situation [6]. This is the intention of gas dispersion simulation to make environment controllable.

2.2 Gas Propagation Model When a gas interacts with its surroundings it experiences three physical effects: molecular diffusion, turbulent air flow and advection [36]. Molecular diffusion or simply diffusion is described as the spread of particles through random motion from regions of higher concentration to regions of lower concentration [3]. Turbulence is that state of fluid motion which is characterized by apparently random and chaotic three-dimensional vorticity [11]. When turbu5

6

CHAPTER 2. GAS DISPERSAL SIMULATION

lence is present, it fragments the gas emanating from a source into intermediate patches of high concentration with steep gradient at their edges [40]. Advection is a transport mechanism of a substance. An example of advection could be the transport of pollutants or silt in a river and the motion of the water carries these impurities downstream [43]. Gas dispersion model used in our implementation is described in [36] considers all three above mentioned effects. Gas is represented by a sequence of puffs. Each puff contains a number of particles. A gas released from its source is affected by the turbulent air flow, molecular diffusion and advectively transported by the wind. The Gas dispersion is divided into two parts: one is air flow simulation by using OpenFOAM and the second is the gas propagation using filament based approach.

2.2.1

OpenFOAM Turbulent Flow Model

Fluid flows can be defined in three categories: laminar, in transition from laminar to turbulent or fully turbulent. Turbulence flow models are mostly based on Reynolds Averaged Navier-Stokes (RANS) equations which can be classified as Reynolds stress model or eddy-viscosity model [36]. OpenFOAM is an open source CFD software package, which has an extensive range of solving complex fluid flows involving chemical reactions, turbulence and heat transfer. It offers different CFD algorithms to model laminar or turbulent flow [1]. There are a number of OpenFOAM solvers available. The compressible flow model is chosen from the available models. It is because of model all possible future phenomena in the air flow field. In compressible flows, available solvers suitable for this implementation are: rhoCentralFoam, rhoSimpleFoam, rhoPisoFoam and rhoPimpleFoam. Any one of these solvers can be used because the initial conditions required to be set are same for all these solvers. Each of these solvers can apply either an eddy-viscosity or Reynold stress model. Eddy-viscosity is used because the computational cost of Eddy-viscosity is less than the Reynold stress model. Moreover, the gas propagation model is independent of this turbulent Flow model and any other model can be used.

2.2.2

Filament-base Gas Dispersion

Filament-based Gas dispersion is modeled by the approach used in [8]. Gas is simulated in the environment as a set of filaments (i = 0, 1, 2, ..., N). Each filament contains constant amount of molecules. Filaments have position Pi,t and width Ri,t . The position of every filament is updated according to the flow of wind wpi,t at each time step t. Pi,∆t = Pi,t + wPi,t ∆t + εp

(2.1)

2.3. THREE-DIMENSIONAL GAS DISPERSION

7

where wpi,t represents the wind vector at position Pi,t . εp is a vector of three independent Gaussian random variables, N(0, σ2p ), with standard deviation σp = 0.1m. Due to molecular diffusion, the filament becomes wider and the concentration decreases with the time. The width of a filament is defined as: γ (2.2) Ri,t+∆t = Ri,t + 2Ri,t where, γ = 4 × 10−7 and Ri,t is the parameter for controlling the width.

2.3 Three-dimensional Gas Dispersion Almost everything in the real world experiences the gravitational force. In three-dimensional representation of a filament this force is an important factor to bring the dispersal simulation one step closer to real scenario. The filaments dispersing with certain velocity will produce some acceleration due to the presence of gravitational force (gravitational acceleration). Let’s calculate the acceleration for a filament. For a given initial velocity, v~0 , and initial position, p~0 the position of a filament, ~p, as a function of time, under constant acceleration, a ~ can be described as [18]: 1 2 a ~t (2.3) 2 The Equation (2.3) is a vector equation, let’s break it into its components i.e. x, y and z. If we neglect the air resistance, the acceleration is −g in z direction due to the gravity. The acceleration in the x and y direction is zero. Therefore, the above vector equation can be written as three scalar equations: ~p = p~0 + v~0 t +

x = x0 + v0 t

(2.4)

y = y0 + v 0 t

(2.5)

1 2 at (2.6) 2 From the above three equations, the 3-dimensional position (x,y,z) of a filament can be determined. In the Equation (2.6) the acceleration of a filament is a = −g = −9.8m/s2 . Therefore, the filaments will accelerate towards the ground with the rate of 9.8m/s2 . It is noted the acceleration in Equation (2.6) is without encountering a significant force of air resistance which means that the only force acting on the filament the gravitational force. Filaments of various gases will accelerate with the same rate regardless their different physical or chemical properties. In order to understand this phenomena, let’s consider the free-falling motion of a 1000-kg sphere object and a 1-kg sphere object in Figure 2.1. In this figure, if only force is considered, then it would be seen that the 1000-kg object would experiences a greater force of gravity. But according to the Newton’s z = z0 + v 0 t −

8

CHAPTER 2. GAS DISPERSAL SIMULATION

Figure 2.1: Free-falling motion of objects of different weights

second law, acceleration depends upon two factors: force and mass. The 1000kg object experiences more force but it has more mass as well and this mass has an inverse affect upon the acceleration of this object. Similarly, the 1-kg object experiences less force and has less mass. Thus, the ratio of force to mass (Fnet /m) is the same for the 1-kg and the 1000-kg object without air resistance situations.

2.3.1

Acceleration Rate Estimation

Gases with different densities accelerate with different rates and form different plume shapes. Gases with high mass or density remains closer to the surface of the earth. Such as: ethanol, methanol, acetone and etc. Gases with less mass or density disperse away from the surface of the earth. Such as: hydrogen, neon, ammonia and etc. In order to estimate the acceleration rate for different gases in the presence of air resistance, Buoyant force is calculated. When an object is completely or partially submerged in a fluid, a resultant force acting on the body pushes the object upward. This force is called the buoyant force [12]. Let’s now calculate the buoyant force for the filament. The magnitude of buoyant force is given by the weight of the fluid (air) displaced by the filament: FB = ρair gV

(2.7)

2.3. THREE-DIMENSIONAL GAS DISPERSION

9

where ρair is the density of the fluid i.e. air, g is the gravitational force and V is the displaced volume. The direction of this buoyant force is upward. The downwards force of gravity is given by: (2.8)

Fg = −mg where m is the mass of the filament. This equation can be written as:

(2.9)

Fg = −ρflm gV

where ρflm is the density of the filament. The Equation(2.7) and Equation(2.9) shows that there are two forces acting on the filament that are: buoyant force acting upwards and gravitational force acting downwards which is also shown in Figure 2.2. The net force acting upon the filament is given by: Fnet = FB + Fg

(2.10)

Fnet = (ρair gV) − (ρflm gV)

(2.11)

The above equation can be written as: Fnet = gV(ρair − ρflm )

(2.12)

mtotlal = mair + mflm

(2.13)

Total mass is given as:

where mair is the mass of air and mflm is the mass of filament. the Equation(2.13) can be written as: mtotlal = V(ρair + ρflm ) as we know that: a =

F m,

(2.14)

here, F = Fnet and m = mtotlal , therefore; a=

g(ρair − ρflm ) ρflm + ρair

(2.15)

where; ρflm is the density of filament and ρair is the density of air. The Equation(2.15) shows that if the density of the filament is less then the density of air then filament will accelerate upwards and if the density of filament is greater than air, the filament will accelerate downwards. By calculating the value of a from Equation (2.15) and putting this acceleration value in Equation (2.6), the position of a filament that depends upon the density of filament and air resistance can be calculated.

10

CHAPTER 2. GAS DISPERSAL SIMULATION

Figure 2.2: Buoyant and gravitational forces acting on an object

Chapter 3

Gas Sensor Model This chapter describes the modeled gas sensor by using the concentration acquired from the simulated gas dispersion. Typical sensitivity characteristics of different gas sensor models are used to simulate the gas sensor response. To produce real like response, various techniques are use to enhance this simulated response such as: filtering and rise/decay time estimation.

3.1 Introduction The metal oxide (MOX) gas sensors own the characteristics such as: low cost, commercially availability, simplicity of use, relatively fast response and sensitivity than other sensing technologies. These characteristics are dominant reasons for the widely usage of metal oxide sensors in electronic nose applications and mobile robotics olfaction [45]. Researchers and developers are contributing to understand the sensing mechanism of MOX gas sensors with phenomenological and spectroscopic technologies [49]. There are two types of metal oxide gas sensors: n-type and p-type. N-type responds to reducing gases like hydrogen, methane, ethanol and etc. P-type responds to oxidizing gases like oxygen, chlorine and etc [19]. N-type metal oxide gas sensors are considered in this implementation. MOX gas sensors measure the change in the conductance of the oxide when a gas interacts with the sensing surface. The change in conduction is linearly proportional to the logarithm of the concentration of the gas [14]. A simple electric circuit in MOX converts the change in conductivity to an output signal which corresponds to the gas concentration. MOX gas sensors operates on high temperatures and typically they have to be heated for 30 to 60 minutes before operation [29]. These limitations consume comparatively much power and time. One of the solution to overcome these limitations can be the simulation of MOX gas sensor response. In simulation, the simulated response of the MOX gas sensor should copy the real response as close as possible. The study and understating of MOX gas sensor’s dynamics and its response to different gases is essential for copying the real 11

CHAPTER 3. GAS SENSOR MODEL

12

response of the sensor [6]. Moreover, MOX gas sensor response varies against different chemicals. Different models of MOX gas sensor can also produce different response against the same concentration of same chemical [24]. This thesis covers a reasonable model that explains the important aspects of MOX gas sensor such as: sensitivity characteristics of different models of MOX gas sensor against different chemicals, rise time and decay time. The sensor model is designed for different series of FIRGO sensors such as: TGS 2600, TGS 2611 and TGS 2620 (model can be extended for any other types of sensors). The sensor model can detect different chemicals such as: ethanol, hydrogen and methane.

3.2 Gas Sensor Model Implementation 3.2.1

Filament-based Concentration Calculation

The position of each filament is calculated in Chapter 2. The concentration at any position X=(x,y,z) at time t is calculated as the sum over the concentration at the location contributed by each filament. C(x, t) =

N X i=1

C(x, t)

molecules cm3

(3.1)

The concentration at location X due to the filament i is modeled as: Ci (x, t) =

|x − Pi,t | molecules Q ) exp( cm3 R2i,t R3i , t

(3.2)

Where; Q represents the number of molecules per filament, Ri,t is a parameter controlling the width, and Pi,t is the current position of the i − th filament. Equation(3.2) shows that the concentration of filament decreases exponentially when distance increases from its center. This calculated concentration is further given as input to the gas sensor model which is described in this chapter.

3.2.2

Gas Sensor Model Description

The MOX gas sensor response varies from chemical to chemical. The Figure 3.1 is taken from the data sheets of “FIGARO TGS 2620” which represents the typical sensitivity characteristics of this sensor. In the Figure 3.1, x-axis indicated the Gas concentration and y-axis indicates the sensor resistance ratio Rs /R0 , Where: RS =Sensor resistance in displayed gases at various concentrations. R0 =Sensor resistance at 300ppm of ethanol. This figure shows that as the concentration increases, the resistance (inverse of conductance) decreases. It is observed that concentration and sensor

3.2. GAS SENSOR MODEL IMPLEMENTATION

13

Figure 3.1: Typical sensitivity chatacterstics of gas sensor TGS 2620 against five different chemicals and air is shown in this Figure [42].

response are inversely proportional to each other and this proportional is exponential. The typical sensitivity characteristics of the sensors are used as a reference to determine the response of the sensors on different concentrations. It is realized that the typical response of sensor on different concentrations can be determined by using the curve fitting method. Since the response of the sensor on concentration is not linear, Nonlinear Least-Squares Method is used.

3.2.3

Nonlinear Least-Squares Method

Nonlinear least squares is the form of least-squares analysis which is used to fit a set of m observations with a model that is nonlinear in n unknown parameters (m > n) [20]. By visualizing the response of different models of MOX gas sensors from their typical sensitivity characteristics, sample data points (x1 , y1 ), (x2 , y2 ), ..., (xN , yN ) are extracted and the exponential curve is fitted. The exponential curve can be mono-exponential or bi-exponential:

CHAPTER 3. GAS SENSOR MODEL

14

yout = A.eBx yout = A.e

Bx

+ C.e

(3.3) Dx

(3.4)

The Equation(3.3) is the mono-exponential and Equation(3.4) is the biexponential. Where, A ,B C and D are constants, x is the input data. The nonlinear least-squares procedure requires the minimum of: E(A, B, C, D) =

N X

((yout )k − yk )2

(3.5)

k=1

Where, yout is the mono-exponential or bi-exponential, yk is the output against the input x data. A ,B C and D are the estimated constants. For each of the gas sensors (TGS 2600, TGS 2611 and TGS 2620) the constants: A ,B C and D are estimated for different chemicals (hydrogen, ethanol and methane) by using Equation(3.5). The equation for each chemical is constructed by using Equation(3.4).

3.2.4

Sensor Response Generation

By using the above calculated Equations(3.5) and (3.4), sample response of TGS 2620 is generated against ethanol in order to examine the output response of the sensor. Figure 3.2 shows the simulated sample sensor response generated against ethanol by TGS 2620. Figure 3.2 shows that the sensor response to the input concentration is immediate without any time delay. But in reality, the gas sensor cannot response immediately to the input concentration. The sensor response to change in concentration is an exponential function with some time delay. Figure 3.3 is taken from the [47] which explains the traditional three phase sampling process. Where, 0 indicates the baseline, 1 transient, 2 steady state and 3 recovery. The simulated sensors response must mimic this real sensor response. This means that some enhancement is required in the simulated sensor response. It is realized that using some filtering technique, delay can be obtained in sensor response. Low pass filter is used to produce some delay in the sensor response.

3.2.5

Low Pass Filter

The opposite of a high-pass filter is low pass filter, that allows low frequency signals to pass but attenuates the signals with frequencies higher than cutoff frequency [41]. In Algorithmic implementation, low-pass filter can be expressed as: ft = αyt + (1 − α)ft−1

(3.6)

3.2. GAS SENSOR MODEL IMPLEMENTATION

15

Figure 3.2: Upper: input concentration given to the gas sensor. Lower: simulated response of the gas sensor.

α=

dt τ + dt

(3.7)

where, ft is the filtered output, α is smoothing factor, yt is the input sensor response, dt is the time interval and τ is the time constant. Figure 3.4 shows the filtered sensor response. It can be observed that sensor response on given concentration is smooth with some time delay and simulated sensor response is almost copying the real sensor response. It is also observed that the response and recovery time of simulated sensor response are same. But in real sensor response it is not the case. In real sensor response, rise time is not equal to recovery time. Final enhancement in simulated sensor response is to estimate the response and recovery time.

16

CHAPTER 3. GAS SENSOR MODEL

Figure 3.3: Traditional three phae sampling process [47].

3.2.6

Rise and Decay Time Estimation

The rise and decay time used in simulated sensor response are based on [24]. In this paper, the statistical analyses of the experiments provide the rise and decay time constant estimations for Mark III mobile nose. Experiment was conducted by using Six MOX gas sensors (two each of TGS 2600, TGS 2610 and TGS 2620). The summarized results of experiment include the parameters that describe the average of the time constants of rise and decay. A reasonable estimate of the sensor response is provided by the mean value of the time constants (averaged over all six sensors): τr = 1.8s

(3.8)

τd = 20.7s

(3.9)

where τr is the estimated time constant for rise period and τd is the estimated time constant for decay period. Equations(3.8) and(3.9) are used as time constant for rise and decay. Figure 3.5 shows the implementation of these time constants for rise and decay time. It is also noticed that the best estimation of rise and decay time constants cannot be determined. It is due to the rise and decay time constants depend on the sensor type as well as the different sensors of same type. Moreover, rise and decay time constants are also dependent on concentration [24].

3.2. GAS SENSOR MODEL IMPLEMENTATION

17

Figure 3.4: Filtered sensor response. Notce that rise and decay time are almost same i.e 2000(ms)

Figure 3.5: Final sensor response with estimated rise and decay time constants. Notce that rise is almost 1800(ms) and decay time are almost 20700(ms)

Chapter 4

Three-Dimensional Gas Dispersion Package in ROS This chapter discusses the implementation of the Dispersal simulation (described in Chapter 2) and gas sensor model (discussed in Chapter 3) in ROS. The implemented packages in a stack, their nodes, topics and their flow is also discussed in details.

4.1 Introduction 4.1.1

Robot Operating System (ROS)

As mentioned in previous chapter, ROS is an operating system that contains a collection of user contributed nodes that implement functionality such as perception, localization and mapping, simulation and etc.

4.1.2

Used ROS Packages and Terminologies

This section describes the different ROS packages and terminologies used in simulation of the Gas dispersal [4]. ROS Node “Node” is the ROS term for an executable that is connected to the ROS network. ROS Publisher and Subscriber Publisher is a node that broadcasts a message. Subscriber node is the node that receives the messages that is being published by publisher node.

19

20 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

ROS Topics Topics are buses over which nodes exchange messages. Topics have anonymous publish/subscribe semantics. In general, nodes are not aware of who they are communicating with. ROS Packages Packages are the main unit for organizing software in ROS. It might contain ROS runtime processes (nodes) or anything else that is usefully organized together. The purpose of creating packages is to provide the useful functionality in an easy-to-consume manner so that software can be easily reused. ROS Stacks Stacks are collections of packages that provide aggregate functionality. ROS Messages Nodes communicate with each other by publishing and subscribing messages on topics. A message is a data structure that consists of type fields. Standard types of messages are: integer, float, boolean etc. ROS Services In ROS, the request and reply procedure is handled by a Service. Sevice consist of a pair of messages: one for request and one for reply. Roscore Roscore is a collection of nodes and programs that are pre-requisites of a ROSbased system. Roscore is important for ROS nodes to communicate. Visualization_msgs Visualization_msgs is a set of messages used by higher level packages, such as rviz, that deal in visualization-specific data. The main messages in visualization msgs is visualization msgs/Marker. The marker message is used to send visualization "markers" such as boxes, spheres, arrows, lines, etc. to a visualization environment such as rviz. The nav_msgs/Odometry Message It is a navigation message that stores the estimate of the position and velocity of a robot in free space.

4.2. STACK IMPLEMENTATION IN ROS

21

Move_base Move_base is a package that implements the action of reaching the given goal in the world with a mobile base. Move_base_msgs Move_base_msgs contains the messages used to communicate with the move base node. Std_msgs Std_msgs contains common message types representing primitive data types and other basic message constructs, such as multi-arrays. Rviz Rviz is a 3-d visualization environment for simulations using ROS. Rviz has various types of displays such as; point clouds, grid, axis and markers etc. A display is that draws something in the 3-D world. Each display gets its own list of properties. For example: style, color and topic etc. Each display also gets its own status to help user to know if everything is working fine or not. The status can be one of four: OK, Warning, Error and Disabled. There are three different camera types available in the rviz: Orbital Camera (default), FPS (first-person) Camera and Top-down Orthographic. Stageros The stageros is a wrapper on the Stage. Stage is a 2-dimension multi-robot simulator that simulates a world which is defined in a “.world file”. This file contains information about the world such as obstacles etc. Rxgraph Rxgraph is a command-line tool for visualizing a ROS computation graph. Rxplot Rxplot is a tool that plots data from one or more ROS topics.

4.2 Stack Implementation in ROS A stack “Odor_Simulation” is implemented in ROS. “Odor_Simulation” consists of packages: “Environment”, “Dispersal_Simulation”, “Simulated_MOX” and “Path_Planning”.

22 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

4.2.1

Environment

An environment.vcg file and environment node includes in environment package. Environment.vcg This is a configuration file that contains settings, status and properties of display. A display is something that draws objects in the 3-dimensional world such as: axis, marker and grid etc. Environment node Using ROS (Robot Operation System), a node of 3-dimensional environment model is created. The environment is a rectangular area of “74×46×5” meters. Two rectangular cube shaped obstacles are placed in the environment. First obstacles, sized “6 × 8 × 5” meters is placed at “15, 14, 2.5” (obstacle center position) and second obstacle, sized “6 × 6 × 5” meters is placed at “45, 6, 2.5” (obstacle center position). A source is placed in the environment. The height of the source is adjustable between the range of 0 − 5 meters. The laminar airflow approximately “1m/s” with the direction from left to right is introduced in the environment. Three mobile robot bases are placed at different positions in arena. The navigation of mobile robots is in 2-dimensions (x,y) in arena. Each robot base consists of an odor sensor and a connector. The connector is used to move odor sensor up and down in z-axis for sensing the odor in 3-dimensions in arena. Rviz is used for the visualization of whole 3-dimensional simulation process. Stageros is also used as an additional 2-dimensional visualization of environment and robots in order to manually drag robot in arena by clicking on them. Note that stageros displays only the simulation of the environment. While the simulation of gas dispersion and odor sensor is displayed in rviz. Figure 4.1 shows the environment displayed in “rviz” and Figure 4.2 shows the environment displayed in “stageros”.

4.2.2

Dispersal_Simulation

To generate realistic simulated plumes, a package is created that contains a node “Dispersal_Simulation”. The node implements the filament-base gas dispersal simulation discussed in Chapter 2. At each time step, the puffs of filaments are sequentially released at a source location. Each puff is composed of n filaments. Filaments are affected by turbulence and molecular diffusion along its path while being transported by advection with the wind. The 3-dimensional positions of these filaments are represented by the points of the “visualization msgs/markers”. At each time step,“Dispersal_Simulation” node calculates or determines the positions of n filaments. Gas plumes are simulated by using both

4.2. STACK IMPLEMENTATION IN ROS

23

Figure 4.1: Visualization of environment. Where, blue colored walls are boundaries of environment, green boxes are obstacles, three small squares are robots and green pipe is a gas source. Yellow colored spheres are the sensors and cylindrical lines connecting robot with sensors are connectors for moving sensors up and down in z-axis.

methods i.e. with and without acceleration which are discussed in Chapter 2 in detail. Figure 4.3 is the visualization of gas dispersal simulation.

4.2.3

Simulated_MOX

A package “Simulated_MOX” is created in order to mimic the repose of a real gas sensor against the concentration of a gas. In package “Simulated_MOX”, gas sensor model is implemented that is discussed in Chapter 3. At each time step t, the input concentration is given to the gas sensor and gas sensor produces corresponding output sensor response. The record of gas sensor response is maintained by using a log file. This log file contains the information of gas sensor response at 3-dimensional position (x,y,z) at time t. The gas sensor also “publishes” its response so that the response can also be visualized during the simulation runtime by using “rxplot”. Figure 4.4 shows the visualization of gas sensor simulation in “rviz” which is installed on a mobile robot base. The gas sensor is collecting data (concentration) and produces the response against this data which is shown in Figure 4.5.

4.2.4

Path_Planning

A package “Path_Planning” created that contains a node “Path_Planning” which uses ROS “navigation stack” [33] to drive robot base from one location

24 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

Figure 4.2: 2-dimensional simulation of environment in stageros. Where, big red squares are obstacles, three small squares are robots. On the right side, thick line represents the right boundry.

to another while safely avoiding obstacles. By using “Path_Planning” node, mobile robot bases on which gas sensor is installed, are sent in different areas in environment for data collection. Robots are sent to goals by using an input “.txt” file which contains way points for each robot. As the navigation of robot is in 2-dimensions (x,y), gas sensor is installed on robot by using a connector. A connector is a simple long rod like structure that is able to move sensor up and down in z-axis in order to gather the information in 3-dimensions (x, y, z). Another node is which is extracted from “navigation stage” [7] is created that is used for running the ROS navigation stack in stage. This node is crated for 2-dimensional visualization of environment and robots and to drag the robots anywhere in environment. Figure 4.6 is the visualization of simulation of mobile robot base that is sent to some (x,y) goal in environment.

4.2. STACK IMPLEMENTATION IN ROS

Figure 4.3: Simulation of gas dispersion displayed in rviz.

Figure 4.4: Simulation of gas sensor collecting data from environment.

25

26 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

Figure 4.5: Gas sensor response during the data collection from environment which is represented in rxplot. X-axis represents the time(s) and y-axis represents sensor resistance ratio(KOhm).

Figure 4.6: Robot is moving towards the goal in environment. Where, red line shows the path computed by navigation stack for mobile robot base to reach the goal.

4.3. DETAILED DESCRIPTION OF MESSAGE PASS SYSTEM BETWEEN NODES

27

4.3 Detailed Description of Message Pass System between Nodes The details of whole simulation process are described here such as: connections between nodes, messages passing between nodes, service clients and servers etc for example. Figure 4.8 shows the flow of whole simulation process. Let’s discuss this figure in detail.

4.3.1

User Input: Source height (1)

User can change the height of the source in order to visualize the dispersal simulation of different gases at different heights. The range of the source height is 0 − 5 meters.

4.3.2

Node: Environment (2)

The “environment” is a node that implements the simulation of environment. Environment consists of obstacles, arena boundaries and gas source. The position, size and color of obstacles, boundaries and gas source are determined by “visualization msgs/markers”. The environment node publishes this “visualization msgs/markers” on the topic “environment visualization”. In other words, the node, “environment” tells to the topic “Environment visualization” that “I am publishing the message through you”.

4.3.3

Topic: Environment visualization (3)

The “environment visualization” is a topic on which “environment” node publishes the “visualization msgs/markers”. This message contains the information about the each obstacle, boundary and gas source’s color, position and size in 3 dimensional world. This topic is further subscribed by “rviz” node. In other words, the topic “environment visualization” tells to everyone that “I have a message is it required by anyone ? ”

4.3.4

User Input: Name of the gas for simulation (4)

Different types of gases have different plume shapes. For simulating different types of gases, user input is required in this step. The input is the information about the gas i.e. name or Id which user wishes to simulate. For example (0hydrogen, 1-ethanol, 2-methane). This information is further passes to the node “Dispersal_Simulation”.

28 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

4.3.5

Node: Dispersal_Simulation (5)

The “Dispersal_Simulation” is the node in which implements the simulation of gas dispersal. The node “Dispersal_Simulation” computes the positions of filaments. The node is publisher of two messages and server of one service. Two messages are published on two different topics: on the topic “dispersion visualization”, the information is about the filament position at time t, its size and color. On the other topic “Chemical value ”, it publishes information about the gas which it is currently being simulated. This information can be gas id, name or density etc. The node is also acting as a server of a service “Odor value”. On client’s request, this server provides the concentration of gas that is currently being simulated at any 3-dimensional position. In other words, the node “Dispersal_simulation” tells to topics “dispersion visualization” and “Chemical value” that “I have two messages for publish one for each of you”. The node also tells to everyone that “I have a service for providing the concentration, does anyone require this service?”

4.3.6

Topic: Dispersion visualization (6)

The “dispersion visualization” is a topic on which the node “Dispersal_Simulation” publishes the message. The published message is the visualization message that contains the information about the positions of filaments that is computed by the node “Dispersal_Simulation”, size and color of the filaments. In the message the filaments are represented by points. This message is further subscribed by the “rviz” via the same topic “dispersion visualization”.

4.3.7

Topic: Chemical value (7)

On this topic, the node “Dispersal_Simulation” publishes the message that contains information about the simulated gas such as; id, name or density of gas. The node “Simulated_MOX” subscribes the message which is published through this topic.

4.3.8

User Input: Sensor height and sensor model (8)

Gas sensors with different models have different response on same chemical. The user provides the input sensor model (TGS 2600, TGS 2611 and TGS2620) for simulating their response. As the robot movement is in 2-dimensions (x,y), the user also provides the (z-axis) position in order to be able to gather the concentration information in 3-dimensional world.

4.3.9

Node: Simulated_MOX (9)

The node “Simulated_MOX” is the busiest node in the simulation because it has to deal with many publications and subscriptions at the same time. The

4.3. DETAILED DESCRIPTION OF MESSAGE PASS SYSTEM BETWEEN NODES

29

Figure 4.7: Simplified input/output flow of “Simulated_MOX” node. Where, gas concentration, simulated gas sensor id and simulated gas id are inputs and gas sensor response is output

“Simulated_MOX” is the node that implements the simulation of gas sensor model and produces gas sensor response against the given concentration. This node is subscriber of two messages, client of one service and publisher of two messages. Two subscribed topics of the node are: one topic is “chemical value” which contains the information about gas which is currently being simulated. This information helps in the production of sensor response for this gas. The other subscription is the message on topic “robot/odom”. This message stores an estimate of the position and velocity of a robot in free space. The node requests for the service provided by the node server “Dispersal_Simulation”. The request is in the form of (x,y,z) position of the sensor, the server sends back the response in the form of concentration of the gas at position (x,y,z) that is currently being simulated. Two messages are published on two different topics: on the topic “sensor display”, the information about the sensor position at time t , its size and color is published. On the other topic “sensor readings”, the sensor response at time t is published. For this node, service response and subscriptions act as input and the publications are the corresponding outputs. A simplified flow of the node “Simulated_MOX” is shown in Figure 4.7. Finally at the end of whole simulation process, a log file is maintained that contains the information about the sensor position (x,y,z), concentration at this position and gas sensor response at this concentration at time t. In other words, the node “Simulated_MOX” tells to topics “chemical value” and “robot/odom” that “I need the information from you”. The node also provides the sensor position to the server and request that “give me the gas concentration on this point”. After getting all this information, the node uses this information and tells to the topics “sensor display” and “sensor readings” that “I have something to publish”.

4.3.10 Topic: robot/odom (10) On the topic “robot/odom”, the message that contains information of robot’s position in 2-dimensions and velocity is published. The subscriber of the message on this topic is the node “Simulated_MOX”.

30 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

4.3.11 Service: Odor value (11) The service “odor value” has three inputs as request and one output as a response. The request to the service is (x,y,z) position of the gas sensor and response is the gas concentration at this position.

4.3.12 Topic: Sensor display (12) The node “Simulated_MOX” publishes the message of gas sensor position (x,y,z) and color of the sensor for display in “rviz” through topic “sensor display”.

4.3.13 Topic: Sensor readings (13) After computing the gas sensor’s response against concentration at time t, the node “Simulated_MOX” publishes a message of sensor response. This messages is published through topic “sensor readings”. This topic is further subscribed by “rxplot”.

4.3.14 Rxplot (14) “Rxplot” subscribes the message on the topic “sensor reading” that contains data of the gas sensor response and plots this data.

4.3.15 Log file (15) After the completion of whole process of the node “Simulated_MOX”, a log file is created that records the required information of the simulation process. The log file contains information of position (x, y, z) of gas sensor, gas concentration at this position, the sensor response at this concentration and the time of the recorded information.

4.3.16 Way points (16) File consists of way points is an input file to the node “Path_Planning”. The file is a simple “.txt” file that contains the way points (x, y) for each robot. Through these way points robot has to pass during the simulation process.

4.3.17 Node: Path_Planning (17) The “Path_Planning” is responsible to move robot in the environment. The node gets the input way points from an input “.txt” file. The node plans the path for robot to reach these way points. If any obstacle appears during the movement of robot towards the goal, the robot re-plans the path in order to avoid the obstacle. The node “Path_Planning” uses ROS “navigation

4.3. DETAILED DESCRIPTION OF MESSAGE PASS SYSTEM BETWEEN NODES

31

stack” [33] that has several subscriptions and publications for generating the path such as; “fake localization”, “base scan”, “global plan”, “local plan” and “robot foot print” etc . These processes are not discussed here in detail because the focus of the thesis is to show the possibility of the integration of the path planning.

4.3.18 Node: rviz (18) Rviz is basically a visualization environment in ROS. Here Rviz is subscriber of three messages on different topics to display the simulation of these messages. The first subscription of node “rviz” is the message on topic “environment visualization”. The message contains information about the position, size and color of objects of environment. The second subscription of “rviz” is the message on topic “dispersion visualization”. The message contains information about the position, size and color of filaments. The third subscription is of message on topic “sensor display”. The message contains information about the position, size and color of the gas sensor. Rviz uses these information from all these subscriptions and displays the simulation of environment, gas dispersal, gas sensor and sensor response.

32 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

Figure 4.8: Figure shows the flow of services, inputs and messages publish/subscribe on topics between the nodes.

Chapter 5

Results The simulation of both gas dispersal and sensor response are tested using the various gases and in different scenarios. The results of these tests are presented in this chapter. Moreover, ethanol is considered in most of the tests for the reason that it is mostly used in the robotic olfaction literature [9], [24], [32], [16], [25] because it is non-toxic, easily detectable by tin oxide sensors [23] a and convenient target chemical [2].

5.1 Gas Dispersal Simulation Results 5.1.1

Visualization of Changing Width of Filaments

The width of the filament is determined by Equation 2.2 in Chapter 2. The width of the filament increases over time and the concentration decreases. Figure 5.1 shows the change in width and implicitly change in concentration of the filament. Width of filament is indicated by color. The filaments near the source are less wider then the filaments away from the source due to the molecular diffusion. As the filaments near source are less wider, the concentration of the filaments is higher. One of the reason for this high concentration is the short average distance between the particles of each filament. This concentration decreases with the time due to increase in the average distance between the particles. As the distance between the particles increases the width of the filament is also increases.

5.1.2

Visualization of Changing Concentration

The concentration of the plume is determined by Equation 3.2 in Chapter 3. The concentration at any location X = (x, y, z) is the sum of all the concentrations at this location contributing by each filament. Figure 5.2 is the visualization of different concentration levels in plume. Each block of grid is equal to 1m3 . The measure of concentration at each block of 1m3 is the sum of all the concentrations at this block contributing by each filament. From the figure, 33

CHAPTER 5. RESULTS

34

Figure 5.1: Change in width of each filament indicate by change in color.

high concentration blocks can be seen near to the source. The concentration of blocks decreases as their distance increases from the source. But it can also be observed that some concentration blocks (yellow blocks) appear away from the source. It is due to the dominance of turbulence and the prevailing air flow on the dispersal [28]. For determining the 3-dimensional position of filaments, the (x,y,z) positions are given by the Equations 2.4, 2.5 and 2.6 in Chapter 2. The value of a in Equation 2.6 is estimated by two different approaches: first considering acceleration without air resistance and density of gases, second, acceleration with air resistance and density of gases. Results of these two approaches are discussed in 5.1.3 and 5.1.4.

5.1.3

Results without Considering Air Resistance and Density

In this approach, the plume is generated without considering acceleration followed by the plume generation with acceleration. In real world, dispersion of gas in the 3-dimensions is effected by gravity. Intention behind this approach was to see the difference between plumes generated with and without acceleration. For the generation of plume without acceleration, the value of acceleration in Equation 2.6 is kept 0. For plume generation with acceleration this value is kept −9.8m/s2 which is the gravitational force acting on the gas particles or filaments without taking air resistance and density into account. The two generated plumes are shown in Figure 5.3. The difference between the two plumes can be observed. The plume with 0 gravitational force has almost constant height, dispersing along with the direction of wind. While the plume with

5.1. GAS DISPERSAL SIMULATION RESULTS

35

Figure 5.2: Top view of concentration levels of the plume.

gravitational force is dispersing down wards and reaches to ground after some time.

5.1.4

Results with Considering Air Resistance and Density

For simulating the plumes of various gases, one of the physical properties i.e. density is introduced in the simulation process in order to distinguish the plumes of various gases. Different gases have different densities. Gases with density higher than air tends to disperse downwards and the gases less dense than air disperse upwards. The density was introduced in the presence of air resistance in to the gas dispersal simulation by using Equation(2.15) in Equation(2.6) and the plumes of gases with different densities generated by the dispersal simulation. The visualization of four different gas (ethanol, fluorine, helium and methane) plumes, with densities (789g/L, 1.696g/L, 0.1786g/L and 0.717g/L), each with two different angles is shown in Figure 5.4. From the figure, the effect of density on the plume shape can be observed. The height of the plumes approaches to a constant level after few time stamps. This effect is due to the floor and ceiling boundaries of the simulation environment. To observe the change in height of gas plumes with time, the average height of filaments of first puff (i.e. 100 filaments) is calculated . The average of filaments of first puff is considered because it remains in the environment throughout the simulation process. A log file that contains the height of the plume is generated at the end of the simulation process. Figure 5.5 shows the heights of different gas plumes at the time of simulation. The floor and ceiling are the boundaries in the way of gas particles therefore, these particles are forced to remain near the floor or ceiling. It can be observed that as the densities of different gases increases, their plume height decreases and vice versa.

36

CHAPTER 5. RESULTS

Figure 5.3: Plume acceleration without considering air resistance and density. 1: plume with 0 acceleration. 2: plume accelerating with 9.8m/s2

5.1. GAS DISPERSAL SIMULATION RESULTS

37

Figure 5.4: Taking air resistance into account, the plumes of four gases with different densities are simulated. 1 and 2 are ethanol and fluorine with density higher then air are dispersing towards ground. 3 and 4 are helium and methane with less density then air dispersing away from ground. (a) and (b) in each row are two different view of same experiment. Top right sub-figure indicates the axis where, red: x-axis, green: y-axis, blue: z-axis.

38

CHAPTER 5. RESULTS

Figure 5.5: Average heights of filaments in first puff of gases with different densities are shown in this figure. Upper: heights of plumes that are more dens than air. Lower: heights of plumes that are less dens than air.

5.2. GAS SENSOR SIMULATION RESULTS

39

5.2 Gas Sensor Simulation Results The gas sensor is modeled by fitting the bi-exponential curve on the data created by using the typical sensitivity characteristic of TGS sensors. The bi-exponential curve is fitted for three different TGS sensors (TGS 2600, TGS 2611 and TGS 2620) and three different gases (ethanol, methane and hydrogen) by using the Equation(3.4) described in Chapter 3. The estimated constants by this curve fitting method are shown in table 5.2. The gas sensor model is tested in different scenarios including constant concentrations in ideal conditions as well as changing concentration at the presence of turbulence which are described in the following subsections.

5.2.1

Sensor Response against Constant Concentration

All three modeled sensors i.e. TGS 2600, TGS 2611 and TGS 2620 are tested against the continuous constant concentration of ethanol. The aim of this test was to observe the response of different sensors against the same gas and concentration. Figure 5.6 is the response generated by this test. It can be observed from the figure that the starting point or the response in air is different for all three sensors. These sensors were continuously exposed to the gas source (500 ppm of ethanol) in 1000-5000ms after the start of the experiment. The response of each sensor is different at the same concentration. The explanation about this change is the sensitivity characteristic of all three sensor models. Each sensor model have different sensitivity characteristic at same concentration.

5.2.2

Sensor Response against Changing Concentrations

The simulated sensor model is also tested with different strategies: steps, up stairway, down stairway and random stairway, which are based on the real experiments conducted by Marco Trincavelli in [9]. In real experiments ethanol and 2-propanol are involved but in our tests only ethanol is taken into account. The results of these strategies using TGS 2620 are shown in following figures 5.7, 5.8, 5.9 and 5.10. It can be seen in these figures that the simulated response is smooth without any fluctuation. In the steps strategy, the simulated sensor has enough time for full recovery (i.e. more than 20 seconds) and reaches back to the initial state (response in air). In rest of strategies, both simulated and real sensors do not get enough time for recovery during the experiments. Furthermore, the real sensor response does not reach to the initial state and have fluctuation depends upon various characteristic such as: noise, partial pressure of oxygen, heater voltage, temperature and humidity. During the experiments noise can affect the actual response of the sensor. Reduced oxygen pressure decreases the resistance of the sensor. TGS sensors need certain constant heater voltage to show optimum sensitivity characteristic. Since the operation of TGS sensor lies on the chemical adsorption and desorption of gas on the surface

40

CHAPTER 5. RESULTS

Figure 5.6: The response of three different model sensors: TGS 2600, TGS 2611 and TGS 2620 at the same concentration.

of the sensor. The ambient temperature affects the sensitivity characteristic by changing the rate of chemical reaction. The humidity decreases the resistance of the sensor due the adsorption of water vapors on the surface of sensor [15].

5.2.3

Sensor Response in Turbulent Environment

In the simulation, tests were performed in two different scenarios. The configurations of these two scenarios are given in table 5.1. In the first test, mobile robot bases equipped with the different models of TGS sensor were sent to various places in the turbulent environment at the presence of ethanol gas. The navigation of all robots was planned to predefined way points in such a way that they cross the ethanol plume perpendicularly. Figure 5.11 is the visualization of simulation for this test. Ethanol gas is heavier than air and tends to come down therefore gas source is placed at five meter above the ground for batter visualization of ethanol dispersal before it reaches to ground. For collecting data in different positions in z-axis the TGS gas sensors installed at different heights on mobile robot bases. Since the concentration is higher near the source and it decreases with increase in the distance from the source, the sensors installed

5.2. GAS SENSOR SIMULATION RESULTS

41

Table 5.1: Configurations of environment for data collection using TGS gas sensors.

Test

1

2

Robot id 0 1 2 0 1 2

Sensor model TGS 2620 TGS 2600 TGS 2611 TGS 2611

Sensor height 4m 2m 0m 0m 1m 1m

Source height 5m

0m

Distance between source and sensors 2m 6m 11 m 4m 8m 11.5 m

Dectcted gases Ethanol

Methane

on the robot bases according to their detection range. The sensor with high detection range was installed on the robot which was closer to the source. The sensor with low detection range was installed on the robot which was more far from the source. The sensors responses during the survey of environment are shown in the figure 5.12. From the concentration plots it can be observers that the concentration is higher near the source. By visualizing both the concentration and the sensors response against this concentration, non-linearity of the sensor response can be observed. The change in sensor resistance decreases non-linearly by increasing the concentration. The relationship between sensor response and gas concentration is linear on logarithm scale [15]. The response of TGS 2611 is almost saturated due to the high concentrations near the source. Moreover, it can also be observed that the sensor cannot response quickly to the frequent change in concentration due to the response/recovery time delays. In the second test, TGS 2611 was installed on all of three robots. The steady robot bases were placed across of methane plume in such a way that plume hit each sensor with some delay time. Methane is lighter than air therefore source was placed on the ground for batter visualization of methane dispersal. For collecting data in different heights the TGS gas sensors installed at different heights on mobile robot bases. The visualization of this test is shown in Figure 5.13 and the sensors response of this test is shown in Figure 5.14. It can be observed from the figure that the sensors respond to the methane plume according to their distance from the source. Sensor near to the source respond earlier than the sensors placed far from the source. One of the reasons could be the wind flow. The plume of gas travels according to wind speed (in our case wind inlet is 1m/s). So the plume reaches to the sensors on its way with some delay. This delay time depends on the distance of the sensors. Moreover, it can also be observed from the sensor response that the concentration of the plume gets lower by increasing the distance from the source.

CHAPTER 5. RESULTS

42

Table 5.2: Constants estimated by curve fitting for different TGS sensors and gases.

Sensor model TGS 2600

Gas A B C D Ethanol 0.4668 -0.3249 0.3293 -0.01051 Methane 0.2202 -0.1122 0.8356 -0.001932 For hydrogen sensor response is constant at any concentration i.e. 0.1 TGS 2611 Ethanol 4.766 -0.001639 3.497 -7.348e-05 Methane 3.286 -0.002211 1.806 -0.000103 Hydrogen 4.535 -0.001723 2.69 -5.191e-05 TGS 2620 Ethanol 6.018 -0.01662 0.9832 -0.0005651 Methane 18.79 -0.01062 6.138 -0.0002136 Hydrogen 3.884 -0.0127 0.8745 -0.0003222

5.2. GAS SENSOR SIMULATION RESULTS

43

Figure 5.7: Upper: input emission rate of ethanol for step strategy. Lower: output of the real and simulated sensors against steps concentration.

44

CHAPTER 5. RESULTS

Figure 5.8: Upper: input emission rate of ethanol for upstairs strategy. Lower: output of the real and simulated sensors against upstairs concentration.

5.2. GAS SENSOR SIMULATION RESULTS

45

Figure 5.9: Upper: input emission rate of ethanol for downstairs strategy. Lower: output of the real and simulated sensors against downstairs concentration.

46

CHAPTER 5. RESULTS

Figure 5.10: Upper: input emission rate of ethanol for random stairway strategy. Lower: output of the real and simulated sensors against random concentration.

5.2. GAS SENSOR SIMULATION RESULTS

47

Figure 5.11: Visualization of simulation where robot bases are crossing the plume perpendicularly for collecting data by using different TGS gas sensors.

48

CHAPTER 5. RESULTS

Figure 5.12: Plots of different sensor responses installed at different hight on the mobile robot bases according to table 5.1. Left: blue plots are the input concentrations to the sensors when they crossed the plume. Right: red plots are the sensor responses. Top: TGS 2611 sensor response. Middle: TGS 2620 sensor response. Bottom: TGS 2600 sensor response.

5.2. GAS SENSOR SIMULATION RESULTS

49

Figure 5.13: Visualization of simulation where robot bases are placed in the way of methane plume for collecting data by using TGS 2611 gas sensors.

Figure 5.14: The figure shows the responses of TGS 2611 sensors installed at different hight on the mobile robot bases according to table 5.1.

Chapter 6

Discussions and summary In this chapter, some of the questions related to this thesis are discussed and finally, summary of thesis is included.

6.1 Discussions 6.1.1

Why ROS (Robot Operating System)?

Developing applications and software for robots is difficult task because the scope of robotics continues to grow. Various types of robots may have verity of hardware architecture which can be an obstacle in code reusability. Moreover, the required bulky code can be a complication, as it must contain huge amount of steps and processes starting from driver-level software and continuing up through perception, abstract reasoning, and many more. Since these all requirements are beyond the capabilities of a single researcher, robotics software architectures must also provide a platform for large-scale software integration. To meet these challenges, ROS framework was created [38]. ROS is a a completely open source (BSD) and free for others to use and change. ROS was designed to meet a specific set of challenges encountered when developing large-scale service robots as part of the STAIR project [37] at Stanford University and the Personal Robots Program [48] at Willow Garage, but the resulting architecture is far more general than the service-robot and mobile-manipulation domains. ROS is more than just a simulation environment; actually, ROS is a complete robot operating system providing messaging framework as well as a means to easily develop and share solutions with other users [35]. ROS (Robot Operating System) provides libraries and tools which help software developers for creating and implementing robot applications. ROS also provides standard operating system services such as; hardware abstraction, device drivers, libraries, visualizers, message-passing, package management, and many more. The library runs primarily on Linux but can also be cross-platform

51

CHAPTER 6. DISCUSSIONS AND SUMMARY

52

for Mac OS X and Windows. Basically, ROS has two “sides”: One is the operating system, as is described above and the other is ros-package, a collection of user contributed nodes that implement functionality such as localization and mapping, planning, perception, simulation etc [13]. In our implementation, a ros stack is implemented which contains packages for simulation of gas dispersal and metal oxide sensor.

6.1.2

PlumeSim an Order Plume Simulator already Exist in ROS. Why another Simulator?

For explanation lets first investigate briefly the PlumeSim package [5] (already exist in ROS) and then Gas Dispersion Simulation (our implementation in ROS); PlumeSim in ROS PlumeSim implements the odor plume simulator as well as the virtual nose for ROS. Odor Plume Simulator PlumeSim [5] is an odor plume simulation package in ROS that is able to generate plumes for simulation or real robots. Current plume sources include: Meandering, based on the meandering algorithm, Gaussian, based on the Gaussian algorithm, Log, which allows to read a log file, enabling the driver to read data from any source previously converted to this format and CFD Fluent, which is similar to the “Log” but is designed specifically to read CFD Fluent log files. Meandering and Gaussian plume models are quick and easy way to get started but, they do not implement realistic odor plume simulation as well as these models will not take obstacles into account. For real like plume generation, ANSYS Fluent CFD is used with developed simulator which not an open source software. Moreover, the simulator works in two dimensions (x,y). Figure 6.1 is the visualization of PlumeSim odor plume simulation generated with Gaussian algorithm. Virtual Nose The plumesim’s virtual nose is capable of sensing odor in two dimensions (x,y). A single virtual nose is installed on a mobile robot base. The virtual nose is not visible in the simulation. Figure 6.2 shows the visualization of odor sensing simulation setup. When odor plume hits the mobile robot base, the virtual nose produces the readings against the odor and publishes these readings. Figur 6.3 is the “rxplot” of the published sensor response. Although, the sensors response of Virtual nose is filtered in order to produce real like response in

6.1. DISCUSSIONS

53

Figure 6.1: Upper:Gaussian plume generated by PlumeSim. Lower: view of Gaussian plume where it is observed that the position at z-axis is constant.

Player/Stage [6], the implementation of Virtual nose in ROS the sensor readings are without any delay in rise/decay time. The “rxplot” shows that the rise and decay time are same and immediate without any time delay. Odor Simulation in ROS Odor Simulation also implements the gas dispersion simulator as well as the simulation of olfaction detection system for ROS. Gas Dispersal Simulation A real like gas dispersion is simulated by using filament-base approach introduced in [8]. The interaction of gas with its surroundings is typically dominated by three physical effects; molecular diffusion, turbulence and advection [36]. Our implementation takes all these effects into account. Gas is simulated as the puffs of filaments. Each filament contains constant number of molecules or articles. At time t, the position of each filament is updated according to the wind flow and stochastic process. For wind flow model, open source OpenFOAM is used. For molecular diffusion, the width of the filament increases while the concentration decreases with the time. Furthermore, the acceleration rates of gases with different densities are also considered for generating more realistic plumes. Gas dispersion is simulated and visualized in three dimensions (x, y, z) taking obstacles into account. The height of the gas source is made adjustable for batter visualization of gases that disperse towards

54

CHAPTER 6. DISCUSSIONS AND SUMMARY

Figure 6.2: Figure shows the odor sensing setup with PlumeSim. Where, round circle represents robot base, red, blue and green line represents the axis. Yellow spheres represent the guassian plume. Robot moves in x-y plane and reads the data.

or away from the ground. Figure 6.4 shows the three dimensional simulation of ethanol gas dispersion. Gas Sensor Model The implemented sensors model is capable of sensing three different chemicals; ethanol, methane and hydrogen by using three different TGS sensors; 2600, 2611 and 2620. The addition of rise and decay time delay in implemented sensors response brings it more near to real sensor response. Three different mobile robot bases are also simulated on which simulated sensors are installed for simultaneous collection of data from different areas of environment. As robot movement is in two dimensions (x, y) the gas sensors are connected with robot through a connector in order to move sensor up/down in z-axis for reading data in three dimensions (x, y, z). Figure 6.6 is the “rxplot” of the TGS 2611 sensor response inside the ethanol plume. From the plots it can be observed that the decay time is greater than the rise time which is more near to real sensor response. Figure 6.5 is the visualization of simulation setup with three robots equipped with gas sensors.

6.1. DISCUSSIONS

55

Figure 6.3: Figure shows the response of the virtual nose when mobile robot is kept steady inside the Gaussian plume. Y-axis is the sensor readiings (ppm), x-axis is the time (s). It can be seen that the sensors response is immediate without any time delay when it is placed inside the plume. The sensor response decays quickly to 0 when the robot is taken out from the plume.

6.1.3

ROS provides the Functionality of Code Reuse-ability, Does this implementation fulfill this functionality?

The stack is implemented in such a way that each package of implementation i.e “Environment”, “Dispersal_Simulation”, “Simulated_MOX” and “Path_Planning” can work independently. Each package is first implemented separately and then communication is established between these packages by using ROS messages and services that is shown in Figure 4.8 for the integrated simulation of the whole stack in order to generate the visualization of whole scenario of gas dispersal and sensing. Let’s discuss the simulation of nodes of each package separate from the other packages of the stack. Figure 6.7 is the generated “rxgraph” of each package that is simulated separately. The “environment” node is working separately and publishing the message “environment visualization”. This message can be subscribed by any other package of ROS which requires this environment simulation. The node “dispersal_simulation” that is also simulated separately from the other nodes of the

56

CHAPTER 6. DISCUSSIONS AND SUMMARY

Figure 6.4: Figure shows 3-D dispersal simulation of ethanol taking obstacle and density of gas into account. Upper: top view of ethanol plume. Lower: side view of ethanol plume. Ethanol is heavier than air therefore its plume reaches to the ground after some time. Change in color from red to yellow shows the increase in width of filaments with time.

stack is publishing a message “dispersion_visualization” that contains the information for simulating the Dispersal_simulation. It can be used in any other environment or it can be used by another sensor model for testing purpose. The node “Simulated_MOX” is publishing two messages for sensor display and sensor response. This node can also work independently form the implemented stack by using these two messages. The simulated gas sensors can be installed on any other mobile robot base for reading data from any other environment. Similarly, the node “Path_planning” can be used by any other package. Figure 6.8 is the visualization of each node simulated separately.

6.1.4

Why Time Constants from Mark III are used for Rise and Decay Time?

Since the rise/decay time constants depends upon different factors such as: sensor type, different sensors of same type and the gas concentration. There-

6.1. DISCUSSIONS

57

Figure 6.5: Figure shows 3-D visualization setup for gas sensor with dispersal simulation. Where, three small squares are robot bases, yellow spheres are the sensors connected with robot via connectors. Sensors on each robot are given various positions in z-axis in order to be able to read data in 3-D environment.

fore, the best estimation of the rise/decay time constants cannot be determined. Moreover, in our implementation we used the response and recovery time that is estimated by Achim Lilienthal in [24] for two reasons; First reason is that, the sensors used in our implementation are similar to their sensors i.e. metal oxide gas sensors. Secondly, in [24], the experiment was conducted using six metal oxide gas sensors and a reasonable estimate of the sensor response is provided by the averaged mean values of the time constants over all the sensors.

6.1.5

What is the Reason for Creating Path_Planning Package?

Basically, the idea behind creating this package is: firstly to test the implementation of gas sensor model in the environment. Robot equipped with gas sensor is moved to different per-defined goal positions in the environment in the presence of gas plume in order to observe the response of gas sensor against gas concentration. Secondly, various mobile olfaction related algorithms such as: gas distribution modeling, sensor planning, plume tracking and gas source localization in 2-d/3-d can be implemented and tested using this package.

CHAPTER 6. DISCUSSIONS AND SUMMARY

58

Figure 6.6: Figure shows the response of the simulated TGS 2611 gas sensor when mobile robot base is kept steady inside the ethanol plume. y-axis is response of the sensor (sensor resistance ratio), x-axis is the time (s). It can be observed the sensor responses with some time delay when it is placed inside the ethanol plume. And it recovers slowly when it is taken out from the plume.

6.1.6

What are the Future Works?

The simulator can be improved by focusing on following possible future works: • In the current version of simulator, each filament contains 9.8 × 10−9 and gas source releases 100 filaments per second. In order to improve simulation would be beneficial to adjust number of molecules in each filament and release rate of filament for different compound in different experiment based on the biological impacts such as being toxic or smell limit. • One limitation of metal oxide gas sensors is their selectivity i.e. they do not respond only to the gas for which they are optimized but also to the other gases. One way to enhance the selectivity of metal oxide gas sensor is to build an electric nose with an array of sensors. Currently, in our package each mobile robot base is equipped with only one gas sensor that can be replaced with array of gas sensors to enhance the selectivity.

6.1. DISCUSSIONS

59

Figure 6.7: rxgraph of each node of package that is working separately. 1: rxgraph of Environment, 2: rxgraph of Dispersal_simulation, 3: rxgraph of Simulated_ MOX

• Considering multiple gas sources with dispersion of different gases in the simulation package can be beneficial for studying more complex situations in gas plume dispersion. • Simulated sensor model can be improved to detect more variety of gases and to provide simulation of verity of sensor types. Currently, simulator can simulate the dispersion of eight different gases and simulated MOX sensors can detect three of them. These simulated sensors can be extended for detecting the other simulated gases. For providing simulation of verity of sensors, implementation of other MOX sensor models as well as the sensors types other than MOX can be included in the simulator. • Sensor rise/decay time depends on several facts, such as sensor model, concentration, chemical and physical properties of the analyte and working temperature. Currently, in our implementation only one factor is considered that is analyte. This can be extended to consider the other factors. • In the developed package, it is assume that the size and the motion of the mobile robot base and sensor did not influence the plume propagation while the robot base moving in the virtual environment. This is not the case in real world especially when the size of the robot is relatively big and travels at higher velocities. Considering the movement of the robot itself and the airflow that it generates by the movement of robot can be one of the future works. • More visualization features such as 3D wind flow visualization can be defined as future works.

60

CHAPTER 6. DISCUSSIONS AND SUMMARY

Figure 6.8: Visualization of each node that is simulated separately, 1: visualization of Environment, 2: visualization of Dispersal_Simulation, 3: visualization of Simulated_MOX, 4: visualization of robot bases. Top right sub-figure indicates the axis where, red: x-axis, green: y-axis, blue: z-axis.

6.2 Summary In this thesis, a stake in ROS is implemented that simulates the gas dispersion as well as the odor detection. Gas dispersal simulation integrates OpenFOAM flow simulation and a filament-based gas propagation model to simulate gas dispersion for compressible flows with a realistic turbulence model. Gas is simulated in the environment as a set of filaments (i = 0, 1, 2, ..., N). Each filament contains constant amount of molecules. Filaments are predefined spherical shaped gas patches. Gas released at a source location is fragmented into intermittent patches of high concentration and mixed with the surroundings due to the effect of turbulent airflow and molecular diffusion. Finally these patches are transported by the advection with the wind. The position of each filament is determined by two steps in 3-dimensional environment. Firstly, the filament position is updated by considering wind factor and stochastic process. Secondly, it was observed that the gases accelerates with different rates and in

6.2. SUMMARY

61

different directions depends upon their density, therefore, acceleration is introduced that affects the position of the filament as well as the plume shape. The simulation of metal oxide gas sensor response is modeled against the concentration received from the gas dispersal simulation. Three models (TGS 2600, TGS 2611 and TGS 2620) are simulated by using their typical sensitivity characteristics. Bi-exponential curve is fitted on the data extracted by this typical sensitivity characteristics. By using the constants estimated by the curve fittings, the equations are built for different models of TGS sensors and different gases. These equations provide the sensor response against the various concentrations. Furthermore, low-pass filtration and rise/decay time estimations are introduced into the simulated sensor response in order to produce real like response. The tests involved in the dispersal simulation are the simulation of various gases such as: the gases which are heavier than air that tends to move downwards such as: ethanol, propanol and acetone etc. And the gases which are lighter than air that tends to move upwards such as: methane, helium and hydrogen, etc. The gas sensor model is tested in different scenarios including constant concentrations in ideal conditions as well as changing concentration in turbulent environment . Finally, some questions related to this thesis are discussed.

Appendix A

Manual for 3-D Gas Dispersal Simulation in ROS A.1 Introduction Odor_Simulation is a stack for ROS that implements the gas dispersion simulator as well as the simulation of olfaction detection system. Odor_Simulation is consists of packages: • Environment: Simulates the environment that contains obstacles, walls and a gas source. • Dispersal simulation: Implements the filament-based gas dispersal simulation. Gases with different densities are simulated such as: ethanol, methane and hydrogen etc. • Simulated_MOX: Is the olfaction detection system that simulates the response of different metal oxide sensors (TGS 2600, TGS 2611 and TGS 2620) to the simulated gas. • Path_Planning: Uses ROS “navigation_stack” to drive robot base from one location to another while safely avoiding obstacles. The reason to create this package is to test the implementation of gas sensor model in the simulated environment and implementation/testing various mobile olfaction related algorithms such as: 2-D/3-D gas source localization and sensor planning etc.

A.2 Getting Started A.2.1

Prerequisites

To start playing with Odor simulator, you have to install ROS, navigation stack of ROS and go through the ROS Tutorials by following links: 63

64 APPENDIX A. MANUAL FOR 3-D GAS DISPERSAL SIMULATION IN ROS

1- ROS installation: http://www.ros.org/wiki/ROS/Installation 2- Navigation stack: http://www.ros.org/wiki/navigation 3- ROS tutorials: http://www.ros.org/wiki/ROS/Tutorials

A.2.2

Downloading Odor Simulation

Download the odor_simulation package in the ROS_PACKAGE_PATH directory from the following link: http:// vs.aass.oru.se/viewv /viewv . gi/svn/DistributionMapping/ OdorSimulatorInROS/odor_simulation/

A.2.3

Installing Odor Simulation

For installing Odor_Simulation, let’s compile it by using rosmake. Open a new terminal window and execute the following command: rosmake odor_Simulation

A.2.4

Executing Odor Simulation

Let’s run and test the simulator step by step. Roscore and rviz For launching roscore and rviz, open a new terminal tab and got to the directory: ros d odor_simulation/environment/sr /navigation_ stage/laun h Now copy/paste the following command: roslaun h move_base_multi_robot.laun h For configurations in rviz, go to file menu than open config. Open a Environment.vcg file which is placed at: /odor_simulation/environment Environment For visualizing the simulation of environment, open a new terminal tab and go to the directory:

A.2. GETTING STARTED

65

Figure A.1: Visualization of environment Simulation in rviz Where, blue colored walls are boundaries of environment, green boxes are obstacles, three small squares are robots and green pipe is a gas source. Yellow colored spheres are the sensors and cylindrical lines connecting robot with sensors are connectors for moving sensors up and down in z-axis.

ros d odor_simulation/environment Copy/paste the following command: rosrun environment environment Enter the source height for simulation (0-5 meters). Figure A.1 is the environment visualization that will appear in rviz. Simulated_MOX For visualizing the simulation of Simulated_MOX, open a new terminal tab and go to the directory: ros d odor_simulation/simulated_MOX/bin Copy/paste the following command: rosrun simulated_MOX simulated_MOX Enter the desired heights of three MOX gas sensros which are installed on three different mobile robot bases (0-5 meters) and their sensor model (i.e. TGS 2600, TGS 2611 and TGS 2620,). Figure A.2 is the visualization of three MOX gas

66 APPENDIX A. MANUAL FOR 3-D GAS DISPERSAL SIMULATION IN ROS

Figure A.2: Visualization of three MOX gas sensors installed on three different mobile robot bases.

sensors that will appear in rviz. For visualizing the MOX gas sensor readings in rxplot, open a new terminal tab and copy/paste the following command: rxplot sensor_readings/r0_val sensor_readings/r1_val sensor_re adings/r2_val -p 300 Figure A.3 is the rxplot of a MOX gas sensor response. Path_Planning For visualizing the simulation of Path planning, open a new terminal tab and go to the directory: ros d odor_simulation/path_planning/bin Copy/paste the following command: rosrun path_planning plan Three robots will start moving towards their way points. Dispersion_Simulation For visualizing the simulation of gas dispersion, open a new terminal tab and go to the directory: ros d odor_simulation/dispersion_simulation/bin Copy/paste the following command:

A.2. GETTING STARTED

67

Figure A.3: rxplot of a MOX gas sensor response.

rosrun dispersion_simulation odorsimulation Enter the desired gas for simulation (0-9) . In rviz something like Figure A.4 will appear which is the visualization of dispersal simulation. (additional: if you wish to visualize the concentration levels of plume or growth of filaments just uncomment the functions: “color_concentration” and “color_width” in “main.cpp” file). Stageros In order to visualize the simulation in 2-D and drag the mobile robot bases by clicking on them, stageros is used. Open a new terminal tab and go to the directory: ros d odor_simulation/environment/sr /navigation_stage/stage_

onfig/worlds Copy/paste the following command: rosrun stage stageros willow-pr2-multi.world

68 APPENDIX A. MANUAL FOR 3-D GAS DISPERSAL SIMULATION IN ROS

Figure A.4: Visualization of gas dispersion simulation in rviz.

Now you can click on the mobile robot bases and drag them inside/outside the plume to visualize the response of the MOX gas sensors.

References [1] The openfoam foundation. http://www.openfoam.org. (Cited on page 6.) [2] R Andrew Russell. Chemical source location and the robomole project. In Intelligent Robotics research Centre. Monash University, Clayton. VIC 3800, AUSTRALIA, 2003. (Cited on page 33.) [3] D. ben Avraham and S. Havlin. Diffusion and Reactions in Fractals and Disordered Systems. Cambridge University Press. (Cited on page 5.) [4] K. Faust J. Foote T. Gerkey B. Leibs J. Quigley M. Wheeler R. Berger, E. Conley. ROS Documentation: http://www.ros.org. (Cited on page 19.) [5] G. Cabrita and P. Sousa. http://www.ros.org/wiki/plumesim. (Cited on page 52.)

Plumesim.

[6] P. Cabrita, G. Sousa and L. Marques. Plumesim - player/stage plume simulator. In ICRA 2010 Workshop for Networked and Mobile Robot Olfaction in Natural, Dynamic Environments, 2010. (Cited on pages 1, 2, 5, 12, and 53.) [7] E.M Eppstein. navigation stage. http://www.ros.org/wiki/navigation_stage. (Cited on page 24.) [8] Jay A. Farrell, J. Murlis, X Long, W Li, and Ring T. Carde. Filamentbased atmospheric dispersion model to achieve short time-scale structure of odor plumes. Environmental Fluid Mechanics, 2(1):143–169, 2002. (Cited on pages 3, 5, 6, and 53.) [9] Y. Fukazawa, Trincavelli, M. Wada, and H. Ishida. Experimental session with olfactory display. December 4, 2009. (Cited on pages 33 and 39.) [10] J.W. Gardner and J.E. Taylor. Novel convolution-based signal processing techniques for an artificial olfactory mucosa. Sensors Journal, IEEE, 9(8):929 –935, 2009. (Cited on page 1.) 69

70

REFERENCES

[11] William K. George. What is turbulence. http://www. fd-online. om. (Cited on page 5.)

CFD

Online:

[12] K. Gramoll. Fluid mechanics theory. Online Engineering Course Management System https://e ourses.ou.edu. (Cited on page 8.) [13] Webots User Guide. Copyright 2011 cyberbotics http://www. yberboti s. om, 2011. (Cited on page 52.)

ltd.

[14] k. Ihokura and J. Watson. The stannic oxide gas sensor. Sensor Review, 14(1):20 – 23, 1994. (Cited on page 11.) [15] Figro Engineering Inc. General information for tgs sensors. http://www.figarosensor. om/produ ts/ ommon%281104%29.pdf. (Cited on pages 40 and 41.) [16] H. Ishid, T. Nakamoto, T. Moriizumi, T. Kikas, and J. Janata. Plumetracking robots: a new application of chemical sensors. The Biological Bulletin, 200(2):222 – 226, 2001. (Cited on page 33.) [17] H. Ishida, K. Yoshikawa, and T. Moriizumi. Three-dimensional gas-plume tracking using gas sensors and ultrasonic anemometer. In Sensors, 2004. Proceedings of IEEE, pages 1175 – 1178 vol.3, 2004. (Cited on page 2.) [18] Charles W Fay IV. Physics 241: Laboratory manual. Department of Physical Science, Ferris state university http://myhomepage.ferris.edu/~fay 1/ ontent/P241_Labs/P241_Lab.pdf. (Cited on page 7.) [19] J.janta. Principles of Chemical Sensors. Springer-Verlag New York Inc., 2009. (Cited on page 11.) [20] C. Kelley. Iterative methods for optimization. In SIAM Frontiers in Applied Mathematics, 1999. (Cited on page 13.) [21] S. Koenig and Y. Liu. Sensor planning with non-linear utility functions. In Proceedings of the 5th European Conference on Planning: Recent Advances in AI Planning, pages 265 – 277, 2000. (Cited on page 5.) [22] V. Kumar, D. Rus, and S. Singh. Robot and sensor networks for first responders. Pervasive Computing, IEEE, 3(4):24 – 33, 2004. (Cited on page 1.) [23] A. Lilienthal and T. Duckett. Creating gas concentration gridmaps with a mobile robot. In Intelligent Robots and Systems, 2003. (IROS 2003). Proceedings. 2003 IEEE/RSJ International Conference on, pages 118 – 123, 2003. (Cited on page 33.)

REFERENCES

71

[24] A. Lilienthal and T. Duckett. A stereo electronic nose for a mobile inspection robot. In Robotic Sensing, 2003. ROSE’ 03. 1st International Workshop on, page 6, 2003. (Cited on pages 12, 16, 33, and 57.) [25] A. Lilienthal, A. Loutfi, J. L. Blanco, C. Galindo, and J. Gonzalez. Integrating slam into gas distribution mapping. In Proceedings of ICRA Workshop on Robotic Olfaction : Towards Real Applications. ICRA 2007 - Rome Italy, pages 21 – 28, 2007. (Cited on page 33.) [26] A. Lilienthal, A. Loutfi, and T. Duckett. Airborne chemical sensing with mobile robots. Sensors, 6:1616 – 1678, 2006. (Cited on page 1.) [27] A. Lilienthal, D. Reimann, and A. Zell. Gas source tracing with a mobile robot using an adapted moth strategy. In in Proceedings of Autonomous Mobile Systems, pages 150 – 160, 2003. (Cited on page 2.) [28] A. Lilienthal, H. Ulmer, H. Frohlich, A. Stutzle, F. Werner, and A. Zell. Gas source declaration with a mobile robot. In Robotics and Automation, 2004. Proceedings. ICRA ’04. 2004 IEEE International Conference on, pages 1430 – 1435 Vol.2, 2004. (Cited on page 34.) [29] A. Lilienthal, A. Loutfi and T. Duckett. Airborne chemical sensing with mobile robots. Sensors, 6(11):1616–1678, 2006. (Cited on page 11.) [30] Z. Liu. Odour source localization using multiple plume-tracing mobile robots. PhD thesis, School of Mechanical Engineering, 2010. (Cited on page 2.) [31] T Lochmatter. Bio-Inspired and Probabilistic Algorithms for Distributed Odor Source Localization using Mobile Robots. PhD thesis, Ëcole Poly Technique Federale de Lausanne (EPFL), 2009. (Cited on page 5.) [32] A. Loutfi, S. Coradeschi, A. Lilienthal, and J. Gonzalez. Gas distribution mapping of multiple odour sources using a mobile robot. Robotica, 27(2):311 – 319, 2009. (Cited on page 33.) [33] E.M. Maintained by Eppstein. navigation stack. http://www.ros.org/wiki/navigation. (Cited on pages 23 and 31.) [34] L. Marques, A. Martins, and A. de Almeida. Environmental monitoring with mobile robots. In Intelligent Robots and Systems, 2005. (IROS 2005). 2005 IEEE/RSJ International Conference on, pages 3624 – 3629, 2005. (Cited on page 1.) [35] B. McCafferty. Simulation environments for mobile robotics. http://www.sharproboti a. om. (Cited on pages 2 and 51.)

72

REFERENCES

[36] S. Pashami, S. Asadi and A. Lilienthal. Integration of openfoam flow simulation and filament-based gas propagation models for gas dispersion simulation. In Proceedings of the Open Source CFD International Conference, 2010. (Cited on pages 2, 3, 4, 5, 6, and 53.) [37] E. Quigley, M. Berger and A. Ng. Stair: Hardware and software architecture. In in AAAI 2007 Robotics Workshop, Vancouver, B.C, 2007. (Cited on pages 2 and 51.) [38] M. Quigley, K. Conley, B. Gerkey, J. Faust, T. Foote, L. Jeremy, R. Wheeler, and A. Ng. Ros: an open-source robot operating system. In ICRA Workshop on Open Source Software, 2009. (Cited on page 51.) [39] Y. Rachkov, L. Marques, and A. de Almeida. Multisensor demining robot. Autonomous Robots, 18(3):275–291, 2005. (Cited on page 1.) [40] Roberts, P. J. W, Webster, and D. R. Turbulent diffusion. In Environmental Fluid Mechanics - Theories and Application, pages 7–47. In H. Shen, A. Cheng,K.-H. Wang, M.H. Teng, and C. Liu (Ed.), 2002. (Cited on page 6.) [41] A. Sedra and K. Smith. Microelectronic Circuits. Saunders College Publishing, 1991. (Cited on page 14.) [42] Data sheet. Tgs 2620 for the detection of solvent vapors. Figro Engineering Inc http://www.figarosensor. om/produ ts/2620pdf.pdf. (Cited on page 13.) [43] S. Suthan. Remediation engineering: design concepts. CRC Press, 1997. (Cited on page 6.) [44] C. Townsend and R. Maynard. Effects on health of prolonged exposure to low concentrations of carbon monoxide. Sensors, 59(10):708–711, 2002. (Cited on page 1.) [45] M. Trincavelli. Gas Discrimination for Mobile Robots. PhD thesis, Örebro University, School of Science and Technology, 2010. (Cited on page 11.) [46] M. Trincavelli, S. Coradeschi, and A. Loutfi. Classification of odours with mobile robots based on transient response. In IROS’08, pages 4110– 4115, 2008. (Cited on page 5.) [47] M. Trincavelli, S. Coradeschi, and A. Loutfi. Odour classification system for continuous monitoring applications. Sensors and Actuators B: Chemical, 139(2):265 – 273, 2009. (Cited on pages 14 and 16.)

REFERENCES

73

[48] K. Wyrobek, E. Berger, H Van der Loos, and J. Salisbury. Towards a personal robotics development platform: Rationale and design of an intrinsically safe personal robot. In Robotics and Automation, 2008. ICRA 2008. IEEE International Conference on, pages 2165 –2170, 2008. (Cited on pages 2 and 51.) [49] S. Zhang, C Xie, H. Li, Z. Bai, X. Xia, and D. Zeng. A reaction model of metal oxide gas sensors and a recognition method by pattern matching. Sensors and Actuators B: Chemical, 135(2):552 – 559, 2009. (Cited on page 11.)