- Install Docker CE, see installation instructions.
- Also perform the post installation instructions, so that docker can be run without requiring root privileges by a non-root user. (this is optional, otherwise, scripts must be run as root)
- (optional) If you have an NVIDIA graphic card, install the latest drivers.
-
Recommended method:
sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update
Then, on Ubuntu from the menu / Dash, click on the "Additional Drivers" and on the tab with the same name, select the driver you want to use, and "Apply changes". Wait until the driver is downloaded and installed, and reboot.
- (optional) If you have an NVIDIA graphic card and Ubuntu 16.04, install nvidia-docker 1.0. See installation instructions. If you are on Ubuntu 14.04, you can install nvidia-docker following the instructions here, see "Ubuntu distributions" instructions.
- Also install nvidia-modprobe by running
sudo apt-get install nvidia-modprobe
, a reboot may be required.
mkdir ~/Projects
cd ~/Projects
git clone https://github.com/eaa3/turtle2i_docker
cd turtle2i_docker
docker build . -t turtle
Outside docker (in the host machine), follow the steps:
./fetch_packages.sh
- Quick script to build packages:
./build_turtle.sh turtle
(Manual option) You must run the following commands inside the docker container with the pre-installed dependencies. To start the docker container you can run:
cd ~/Projects/turtle2i_docker
- Run the container:
./bash.sh turtle
- Setup ROS:
source /opt/ros/kinetic/setup.bash
catkin_make
- Source the catkin workspace:
source devel/setup.bash
(Step 1 will create a container, open a bash terminal with all required setup, including mapping turtlebot2i folder and the needed visualisation configuration inside the docker)
Ps.: You can open other terminals inside the same container by running the script inside turtle2i_docker ./exec_container $(./get_containerId.sh)
on a separate terminal.
After building successfully. Run the following command in a terminal inside the turtle docker container:
-
Run the container:
./bash.sh turtle
-
roslaunch turtlebot2i_gazebo turtlebot_world.launch
(don't forget to source devel/setup.bash beforehand in every terminal you open inside the turtle docker container)
-
Example 1: rostopic pub -1 /turtlebot/arm_shoulder_pan_position_controller/command std_msgs/Float64 "data: 0.4"
-
Example 2: rostopic pub -1 /turtlebot/arm_elbow_flex_position_controller/command std_msgs/Float64 "data: 1.4"
The arm should move around in simulation.