Autonomous robot for room mapping.
- It is advised that you have working knowledge of ROS (Robot Operating Systems).
In order to set up a brand new Nvidia Jetson TX2, use the NVIDIA Jetpack SDK to install the required OS image and tools. Follow the links below for more informations:
- NVIDIA Jetson develpoer kit User Guide. This link might require NVIDIA Developer Program access.
- NVIDIA Jetpack 3.2.1 Introduction. This also containes the list of libraries and tools included in the bundle.
- NVIDIA Jetpack 3.2.1 Installation Guide
Download and install the ZED SDK for your device. The downloaded file is basically a script.
Run chmod +x {Name of the Downloaded Script}
Next, run ./{Name of the Downloaded Script}
E.g: chmod +x ZED_SDK_Linux_JTX2_JP3.2_v2.4.0.run
./ZED_SDK_Linux_JTX2_JP3.2_v2.4.0.run
Once installed, plug in the ZED Camera and run the sample apps or diagnostics to check if your camera is working properly.
Note: The ZED Camera requires a high bandwidth and works only on USB 3.0 . If you are using a hub with your Jetson TX2, you might want to use a powered one if you plan to connect the camera through the hub.
- Installing ROS on TX2 is very straight forward. Follow this link for installing ROS Kinetic. Or follow this link for other distributions.
- After installing ROS, there are some Network Setup configurations that need to be done.
- Once ROS is installed, we will install the
zed-ros-wrapper
which as the name suggests, is a ROS wrapper for the ZED SDK. This allows us to seamlessly use the ZED camera with ROS. Follow this link for installing the wrapper.
Note:
- If you want to use the code given in this repo, you need not download the
zed-ros-wrapper
separately. The modified wrapper is included in this repo. - Make sure that you run command
source /opt/ros/kinetic/setup.bash
before using ROS. (The ROS setup path. This is the default path if you install through apt-get) - It is advisable to add the above command to
.bashrc
for convenience.
Follow this link to set up options on TX2. You can now use VNC client, TigerVNC etc. to connect to the TX2 remotely.
Note: You need to be on the same network.
- gmapping
- depthimage_to_laserscan
- zed-ros-wrapper (included in this repo)
- frontier-exploration (not used in the demo but included in this repo. Can modify to use this package instead)
- explore_lite (included in this repo)
- turtlebot_navigation (included in this repo)
You will need to install the packages that are not included. Run the following commands to install through apt-get
:
sudo apt-get install ros-kinetic-gmapping
sudo apt-get install ros-kinetic-depthimage_to_laserscan
Note:
- You can also install them as catkin packages. See catkin workspaces
- The above commands are for ROS kinetic. Modify them according to your distribution.
All the ROS packages in this repo have to be installed through catkin. First, set up a catkin workspace.
Run command mkdir -p ~/catkin_ws/src
Next run cd ~/catkin_ws
Finally, run catkin_make
Before continuing, source your new setup.*sh file.
source devel/setup.bash
(You can also add the command source ~/catkin_ws/devel/setup.bash
to ~/.bashrc
)
Note: catkin is installed by default when installing ROS. If not then follow this link. More information regarding creating catkin workspaces can be found here.
Next clone this repository.
cd ~
git clone {Link of this repository}
Now copy all folders except the images folder to ~/catkin_ws/src
Next, run cd ~/catkin_ws
followed by catkin_make
The ROS packages will now be installed.
Note:
Make sure that ~/catkin_ws/devel/setup.bash
is sourced before running the bot.
Once everything is set up, follow the steps below:
- Open terminal on the TX2, and run
roslaunch zed_wrapper zed.launch
This ROS launch files typically launches the ZED camera. However, if you download the package from this repo, this file has been modified to bringup kobuki, launch the camera, convert depth image data to laserscan and launch gmapping. - Next, in a different tab, run
roslaunch turtlebot_navigation move_base_standalone.launch
This brings up the navigation stack. - Finally, on a third tab run
roslaunch explore_lite explore_tqb.launch
This launches the frontier exploration node and the bot will start moving and explore the area automatically.
Note:
- You can view the exploration and the maps generated through
rviz
. Runrosrun rviz rviz
in a new tab to open rviz. You need to add the required elements to view them on rviz. - You can run the above commands on the TX2 itself either through desktop sharing or SSH.
rviz
however will not work on SSH because it is GUI based. - You can also run these commands through a remote PC. Follow this link for more info. The tutorial in for ROS Indigo but works for later versions as well.
- More info on ROS launch files