Skip to content

ROS2_Environment

Junichi Tokuda edited this page Sep 28, 2021 · 2 revisions

Setting Up ROS Environment for Tutorial

Prerequisite

In this tutorial, we will use ROS Foxy, which supports Ubuntu Linux (Focal Fossa -20.04) 64-bit and Debian Linux (Buster - 10) 64-bit. It also supports other operating systems, but the installation on those operating systems is not as straightforward as on the Linux environment. See Installation page for detail.

[Option 1] Installing ROS using Docker

Docker must be installed prior to the installation. To install the Docker image for the tutorial, open the terminal and run the following command:

sudo docker pull rosmed/docker-ros2-igtl
sudo docker run -it --rm -p 6080:80 -p 28944:18944 rosmed/docker-ros-igtl

In this example, the HTTP port (port 80) and the OpenIGTLink port (port 18944) on the docker container are mapped to ports 6080 and 28944 on the host computer respectively. The '--rm' option will remove the container upon termination.

To access the desktop, open a web browser (compatible with HTML5) on the same computer, and type the following address in the address bar:

http://localhost:6080

If the Docker image container is successfully running, the browser should show the desktop screen.

This docker image includes all the software required for the tutorial and does not require installing other packages (i.e. OpenIGTLink and ROS-IGTL-Bridge)

[Option 2] Installing ROS on Dedicated ROS Computer

Installing ROS Foxy

Please follow Installation page.

Building OpenIGTLink

ROS-IGTL-Bridge depends on the OpenIGTLink library. We install the source files of the libary under ~/igtl/OpenIGTLink and build files under ~/igtl/OpenIGTLink-build

cd ~
mkdir igtl
cd igtl
git clone https://github.com/openigtlink/OpenIGTLink.git
mkdir OpenIGTLink-build
cd OpenIGTLink-build
cmake -DBUILD_SHARED_LIBS:BOOL=ON ../OpenIGTLink
make

Installing ROS-IGTL-Bridge

First, set up catkin working directory (if it has not been set up). We will use the standard ROS workspace "catkin_ws". If you already have an existing one, we recommend you to move it elsewhere for the duration of this tutorial with

mv ~/catkin_ws ~/catkin_ws_old

Then, go ahead and create a clean workspace with

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin_make
source devel/setup.bash

Then obtain the code from the github repository:

cd ~/catkin_ws/src
git clone https://github.com/openigtlink/ROS-IGTL-Bridge

To build the ROS-IGTL-Bridge, run

cd ~/catkin_ws/
catkin_make --cmake-args -DOpenIGTLink_DIR:PATH=~/igtl/OpenIGTLink-build