TLDR:These are a quick list of instructions to quickly install and run nav_rest_api_turtlebot on your local workstation.
- Ubuntu
22.04.4LTS - ROS 2
Humble - Docker version
26.1.1, build4cf5afa
Download nav_rest_api_turtlebot repository locally:
cd $HOMEgit clone https://github.com/cardboardcode/nav_rest_api_turtlebot --single-branch --depth 1cd nav_rest_api_turtlebotBuild docker image using provided Dockerfile:
docker build -t ros1_turtlebot3_rest_api .Enable gui display forwarding for applications within docker:
xhost +local:dockerCreate docker container from newly built docker image:
docker run -it --rm \
--name ros1_turtlebot3_rest_api_c \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--net=host \
ros1_turtlebot3_rest_api:latest /bin/bashRun the following command to launch the REST API in the docker container:
source devel/setup.bash && roslaunch nav_rest_api server.launchRun the turtlebot3 simulation in a new terminal within the docker container:
docker exec -it ros1_turtlebot3_rest_api_c bashexport TURTLEBOT3_MODEL=wafflesource devel/setup.bash && roslaunch nav_rest_api_turtlebot test.launchSend a nav goal command to move the Turtlebot3 Waffle in simulation via REST API call:
curl --header "Content-Type: application/json" \
--request POST \
--data '{"robot_name": "robot0","location_x": "3","location_y": "0","location_th": "1.5707"}' \
http://localhost:8080/api/goal