71 lines
2.0 KiB
Markdown
71 lines
2.0 KiB
Markdown
## Development environment
|
|
### Linux (or WSL)
|
|
Start off by installing [Pyenv](https://github.com/pyenv/pyenv?tab=readme-ov-file#installation) and walk through the steps outlined there (be sure to also add it to PATH). Also install the [Python build requirements](https://github.com/pyenv/pyenv/wiki#suggested-build-environment). Afterwards, install Python 2.7 and activate it for your current shell:
|
|
|
|
```bash
|
|
pyenv install 2.7
|
|
pyenv shell 2.7
|
|
```
|
|
|
|
You can check that this worked by typing
|
|
|
|
```bash
|
|
python -V
|
|
```
|
|
|
|
Which should return `Python 2.7.18`.
|
|
|
|
Next, `cd` into this repository and create (and activate) a virtual environment:
|
|
|
|
```bash
|
|
cd <path to project>/
|
|
python -m pip install virtualenv
|
|
python -m virtualenv .venv
|
|
source .venv/bin/activate
|
|
```
|
|
|
|
Install the required packages with
|
|
|
|
```bash
|
|
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:
|
|
|
|
```bash
|
|
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:
|
|
|
|
```bash
|
|
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:
|
|
|
|
```bash
|
|
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
|
|
|
|
```bash
|
|
python -c "import qi; print(qi)"
|
|
```
|
|
|
|
You should now be able to run this project.
|
|
|
|
### MacOS
|
|
...
|
|
|
|
## Running
|
|
Assuming you have the virtual environment activated (`source .venv/bin/activate` on Linux) and that you have a virtual robot running on localhost you should be able to run this project by typing
|
|
|
|
```bash
|
|
python main.py --qi-url tcp://localhost:<port>
|
|
```
|
|
|
|
where `<port>` is the port on which your robot is running. |