Size: 5899
Comment:
|
← Revision 22 as of 2013-04-16 14:07:26 ⇥
Size: 6011
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
## page was renamed from plumesim/Tutorials/Using PlumeSim with virtual_nose | ## page was renamed from virtualplume/Tutorials/Using VirtualPlume with virtual_nose |
Line 10: | Line 10: |
## note.0= [[plumesim/Tutorials/Download and install PlumeSim | Download and install PlumeSim]] | ## note.0= [[virtualplume/Tutorials/Download and install VirtualPlume | Download and install VirtualPlume]] |
Line 12: | Line 12: |
## title = Using PlumeSim with virtual_nose | ## title = Using VirtualPlume with virtual_nose |
Line 14: | Line 14: |
## description = This tutorial teaches how to use [[virtual_nose]] with !PlumeSim to simulate a virtual nose. | ## description = This tutorial teaches how to use [[virtual_nose]] with !VirtualPlume to simulate a virtual nose. |
Line 22: | Line 22: |
## keywords = !PlumeSim, Nose | ## keywords = !VirtualPlume, Nose |
Line 35: | Line 35: |
3. Now rosmake the virtual_nose package. It's assumed that you did the previous tutorial, so you have [[plumesim]] and [[lse_messages]] installed. | 3. Now rosmake the virtual_nose package. It's assumed that you did the previous tutorial, so you have [[virtualplume]] and [[lse_messages]] installed. |
Line 40: | Line 40: |
=== Running PlumeSim and virtual_nose === | === Running VirtualPlume and virtual_nose === |
Line 49: | Line 49: |
Before you can run plumesim or virtual_nose you need to have a robot. In this tutorial you will use a simulated robot on [[stage]], however you can also run a simulated plume on a real robot, avoiding the hassle of releasing chemicals all over your lab when experimenting with odor related algorithms! | Before you can run virtualplume or virtual_nose you need to have a robot. In this tutorial you will use a simulated robot on [[stage]], however you can also run a simulated plume on a real robot, avoiding the hassle of releasing chemicals all over your lab when experimenting with odor related algorithms! |
Line 59: | Line 59: |
Now that you have a robot you should run the navigation stack to allow the robot to move autonomously. Furthermore !PlumeSim requires a global frame_id on which to publish the plume, since the default frame is /map we'll be using [[map_server]] to give us a map. While we're at it we will use [[move_base]] for navigation and [[amcl]] for localization. Open a new terminal window and run the following command: | Now that you have a robot you should run the navigation stack to allow the robot to move autonomously. Furthermore !VirtualPlume requires a global frame_id on which to publish the plume, since the default frame is /map we'll be using [[map_server]] to give us a map. While we're at it we will use [[move_base]] for navigation and [[amcl]] for localization. Open a new terminal window and run the following command: |
Line 64: | Line 64: |
==== PlumeSim and virtual_nose ==== !PlumeSim and virtual_nose are all that is missing. !PlumeSim will provide you with a simulated chemical plume while virtual_nose will mimic a chemical sensor. Let's take a look at the plumesim.launch file: |
==== VirtualPlume and virtual_nose ==== !VirtualPlume and virtual_nose are all that is missing. !VirtualPlume will provide you with a simulated chemical plume while virtual_nose will mimic a chemical sensor. Let's take a look at the virtualplume.launch file: |
Line 68: | Line 68: |
<rosparam file="$(find plumesim)/settings/gaussian_settings.yaml" command="load" /> <node pkg="plumesim" type="plumesim" name="plumesim" /> |
<rosparam file="$(find virtualplume)/settings/gaussian_settings.yaml" command="load" /> <node pkg="virtualplume" type="virtualplume" name="virtualplume" /> |
Line 76: | Line 76: |
Notice that before plumesim is started a yaml file is loaded into the parameter server, containing the necessary parameters to generate a gaussian plume. If no plume type is defined plumesim will give a fatal error upon startup. | Notice that before virtualplume is started a yaml file is loaded into the parameter server, containing the necessary parameters to generate a gaussian plume. If no plume type is defined virtualplume will give a fatal error upon startup. |
Line 78: | Line 78: |
After loading the gaussian parameters plumesim is started followed by virtual_nose. | After loading the gaussian parameters virtualplume is started followed by virtual_nose. |
Line 89: | Line 89: |
All the navigation related elements are already present. However you need to add the plume. Press the Add button and select Markers. On the marker topic select plumesim -> plumesim_markers. You should now see something similar to the picture below. | All the navigation related elements are already present. However you need to add the plume. Press the Add button and select Markers. On the marker topic select virtualplume -> virtualplume_markers. You should now see something similar to the picture below. |
Line 98: | Line 98: |
{{attachment:rxplot_plumesim.png}} | {{attachment:rxplot_virtualplume.png}} |
Line 102: | Line 102: |
Keep in mind that !PlumeSim provides Gaussian and Meandering plumes as a quick and easy way to get started. These will not take obstacles into account, neither do they provide realistic chemical plume simulations. For that you should use [[http://en.wikipedia.org/wiki/Computational_fluid_dynamics | CFD]] software such as [[http://www.ansys.com/ | ANSYS]] Fluent. !PlumeSim accepts Fluent log files and plays them back in ROS. You can also use a PSLog file containing data from your choice of [[http://en.wikipedia.org/wiki/Computational_fluid_dynamics | CFD]] software, your own plume generation algorithms or even from a recorded plume using a chemical sensor network. | Keep in mind that !VirtualPlume provides Gaussian and Meandering plumes as a quick and easy way to get started. These will not take obstacles into account, neither do they provide realistic chemical plume simulations. For that you should use [[http://en.wikipedia.org/wiki/Computational_fluid_dynamics | CFD]] software such as [[http://www.ansys.com/ | ANSYS]] Fluent. !VirtualPlume accepts Fluent log files and plays them back in ROS. You can also use a PSLog file containing data from your choice of [[http://en.wikipedia.org/wiki/Computational_fluid_dynamics | CFD]] software, your own plume generation algorithms or even from a recorded plume using a chemical sensor network. |
Note: This tutorial assumes that you have completed the previous tutorials: Download and install VirtualPlume. |
![]() |
Using VirtualPlume with virtual_nose
Description: This tutorial teaches how to use virtual_nose with VirtualPlume to simulate a virtual nose.Keywords: VirtualPlume, Nose
Tutorial Level: BEGINNER
Contents
Download virtual_nose
1. Open a terminal window and cd into a directory that is on your ROS_PACKAGE_PATH. Checkout virtual_nose using svn:
svn co http://isr-uc-ros-pkg.googlecode.com/svn/trunk/unstable/odor_tools
3. Now rosmake the virtual_nose package. It's assumed that you did the previous tutorial, so you have virtualplume and lse_messages installed.
rosmake virtual_nose
Running VirtualPlume and virtual_nose
Let's start by changing directory into the virtual_nose package and then into the example directory.
roscd virtual_nose cd example
Simulating a robot on stage
Before you can run virtualplume or virtual_nose you need to have a robot. In this tutorial you will use a simulated robot on stage, however you can also run a simulated plume on a real robot, avoiding the hassle of releasing chemicals all over your lab when experimenting with odor related algorithms!
Start a roscore and open a new terminal window to run stage. Running stage and the navigation stack is out of the scope of this tutorial. For more information on that please refer to the stage and navigation tutorials.
rosrun stage stageros roomba.world
You should now see a small arena with a Roomba robot on stage.
Now that you have a robot you should run the navigation stack to allow the robot to move autonomously. Furthermore VirtualPlume requires a global frame_id on which to publish the plume, since the default frame is /map we'll be using map_server to give us a map. While we're at it we will use move_base for navigation and amcl for localization. Open a new terminal window and run the following command:
roslaunch move_base.launch
VirtualPlume and virtual_nose
VirtualPlume and virtual_nose are all that is missing. VirtualPlume will provide you with a simulated chemical plume while virtual_nose will mimic a chemical sensor. Let's take a look at the virtualplume.launch file:
<launch> <rosparam file="$(find virtualplume)/settings/gaussian_settings.yaml" command="load" /> <node pkg="virtualplume" type="virtualplume" name="virtualplume" /> <node pkg="virtual_nose" type="virtual_nose_node" name="virtual_nose_node" /> </launch>
Notice that before virtualplume is started a yaml file is loaded into the parameter server, containing the necessary parameters to generate a gaussian plume. If no plume type is defined virtualplume will give a fatal error upon startup.
After loading the gaussian parameters virtualplume is started followed by virtual_nose.
Viewing the result
All you need now is rviz to see the plume! Open another terminal window and run rviz:
rosrun rviz rviz
From the menu select File -> Open Config, or press Ctrl+O. Find your way into virtual_nose/example and chose the example.vcg file. You should now be able to see something similar to the picture below.
All the navigation related elements are already present. However you need to add the plume. Press the Add button and select Markers. On the marker topic select virtualplume -> virtualplume_markers. You should now see something similar to the picture below.
If you run a rostopic list command you will notice a /nose topic. This is where virtual_nose is publishing the lse_sensor_msgs/Nostril messages. Open a rxplot window with the virtual_nose readings:
rxplot /nose/reading
Now send the robot somewhere on the arena (using the 2D Nav Goal button in rviz) so that it will cross the plume and watch as the plot varies.
Congratulations! You now know how to generate simulated plumes in ROS and use them with your robot!
Keep in mind that VirtualPlume provides Gaussian and Meandering plumes as a quick and easy way to get started. These will not take obstacles into account, neither do they provide realistic chemical plume simulations. For that you should use CFD software such as ANSYS Fluent. VirtualPlume accepts Fluent log files and plays them back in ROS. You can also use a PSLog file containing data from your choice of CFD software, your own plume generation algorithms or even from a recorded plume using a chemical sensor network.