ROS is a set of well-engineered software libraries for building robotics applications. It includes a wide variety of packages, from low level drivers to efficient implementations of state of the art algorithms. As we strive to build intelligent agents and transfer them to real-world (on a real robot), we need to take advantage of ROS packages to complete the robot application pipeline.
There are three key applications of integrating iGibson with ROS.
Benchmark existing algorithms in a controlled realistic simulation environment. And this allows comparing learning-based methods with traditional methods in simulation environments.
Comparing robot in simulation with robot in real world. In simulation, iGibson can simulate sensors of a robot and publish as messages. In the real world, a real robot publish sensor messages. So it is possible to only change the message subscribed and benchmark the performance of downstream applications. This helps locating domain gap and debugging algorithms.
Using ROS functions in simulation, such as many motion planning implementations.
The possibility of using iGibson with ROS is unlimited. As a starter, we provide an example of integrating iGibson with ROS for navigation. This is a ros package integrates iGibson Env with ros navigation stack. It follows the same node topology and topics as
turtlebot_navigation package. As shown below, so after a policy is trained in iGibson, it requires minimal changes to deploy onto a turtlebot.
Here is all the steps you need to perform to install gibson and ros. Note that here you will need to install using
pip install -e . and use python2.7. If you did it differntly when installing iGibson, you will need to do it again. python3 is known to not being able to work with ros.
Install ROS: in this package, we use navigation stack from ros kinetic. Please follow the instructions.
Install iGibson from source following installation guide in python2.7. However, as ROS only supports
python2.7at the moment, you need to create python2.7 virtual environment instead of python3.x.
If you use annaconda for setting up python environment, some tweaks of
PYTHONPATHvariable are required to avoid conflict. In particular:
PATH: conda related needs to be removed from
echo $PATH | grep -oP "[^:;]+" | grep conda ## Remove these paths from $PATH
/opt/ros/kinetic/lib/python2.7/dist-packages(ros python libraries),
<anaconda installation root>/anaconda2/envs/py27/lib/python2.7/site-packages(gibson dependencies) and
<gibson root>need to be in
Copy (or soft link) gibson-ros folder to your
catkin_ws/srcand run catkin_make to index gibson-ros package.
ln -s $PWD/examples/ros/gibson-ros/ ~/catkin_ws/src/ cd ~/catkin_ws && catkin_make && cd -
rosdep install gibson2-ros
which python #should give /usr/bin/python python -c 'import gibson2, rospy, rospkg' #you should be able to do those without errors.
In order to run gibson+ros examples, you will need to perform the following steps:
Prepare ROS environment
source /opt/ros/kinetic/setup.bash source <catkin-workspace-root>/catkin_ws/devel/setup.bash
Repeat step 3 from Preparation, sanitize
Here are some of the examples that you can run, including gmapping, hector mapping and navigation.
roslaunch gibson2-ros turtlebot_rgbd.launch #Bare minimal bringup example roslaunch gibson2-ros turtlebot_gmapping.launch #Run gmapping roslaunch gibson2-ros turtlebot_hector_mapping.launch #Run hector mapping roslaunch gibson2-ros turtlebot_navigation.launch #Run the navigation stack, we have provided the map roslaunch gibson2-ros turtlebot_gt_navigation.launch #Run the navigation stack with ground truth localization
The following screenshot is captured when running the bare minimal bringup example.
The following screenshot is captured when running the gmapping example.
Here are all the topics that
turtlebot_rgbd.py publishes and subscribes.
||Camera parameters used in iGibson, same for depth and rgb|
||RGB image captured in iGibson|
||depth image captured in iGibson, in meters, with dtype being float32|
||depth image captured in iGibson, mimic raw depth data captured with OpenNI cameras, with dtype being uint16, see more here|
||Velocity command for turtlebot,