diff --git a/README.md b/README.md index 596eec7..ac9560e 100644 --- a/README.md +++ b/README.md @@ -25,24 +25,32 @@ xhost local:docker ### Running docker image +Select the ROSbot: +```bash +export ROBOT_NAME=rosbot # or rosbot_xl +``` + +Without GPU: ```bash docker run --rm -it \ -v /tmp/.X11-unix:/tmp/.X11-unix:rw \ -e DISPLAY -e LIBGL_ALWAYS_SOFTWARE=1 \ -e DDS_CONFIG=DEFAULT -e RMW_IMPLEMENTATION=rmw_fastrtps_cpp \ husarion/webots:humble \ -ros2 launch webots_ros2_husarion rosbot_launch.py +ros2 launch webots_ros2_husarion ${ROBOT_NAME}_launch.py ``` -If you want to use ROSbot XL change the launch file to `rosbot_xl_launch.py` - +With GPU: ```bash docker run --rm -it \ +--runtime=nvidia \ -v /tmp/.X11-unix:/tmp/.X11-unix:rw \ --e DISPLAY -e LIBGL_ALWAYS_SOFTWARE=1 \ +-e NVIDIA_VISIBLE_DEVICES=all \ +-e NVIDIA_DRIVER_CAPABILITIES=all \ +-e DISPLAY \ -e DDS_CONFIG=DEFAULT -e RMW_IMPLEMENTATION=rmw_fastrtps_cpp \ husarion/webots:humble \ -ros2 launch webots_ros2_husarion rosbot_xl_launch.py +ros2 launch webots_ros2_husarion ${ROBOT_NAME}_launch.py ``` ![ROSbot XL in webots simulator](.docs/rosbot_xl.png) diff --git a/demo/README.md b/demo/README.md index e62e33a..3af4cd3 100644 --- a/demo/README.md +++ b/demo/README.md @@ -4,6 +4,11 @@ If you want to use ROSbot 2R replace [the launchfile](https://github.com/husario ## Run with `docker compose` +Select the ROSbot: +```bash +export ROBOT_NAME=rosbot # or rosbot_xl +``` + To start simulation build and run webots simulator container type: ```bash @@ -18,9 +23,14 @@ Wait until this messages show up in the Webots console. > > INFO: 'Ros2Supervisor' extern controller: connected. -Now you can use `teleop_twist` tool to drive ROSbot with keyboard. +For visualization the ROSbots sensors run RViz2 in the another terminal: -Enter `rviz` container: +```bash +docker compose -f compose.rviz.yaml up +``` + +Now you can use `teleop_twist` tool to drive ROSbot with keyboard. +Enter `rviz` container in the new terminal: ```bash docker exec -it rviz bash diff --git a/demo/compose.yaml b/demo/compose.yaml index 1cb1f8a..5443eee 100644 --- a/demo/compose.yaml +++ b/demo/compose.yaml @@ -32,4 +32,4 @@ services: - /tmp/.X11-unix:/tmp/.X11-unix:rw - /dev/dri:/dev/dri command: > - ros2 launch webots_ros2_husarion rosbot_xl_launch.py + ros2 launch webots_ros2_husarion ${ROBOT_NAME:-rosbot_xl}_launch.py