Giter Club home page Giter Club logo

naoqi_driver2's Introduction

naoqi_driver2

This repo defines the naoqi_driver package for ROS2. The driver is in charge of providing bridging capabilities between ROS2 and NAOqiOS.

How it works

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.

Audio can be disabled in boot_config.json.

Installation

Dependencies

To run, the driver requires the naoqi_libqi, naoqi_libqicore and naoqi_bridge_msgs packages. Those can be installed using apt-get (if they have been released for your ROS distro) or from source. Additionally, pepper_meshes and/or nao_meshes can be useful to display the robot in RViz.

On Ubuntu, install them using:

sudo apt-get install ros-<distro>-naoqi-libqi ros-<distro>-naoqi-libqicore ros-<distro>-naoqi-bridge-msgs ros-<distro>-pepper-meshes ros-<distro>-nao-meshes

Installing from source

In your ROS2 workspace, clone the repo and its dependencies:

cd <ws>/src
git clone https://github.com/ros-naoqi/naoqi_driver2.git
vcs import < naoqi_driver2/dependencies.repos
cd <ws>
rosdep install --from-paths src --ignore-src --rosdistro <distro> -y

To install vcs: sudo apt-get install python3-vcstool

Then build the workspace:

cd <ws>
colcon build --symlink-install

Meshes can only be built on x86(_64) platforms. You can skip them by building with these arguments:

colcon build --packages-skip nao_meshes pepper_meshes

License of the meshes

The source repositories include pepper_meshes2 and nao_meshes2, which require an interactive agreement to be provided. If you agree to their license terms ( CC BY-NC-ND 4.0: pepper_meshes2 LICENSE, nao_meshes2 LICENSE). you may skip the interactive prompt by setting the AGREE_TO_NAO_MESHES_LICENSE and I_AGREE_TO_PEPPER_MESHES_LICENSE environment variables:

I_AGREE_TO_NAO_MESHES_LICENSE=1 I_AGREE_TO_PEPPER_MESHES_LICENSE=1 colcon build --symlink-install

Automated jobs on non-interactive environments (DEBIAN_FRONTEND=noninteractive) defaults to agreeing to the licenses, assuming the author of the job has agreed to the license terms.

Launch

To have full control of the robot with ROS, you may want to disable autonomous behaviors first:

ssh nao@<robot_host>
qicli call ALAutonomousLife.setState disabled
qicli call ALMotion.wakeUp

The driver can be launched using the following command:

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>

Username and password arguments are required for robots running NAOqi 2.9 or greater:

ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:=<robot_host> nao_username:=nao nao_password:=<robot_password>

Check that the node is running correctly

Check that the driver is connected:

ros2 node info /naoqi_driver

Hello, world

Make the robot say hello:

ros2 topic pub --once /speech std_msgs/String "data: hello"

Listen to words

You can setup speech recognition and get one result.

ros2 action send_goal listen naoqi_bridge_msgs/action/Listen "expected: [\"hello\"]
language: \"en\""

Move the head

Check that you can move the head by publishing on /joint_angles:

ros2 topic pub --once /joint_angles naoqi_bridge_msgs/JointAnglesWithSpeed "{header: {stamp: now, frame_id: ''}, joint_names: ['HeadYaw', 'HeadPitch'], joint_angles: [0.5,0.1], speed: 0.1, relative: 0}"

You can see the published message with ros2 topic echo /joint_angles

Move around

Check that you can move the robot by publishing on cmd_vel to make the robot move:

ros2 topic pub --once /cmd_vel geometry_msgs/Twist "linear:
  x: 0.5
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 0.785"

Make some room around the robot!

To stop the robot, you must send a new message with linear and angular velocities set to 0:

ros2 topic pub --once /cmd_vel geometry_msgs/Twist "linear:
  x: 0.0
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 0.0"

Development

Check how to install the driver from source, or use the Dockerfile to get setup a reproducible dev environment:

docker build -t ros2-naoqi-driver .

To get all logs in live and build debuggable binaries, you may build with this command:

colcon build --event-handlers console_direct+ --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Debug

It works also when running tests:

colcon test --packages-skip nao_meshes pepper_meshes --event-handlers console_direct+ --ctest-args tests

Build Status

ROS Distro Binary Status Source Status GitHub Status
Humble ros2-humble-jammy-bin-status-badge ros2-humble-jammy-src-status-badge ros2-humble-jammy
Iron ros2-iron-jammy-bin-status-badge ros2-iron-jammy-src-status-badge ros2-iron-jammy

naoqi_driver2's People

Contributors

suryaambrose avatar mbusy avatar vrabaud avatar victorpaleologue avatar karsten1987 avatar k-okada avatar mikaelarguedas avatar kochigami avatar nlyubova avatar arturocuma avatar pacodu avatar zygopter avatar severin-lemaignan avatar antegallya avatar lpea avatar esteve avatar lgeo3 avatar sloretz avatar furushchev avatar elagrue avatar

Forkers

maelic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.