Skip to content

Latest commit

 

History

History
271 lines (201 loc) · 9.17 KB

README.md

File metadata and controls

271 lines (201 loc) · 9.17 KB
Service Status
Docker Image Docker Hub
Code Style Checks CircleCI
Unit Tests Build Status
Install Tests Build Status
Code Coverage Coverage Badge

leobot

LeoBot

LeoBot telepresence robot

License

Linux

Docker

For convenience it is recommended to use Docker containers. Please follow these steps to run Docker container on your machine.

  1. Install Desktop OS Ubuntu Trusty or Xenial on your machine or in virtual machine
  2. Install Docker-CE using these instructions
  3. In order to executed Docker without sudo please execute
sudo usermod -aG docker $USER
  1. Logout and login to your machine again :)
  2. In case if you have NVidia graphic card customized Docker could be installed which will utilize your GPU. Please follow these extra steps.
  3. For development the following docker image will be used for NVidia Docker this one.
  4. Use the following command to start ordinary Docker container
docker run -it --name leobot_dev -p 8080:8080 -p 8090:8090 -p 9090:9090 -e DISPLAY -e LOCAL_USER_ID=$(id -u) -v /tmp/.X11-unix:/tmp/.X11-unix:rw rosukraine/leobot:latest

for NVidia Docker please use

nvidia-docker run -it --name leobot_dev -p 8080:8080 -p 8090:8090 -p 9090:9090 -e DISPLAY -e LOCAL_USER_ID=$(id -u) -v /tmp/.X11-unix:/tmp/.X11-unix:rw rosukraine/leobot-dev-nvidia:latest
  1. Black window of Terminator UI console will appear after some time.
  2. You can use it's features to split terminal window into smaller terminals and run few commands in parallel (Ctrl+Shift+E).
  3. If you want to run real robot add user to dialout group and restart Docker container
sudo usermod -a -G dialout user

In order to relaunch docker container after you closed Terminator window or rebooted machine please run

docker start leobot_dev

and for NVidia Docker

nvidia-docker start leobot_dev

After some time Terminator window will reappear.

IDEs

In case if you want to run PyCharm in Docker container please run

pycharm

To launch QtCreator please run

qtcreator

For VSCode type

vscode

URDF and RViz

In order to debug URDF please launch

roslaunch leobot_launch view_urdf.launch

To have a look on the state of the robot in RViz run

roslaunch leobot_launch rviz.launch

Windows

Docker Desktop

For OS Windows it is recommended to use Docker Desktop containers. Please follow these steps to run Docker container on your machine.

  1. Install Windows 10 on your machine or in virtual machine
  2. Install Docker Desktop using these instructions
  3. For development the following docker image will be used.
  4. Use the following command to start ordinary Docker container
docker run -d --name leobot_dev -p 8080:8080 -p 8181:8181 -p 8282:8282 -p 8090:8090 -p 9090:9090 rosukraine/leobot-dev-web:latest
  1. Command will spawn Docker container and exit.

In order to relaunch docker container please run

docker start leobot_dev

IDEs

In Docker Desktop only Cloud9 web IDE is available. Open http://localhost:8181 in your browser.

General

Starting the web server

Once you install all project dependencies, you can start the web server with such command

roslaunch leobot_launch web_server.launch

Additionally you can specify a custom port for the web server in docker container

roslaunch leobot_launch web_server.launch port:=1234

In this case you'll need to re-build the docker container to publish the specified port to your host machine (see docker run -p command at Docker section).

If everything goes well, you'll see the message

Web server started at port 8080

After that the web server will become available on your host Ubuntu OS at http://localhost:8080 as well as from LAN.

Navigating on known map

Start office simulation

Linux in Terminator

roslaunch leobot_launch simulation.launch

Windows in Cloud9 IDE Terminal

roslaunch leobot_launch gzweb.launch

Please note that simulation URL is http://localhost:8282

If you want to reduce usage of machine's resources and increase simulation speed on Linux machine you could run it without GUI in headless mode. For these purposes you could use the following command

roslaunch leobot_launch simulation.launch headless:=true gui:=false

Please note that Windows based Docker container is already running Gazebo in headless mode

Start art gallery simulation

Linux in Terminator

roslaunch leobot_launch simulation.launch world_file:=artgallery

Windows in Cloud9 IDE Terminal

roslaunch leobot_launch gzweb.launch world_file:=artgallery

Please note that simulation URL is http://localhost:8282

Launch navigation stack

Linux in Terminator

Please note that in order to launch second command split Terminator window by two using Ctrl-Shift-E. More information on Terminator shortcuts can be found here)

roslaunch leobot_launch navigation.launch

In RViz which appear after some time select "2D Nav Goal" and robot will travel to it. Like it is shown in this video.

Windows in Cloud9 IDE Terminal

Please create another terminal in Cloud9 IDE. More details could be found here.

roslaunch leobot_launch navigation.launch gui:=False

You could send Goal commands manually using command rostopic.

Building the map (Linux only)

Start simulation

roslaunch leobot_launch simulation.launch

Launch gmapping node

roslaunch leobot_launch gmapping.launch

Drive arround environment to build map using the following keys. Please note that console window with gmapping launch file should be active in order to teleoperate robot using keys

Save map to file

rosrun map_server map_saver -f <map_file_name>

Using a USB joystick (Linux only)

To use a USB joystick you need to rebuild the docker container. See item 7 in Docker.

Add the following parameter right after docker run

--device=/dev/input/js0

Notice: in this case you must have the joystick plugged in when you trigger docker run and every time you docker start the corresponding container. Otherwise these commands will fail with an error

docker: Error response from daemon: linux runtime spec devices: error gathering device information while adding custom device "/dev/input/js0": no such file or directory.

To avoid this, you can create one container that supports USB joystick and another default one (using different --name parameters).

You can test that joistick is available from the container with a command

cat /dev/input/js0

It should print strange symbols in the console when you press joystick buttons. Press Ctrl+C to exit.

When joystick is available in the container, trigger the simulation.launch and then start the tepeoperation with joystick support using command

roslaunch leobot_control teleop.launch joy_enabled:=true

If your USB joystick is connected to something different than /dev/input/js0 you can configure it adding such parameter

joy_device:=/dev/input/js1

To operate the robot you need to press the so-called deadman button simultaneously with the arrow buttons or manipulating the thumbstick. Most often that is one of the main buttons at the right side of joystick. Just experiment to find the right one. If you don't press the deadman button the robot won't move.

The joystick will be working even if the console window is minimized, unlike the keyboard teleoperation.