Implement negotiation and actuation endpoints See merge request ics/sp/2025/n25b/pepperplus-ri!5
PepperPlus-RI
The robot interface is a high-level API for controlling the robot. It implements the API as designed: https://utrechtuniversity.youtrack.cloud/articles/N25B-A-14/RI-CB-Communication.
This is an implementation for the Pepper robot, using the Pepper SDK and Python 2.7 as required by the SDK.
Installation
Linux (or WSL)
Start off by installing Pyenv and walk through the steps outlined there (be sure to also add it to PATH). Also install the Python build requirements. Afterwards, install Python 2.7 and activate it for your current shell:
pyenv install 2.7
pyenv shell 2.7
You can check that this worked by typing
python -V
Which should return Python 2.7.18.
Next, cd into this repository and create (and activate) a virtual environment:
cd <path to project>/
python -m pip install virtualenv
python -m virtualenv .venv
source .venv/bin/activate
Install the required packages with
pip install -r requirements.txt
Now we need to install the NaoQi SDK into our virtual environment, which we need to do manually. Begin by downloading the SDK:
wget https://community-static.aldebaran.com/resources/2.5.10/Python%20SDK/pynaoqi-python2.7-2.5.7.1-linux64.tar.gz
Next, move into the site-packages directory and extract the file you just downloaded:
cd .venv/lib/python2.7/site-packages/
tar xvfz <path to SDK>/pynaoqi-python2.7-2.5.7.1-linux64.tar.gz
rm <path to SDK>/pynaoqi-python2.7-2.5.7.1-linux64.tar.gz
Lastly, we need to inform our virtual environment where to find our newly installed package:
echo <path to project>/.venv/lib/python2.7/site-packages/pynaoqi-python2.7-2.5.7.1-linux64/lib/python2.7/site-packages/ > pynaoqi-python2.7.pth
That's it! Verify that it works with
python -c "import qi; print(qi)"
You should now be able to run this project.
macOS
Similar to Linux, but don't bother installing pyenv as it won't be able to install Python 2 on Apple Silicon. Instead, install Python 2.7.18 from the Python website.
Create the virtual environment as described above in the Linux section. Stop at the point where it shows you how to download the NaoQi SDK. Instead, use:
curl -OL https://community-static.aldebaran.com/resources/2.5.10/Python%20SDK/pynaoqi-python2.7-2.5.7.1-mac64.tar.gz
Then resume the steps from above.
Usage
On Linux and macOS:
PYTHONPATH=src python -m robot_interface.main
On Windows:
$env:PYTHONPATH="src"; python -m robot_interface.main
With both, if you want to connect to the actual robot (or simulator), pass the --qi-url argument.
Testing
To run the unit tests, on Linux and macOS:
PYTHONPATH=src pytest test/
On Windows:
$env:PYTHONPATH="src"; pytest test/
Coverage
For coverage, add --cov=robot_interface as an argument to pytest.
GitHooks
To activate automatic commits/branch name checks run:
git config --local core.hooksPath .githooks
If your commit fails its either: branch name != /description-of-branch , commit name != : description of the commit. : N25B-Num's