Skip to content

Commit dcc07e4

Browse files
authored
Merge pull request #28 from gwennlbh/improvedocs
docs: add nix shell and instructions to run python demo scripts as root
2 parents b09b831 + a44a3b8 commit dcc07e4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

readme.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,32 @@ colcon build
3434

3535
You find examples in forms of demos under the `demos/` folder. The demos show how to use the python and C++ interface for talking to the library and setting up a robot.
3636

37+
##### Python examples
38+
39+
If you're using nix, you can get into a shell with all required packages available, including the C++-backed python packages
40+
41+
```
42+
nix develop .#python
43+
```
44+
45+
Since the SDK forges raw ethernet frames, you need to run these scripts as root (run it in a shell that has the dependencies installed and PYTHONPATH set):
46+
47+
```
48+
sudo -HE env PATH=$PATH PYTHONPATH=$PYTHONPATH python demos/demo_testbech_joint_calibrator.py
49+
```
50+
51+
Note that running within a network-mounted directory (e.g. using NFS) might result in a "Permission denied" error when trying to make python execute the script as root, even when all users have the read permission set.
52+
53+
_(LAAS members: this is the case for your home directory when using office computers)_
54+
55+
##### C++ examples
56+
57+
C++ demos also need to be run as root. Compilation produces binaries named `odri_control_interface_*`. (nix: you can do `nix run .#testbench` or `nix run .#solo12`)
58+
59+
Change the Ethernet interface the master board is plugged to by editing the relevant `config_*.yaml` file, then _re-build the binaries_
60+
61+
You can get the ethernet interface by runnning `ip a`
62+
3763
### License and Copyrights
3864

3965
License BSD-3-Clause

0 commit comments

Comments
 (0)