Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection refused when trying to connect to pepper robot running naoqi 2.9 #5

Closed
K4belBr4nd opened this issue Jan 31, 2024 · 1 comment

Comments

@K4belBr4nd
Copy link

Hello there,

I am experiencing issues connecting to Pepper robots running NAOqi 2.9 using ROS Humble. The error message [naoqi_driver_node-1] Connect error: 111: Connection refused is displayed, and the naoqi driver node shuts down immediately.

I've tried the provided dev dockerfile from the repository as well as my own dockerfile with the release packages using docker compose and running it directly on my host machine with both the source build and the release packages.

Any help would be much appreciated.

Log / Error Message

root@linuxkit-525400123456:/ws# ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:=192.168.0.108 password:=xxxx qi_listen_url:=0.0.0.0:56000
[INFO] [launch]: All log files can be found below /root/.ros/log/2024-01-31-08-18-17-235989-linuxkit-525400123456-282
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [naoqi_driver_node-1]: process started with pid [283]
[naoqi_driver_node-1] Connect error: 111: Connection refused
[naoqi_driver_node-1] naoqi driver is shutting down..
[naoqi_driver_node-1] cannot publish data, at ./src/rmw_publish.cpp:62 during '__function__'
[naoqi_driver_node-1] [ERROR] [1706689100.345726297] [naoqi_driver.rclcpp]: Error in destruction of rcl subscription handle: Failed to delete datareader, at ./src/subscription.cpp:52, at ./src/rcl/subscription.c:184
[naoqi_driver_node-1] cannot publish data, at ./src/rmw_publish.cpp:62 during '__function__'
[naoqi_driver_node-1] Fail in delete datareader, at ./src/rmw_service.cpp:104 during '__function__'
[ERROR] [naoqi_driver_node-1]: process has died [pid 283, exit code -11, cmd '/opt/ros/humble/lib/naoqi_driver/naoqi_driver_node --ros-args --params-file /tmp/launch_params_cpsefmdf'].

Environment

  • OS: Ubuntu 22.04 (Jammy)
  • ROS Version: humble
  • NAOqi Version: 2.9
  • Pepper Models: 1.8 and 1.8a
  • Docker Container:
# my dockerfile using release packages
ARG ROS_DISTRO=humble
FROM ros:${ROS_DISTRO} as dev
ENV ROS_DISTRO=${ROS_DISTRO}
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]

# install basic dependencies
RUN apt-get update -y \
  && apt-get install -y git python3-vcstool

# install naoqi driver libraries
RUN apt-get install -y ros-${ROS_DISTRO}-naoqi-libqi \
  ros-${ROS_DISTRO}-naoqi-libqicore ros-${ROS_DISTRO}-naoqi-bridge-msgs \
  ros-${ROS_DISTRO}-pepper-meshes \
  ros-${ROS_DISTRO}-nao-meshes \
  ros-${ROS_DISTRO}-naoqi-driver
  
# create workspace
ENV WS=/ws
COPY . $WS
RUN apt install -y git python3-vcstool

# Build the base Colcon workspace, installing dependencies first.
WORKDIR $WS


# Install extra tools for development
RUN apt-get update && apt-get install -y --no-install-recommends \
 gdb gdbserver vim libgmock-dev

# Every bash instance should source the entrypoint
RUN echo "source ${WS}/docker/entrypoint.sh" >> /root/.bashrc
SHELL [ "/bin/bash", "-c" ]
ENTRYPOINT [ "/bin/bash" ]

FROM dev as dev-prebuilt
RUN source /opt/ros/${ROS_DISTRO}/setup.bash \
  && colcon build --symlink-install
version: "3.9"
services:
  dev:
    image: naoqi-driver:dev-$ROS_DISTRO
    build:
      context: .
      dockerfile: docker/Dockerfile
      target: dev-prebuilt
      args:
        - ROS_DISTRO=$ROS_DISTRO
    ports:
      - "9559:9559"
      - "56000:56000"

    # Interactive shell
    stdin_open: true
    tty: true

    # Networking and IPC for ROS 2
    network_mode: host
    ipc: host

Steps to reproduce

  1. ssh into robot
  2. qicli call ALAutonomouslife.setState disable
  3. qicli call ALMotion.wakeUp
  4. exit ssh connection
  5. docker compose up --build
  6. enter docker container in new terminal via docker exec -it <container_name> bash
  7. launching naoqi_driver via ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:=192.168.0.108 password:=xxxx qi_listen_url:=0.0.0.0:56000

Additional Information

  • I can SSH into the robots and disable autonomous life.
  • I can wake up the robots via qicli.
  • I've tried both IP addresses of the robot and attached tablet.
  • I've tried using two Docker containers (dev-prebuilt from your repository and fresh humble container using release packages).
  • I've also tried the source build and released packages directly on my machine.
  • Audio feature has been disabled inside the bootconfig.
  • I've used the entrypoint.sh provided in the repository also for my container
  • The issue does not occur with NAOqi 2.8., tested with NAOv6
  • I've noticed the python launch file uses the launch arguments username and password without the `nao_' prefix in contrast to what's written in the README.
@K4belBr4nd
Copy link
Author

Found the solution to my problem in the naoqi_driver repository for ROS1 and this issue. Explicitly using the port 9503 instead of 9559 fixes connection error.

I created a pull request to include a warning in the launch section of the README with some additional changes to the driver_helper.cpp from the ROS1 naoqi driver repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant