diff --git a/demo/README.md b/demo/README.md index 173c882..b70451b 100644 --- a/demo/README.md +++ b/demo/README.md @@ -25,7 +25,7 @@ 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): ``` @@ -33,6 +33,12 @@ 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: ``` @@ -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. diff --git a/demo/compose.gazebo.multirobot.yaml b/demo/compose.gazebo.multirobot.yaml index 073782a..ce3a4be 100644 --- a/demo/compose.gazebo.multirobot.yaml +++ b/demo/compose.gazebo.multirobot.yaml @@ -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 @@ -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 @@ -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};"