diff --git a/.github/workflows/foxy_focal.yml b/.github/workflows/foxy_focal.yml deleted file mode 100644 index 5260a12..0000000 --- a/.github/workflows/foxy_focal.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: ros2-foxy-focal - -on: - push - -jobs: - ros2_foxy_focal_ci: - name: foxy (focal) - uses: ./.github/workflows/ros2.yml - with: - ROS_DISTRO: foxy - ROS_REPO: testing - OS_NAME: ubuntu - OS_CODE_NAME: focal - ALLOW_FAIL: false \ No newline at end of file diff --git a/.github/workflows/galactic_focal.yml b/.github/workflows/galactic_focal.yml deleted file mode 100644 index 39f6e44..0000000 --- a/.github/workflows/galactic_focal.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: ros2-galactic-focal - -on: - push - -jobs: - ros2_galactic_focal_ci: - name: galactic (focal) - uses: ./.github/workflows/ros2.yml - with: - ROS_DISTRO: galactic - ROS_REPO: testing - OS_NAME: ubuntu - OS_CODE_NAME: focal - ALLOW_FAIL: false \ No newline at end of file diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3beb0e7..e35ffa0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,15 @@ Changelog for package naoqi_driver ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.1.1 (2023-12-05) +------------------ +* Drop testing of `foxy` and `galactic` +* README: remove extraneous args in example +* Update code and instructions about Docker +* Fix build for humble +* Improve README about audio service +* Contributors: Victor Paléologue + 2.1.0 (2023-11-23) ------------------ * New "Listen" action diff --git a/README.md b/README.md index f06fe69..b146aeb 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,13 @@ This repo defines the __naoqi_driver__ package for ROS2. The driver is in charge The __naoqi_driver__ is a ROS node. It connects to a robot running NAOqi using libQi. -It also listens to a libQi endpoint (specified by the option `qi_listen_url`). -This endpoint should be public (*e.g.* `qi_listen_url:=0.0.0.0:0`) -to enable collecting audio buffers remotely. -It should be set to a local address (*e.g.* `qi_listen_url:=127.0.0.1:0`) -when running on the robot. -It can be disabled by setting `qi_listen_url:=` when audio is not required. +To support the audio features, __naoqi_driver__ opens a libQi endpoint. +It is set by default to `127.0.0.1:0` (random port on local host), +so it should be set with the option `qi_listen_url`, +*e.g.* `qi_listen_url:=0.0.0.0:0` to allow collecting audio buffers remotely. -> Audio can be disabled in [boot_config.json](src/naoqi_driver2/share/boot_config.json). +Audio features are enabled by default and can be disabled in +[boot_config.json](src/naoqi_driver2/share/boot_config.json). ## Installation @@ -88,6 +87,8 @@ assuming the author of the job has agreed to the license terms. ## Launch +### Avoid interference with autonomous life + To have full control of the robot with ROS, you may want to disable autonomous behaviors first: @@ -97,20 +98,48 @@ qicli call ALAutonomousLife.setState disabled qicli call ALMotion.wakeUp ``` -The driver can be launched using the following command: + +### NAOqi 2.8 and lower + +The driver can be launched from a remote machine this way: ```sh source /opt/ros//setup.bash # or source /install/setup.bash if built from source -ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:= +ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:= qi_listen_url:=0.0.0.0:0 ``` + +### NAOqi 2.9 and higher + Username and password arguments are required for robots running NAOqi 2.9 or greater: ```sh -ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:= nao_username:=nao nao_password:= +ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:= nao_username:=nao nao_password:= qi_listen_url:=0.0.0.0:0 +``` + + +### From a Docker container + +If you run __naoqi_driver__ from a Docker container with audio features enabled, +you must specify the libQi endpoint with, *e.g.* for port 56000: + +```sh +source /opt/ros//setup.bash # or source /install/setup.bash if built from source +ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:= qi_listen_url:=0.0.0.0:56000 ``` +Then you must [expose](https://docs.docker.com/engine/reference/commandline/run/#publish) it from the container. + + +### On the robot or on the same machine + +If you run the driver directly from the robot (or your machine running a virtual robot), +you can omit the options: + +```sh +ros2 launch naoqi_driver naoqi_driver.launch.py +``` ## Check that the node is running correctly @@ -181,10 +210,10 @@ angular: ## Development Check how to [install the driver from source](#installing-from-source), -or use the [`Dockerfile`](Dockerfile) to get setup a reproducible dev environment: +or use `docker compose` to get a more reproducible dev environment: ```sh -docker build -t ros2-naoqi-driver . +ROS_DISTRO=iron docker compose up dev --build ``` > To get all logs in live and build debuggable binaries, @@ -197,7 +226,7 @@ docker build -t ros2-naoqi-driver . > It works also when running tests: > > ```sh -> colcon test --packages-skip nao_meshes pepper_meshes --event-handlers console_direct+ --ctest-args tests +> colcon test --event-handlers console_direct+ --ctest-args tests > ``` diff --git a/docker-compose.yaml b/docker-compose.yaml index 91424c4..8413f62 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,32 +1,30 @@ -# Docker Compose file for TurtleBot3 Behavior Examples +# Docker Compose file for developer containers # # Usage: # -# To build the images: -# docker compose build -# -# To start up a specific service by name: -# docker compose up +# ROS_DISTRO= docker compose up dev --build # # To open an interactive shell to a running container: -# docker exec -it bash +# docker exec -it naoqi_driver-dev-1 bash version: "3.9" services: - # Developer container dev: - image: ros2-naoqi-driver:dev + image: naoqi-driver:dev-$ROS_DISTRO build: context: . dockerfile: docker/Dockerfile target: dev + args: + - ROS_DISTRO=$ROS_DISTRO # Interactive shell stdin_open: true tty: true + # Networking and IPC for ROS 2 network_mode: host ipc: host volumes: # Mount the source code - - .:/ws/src/naoqi_driver2:rw + - .:/ws/src/naoqi_driver:rw diff --git a/docker/Dockerfile b/docker/Dockerfile index 65b0107..1fdb6c9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,7 +6,7 @@ SHELL ["/bin/bash", "-c"] # Create Colcon workspace with the project and its deps ENV WS=/ws -ENV PROJ_SRC=${WS}/src/naoqi_driver2 +ENV PROJ_SRC=${WS}/src/naoqi_driver COPY . $PROJ_SRC WORKDIR $WS/src RUN apt install -y git python3-vcstool diff --git a/package.xml b/package.xml index 06b2a06..acf1107 100644 --- a/package.xml +++ b/package.xml @@ -1,7 +1,7 @@ naoqi_driver - 2.1.0 + 2.1.1 Driver module between Aldebaran's NAOqiOS and ROS2. It publishes all sensor and actuator data as well as basic diagnostic for battery, temperature. It subscribes also to RVIZ simple goal and cmd_vel for teleop. Karsten Knese diff --git a/src/converters/camera.cpp b/src/converters/camera.cpp index c4c5e5b..41b866d 100644 --- a/src/converters/camera.cpp +++ b/src/converters/camera.cpp @@ -26,7 +26,7 @@ /* * ROS includes */ -#include +#include // not .hpp for humble compat /* * CV includes