Skip to content

Commit

Permalink
updated readme and positions of spawning robots
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Delicat <jakub.delicat@husarion.com>
  • Loading branch information
delihus committed Jan 15, 2024
1 parent 5ceade9 commit d0929c6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
13 changes: 12 additions & 1 deletion demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ docker compose -f compose.yaml up
```

## Simulation
If you don't have Nvidia GPU replace `*gpu-config` with `*cpu-config` in `rosbot` service inside `compose.simulation.yaml` file.
If you don't have Nvidia GPU replace `*gpu-config` with `*cpu-config` in `rosbot` service inside `compose.gazebo.yaml` file.

In the PC's shell execute (in the `demo/` directory):
```
xhost local:root
docker compose -f compose.gazebo.yaml up
```

If you want to use multiple robots check the `compose.gazebo.multirobot.yaml` (in the `demo/` directory):
```
xhost local:root
docker compose -f compose.gazebo.multiplerobot.yaml up
```

## Drive the ROSbot
In another shell (if you use hardware use another ROSbot's shell) enter the docker container:
```
Expand All @@ -43,4 +49,9 @@ and run inside `teleop_twist_keyboard` to drive the ROSbot
ros2 run teleop_twist_keyboard teleop_twist_keyboard
```

In case of driving one of the robot running `compose.gazebo.multirobot.yaml` add the namespace to the `teleop_twist_keyboard`. For the `robot1`:
```
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r __ns:=/robot1
```

With keys `i`, `j`, `l`, `,` you can drive forward, counter clockwise, clockwise and backwards. If you are using macanum wheels (see `demo/.env` file) hold `Shift` key that way the ROSbot goes left and right with `j` and `l` keys instead rotates.
8 changes: 4 additions & 4 deletions demo/compose.gazebo.multirobot.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Quick Start
#
# 1. run `xhost +local:docker && docker compose -f compose.gazebo.multirobot.yaml up` on the laptop
# 2. open a shell inside a docker container `docker compose -f compose.gazebo.yaml exec -it rosbot bash`
# 2. run `ros2 run teleop_twist_keyboard teleop_twist_keyboard` inside the container
# 2. open a shell inside a docker container `docker compose -f compose.gazebo.multirobot.yaml exec -it rosbot bash`
# 2. run for e. g. `ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r __ns:=/robot1` inside the container

x-gpu-config:
&gpu-config
Expand All @@ -20,7 +20,7 @@ x-cpu-config:

services:
rosbot:
# image: husarion/rosbot-gazebo:humble
image: husarion/rosbot-gazebo:humble-nightly
# build:
# context: ../
# dockerfile: Dockerfile.gazebo
Expand All @@ -30,4 +30,4 @@ services:
command: >
ros2 launch rosbot_gazebo simulation.launch.py
mecanum:=${MECANUM:-False}
robots:="robot1={y: 0.0}; robot2={y: 1.0}; robot3={y: 2.0};
robots:="robot1={y: -4.0}; robot2={y: -2.0}; robot3={y: 4.0};"

0 comments on commit d0929c6

Please sign in to comment.