Skip to content

Commit

Permalink
Rebase from 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
victorpaleologue committed Dec 5, 2023
1 parent 5bacce2 commit 236aeea
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 56 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/foxy_focal.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/galactic_focal.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
55 changes: 42 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand All @@ -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/<distro>/setup.bash # or source <ws>/install/setup.bash if built from source
ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:=<robot_host>
ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:=<robot_host> 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:=<robot_host> nao_username:=nao nao_password:=<robot_password>
ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:=<robot_host> nao_username:=nao nao_password:=<robot_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/<distro>/setup.bash # or source <ws>/install/setup.bash if built from source
ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:=<robot_host> 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

Expand Down Expand Up @@ -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,
Expand All @@ -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
> ```
Expand Down
18 changes: 8 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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 <service_name>
# ROS_DISTRO=<distro> docker compose up dev --build
#
# To open an interactive shell to a running container:
# docker exec -it <container_name> 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
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="3">
<name>naoqi_driver</name>
<version>2.1.0</version>
<version>2.1.1</version>
<description>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.</description>

<author>Karsten Knese</author>
Expand Down
2 changes: 1 addition & 1 deletion src/converters/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/*
* ROS includes
*/
#include <cv_bridge/cv_bridge.hpp>
#include <cv_bridge/cv_bridge.h> // not .hpp for humble compat

/*
* CV includes
Expand Down

0 comments on commit 236aeea

Please sign in to comment.