Fast communication module between NAO/PEPPER robot sensors and actuators and mc_rtc
control framework.
This is a local robot module, which needs to be cross-compiled for the desired platform (NAO or Pepper), and uploaded on the robot. This module provides fast access to the low level Device Communication Manager module of NAOqi OS, it allows to set/get actuator values under 12ms.
This module needs to be cross-compiled and sent to the robot (Pepper/NAO). Unfortunately the cross-compilation toolchains are old and no longer supported, and the robots are almost impossible to upgrade anymore. Thus we have to rely on the few existing toolchains that have not been lost to time. As of now the following toolchains are supported:
ctc-naoqi-2.5.0
: Builds withboost 1.59
, should be suitable for older version ofPepper
. You may find a backup of this toolchain here: https://seafile.lirmm.fr/f/5389d0a64d79481ab49e/?dl=1ctc-linux64-atom-2.1.4.13
: Builds withboost 1.55
, should be suitable for older version ofNAO
. You may find a backup of this toolchain here: https://seafile.lirmm.fr/f/ba804ce9277544f2b6ec/?dl=1- Newer toolchains should be supported as well, but we do not own any robot recent enough to test them.
If you rely on one of these toolchains, it is highly recommended that you keep a local backup of the toolchain.
This module needs to be cross-compiled and sent to the robot. For this you have three options (choose which one fits you best):
You may use the provided Dockerfile
that sets up the cross-compilation environment for you. If you already followed Option 1
this is not necessary. Please choose the appropriate Dockerfile
depending on your desired cross-compilation toolchain: Dockerfile_2.5.0
or Dockerfile_2.1.4
cd <mc_naoqi_dcm>
./docker/build.sh nao 2.1.4 # arguments here are robot name [nao|pepper] and library version [2.1.4|2.5.0]
# for pepper use
# ./docker/build.sh pepper 2.5.0
If the build suceeds, it will copy the generated library to /tmp/libmc_naoqi_dcm_<robot>_<version>.so
. You may then copy this library on the robot (see Installing on the robot
section).
If there is any issue with building you may use the following to connect to the docker and investigate
./docker/run.sh nao 2.1.4
- Install qiBuild:
pip install qibuild --user
- Configure qiBuild:
qibuild config --wizard
- Create a qiBuild worktree:
mkdir qibuild_ws
- Enter qiBuild worktree:
cd qibuild_ws
- Initialize your worktree:
qibuild init
- Download the Cross Compilation Toolchain. Unfortunately the toolchain required for naoqi 2.5 is no longer officially provided, you may download a copy here:
We advise you to keep a copy of that archive in case the above link becomes unavailable as this archive cannot be found elsewhere online.
wget -c https://seafile.lirmm.fr/f/5389d0a64d79481ab49e/?dl=1 -O ctc-naoqi.tar.xz
- Extract this archive
tar -xf ctc-naoqi.tar.xz .
- Create toolchain for cross compilation:
qitoolchain create ctc-naoqi ctc-naoqi-2.5.0/toolchain.xml
- Enter previously created qiBuild worktree:
cd qibuild_ws
- Create toolchain build configuration and set it as default in your qiBuild worktree:
qibuild add-config ctc-naoqi-config -t ctc-naoqi --default
- Clone this project into your qiBuild worktree:
git clone https://github.com/jrl-umi3218/mc_naoqi_dcm.git
- Enter the project folder:
cd mc_naoqi_dcm
- Configure the project (to build for either Pepper or NAO):
qibuild configure --release -DROBOT_NAME=<pepper|nao>
- Build the local robot module:
qibuild make
- Note: you may need to run
export LC_ALL=C
if you encounter the following error while building:
as: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
You may now upload qibuild_ws/mc_naoqi_dcm/build-ctc-naoqi-config/sdk/lib/naoqi/libmc_naoqi_dcm.so
to the robot.
You may find a pre-built version of libmc_naoqi_dcm.so
in the Github Artefacts: click on [CI of mc_naoqi_dcm with Docker]
then click on the latest successful action and scroll down to the Artefacts section where you can download the pre-compiled libmc_naoqi_dcm.so
library.
The installation consists of uploading the module to the robot and making it automatically load on startup
- Transfer
libmc_naoqi_dcm.so
file to the robot:
rsync build-ctc-naoqi-config/sdk/lib/naoqi/libmc_naoqi_dcm.so nao@pepper.local:/home/nao/naoqi/ # For Option 1
# Or:
rsync /tmp/libmc_naoqi_dcm.so nao@pepper.local:/home/nao/naoqi/ # For Option 2
- Login to robot system:
ssh nao@<robot_ip>
- Configure
mc_naoqi_dcm
module to be auto-loaded when robot starts operating. Modify configuration file:
nano naoqi/preferences/autoload.ini
to contain the following line:
[user]
/home/nao/naoqi/libmc_naoqi_dcm.so
- Restart robot system:
nao restart
The robot is now running our uploaded local module mc_naoqi_dcm
and is ready to be controlled via mc_rtc
controller using mc_naoqi
interface.
You can refer to the sample Pepper Finite State Machine (FSM) mc_rtc
controller project: PepperFSMController
for an example (or a starting point) for creating your own mc_rtc
controller for Pepper.