Code to connect to the experimental equipment on the Mobile Rack workbench, such as Festo valves & Qualisys motion tracking system. Code common across different projects using THE RACK can be kept here.
- Ubuntu
- macOS
- Windows
- tested with WSL
Set up SSH key for GitHub, and in the desired directory, run...
git clone --recursive git@github.com:srl-ethz/mobilerack-interface.git(--recursive option will automatically clone the submodules as well)
(also check GitHub Actions file in .github/workflows/ci.yml for hints on how to set up Ubuntu)
sudo apt update
sudo apt install cmake build-essential libmodbus-dev libeigen3-dev libserialport-dev libopencv-dev
sudo apt install python3-dev python3-numpy # install developer package and numpy for system's default python3 version.CMake version should be above 3.12 (check with cmake --version). Ubuntu 18.04 default cmake is older than that, so upgrade may be necessary, in which case run
# refer to: https://graspingtech.com/upgrade-cmake/
# remove installed cmake and install required packages
sudo apt remove --purge cmake
sudo apt update
sudo apt install build-essential libssl-dev
# compile cmake from source
wget https://github.com/Kitware/CMake/releases/download/v3.16.5/cmake-3.16.5.tar.gz
tar -zxvf cmake-3.16.5.tar.gz
cd cmake-3.16.5
./bootstrap
make
sudo make installbrew install libmodbus eigen libserialport numpy opencvcd /path/to/mobilerack-interface
cmake .
makeexecutables are output to bin/, libraries are output to lib/.
In its current implementation, you must set the $PYTHONPATH environment variable to point to the directory containing the library binaries in order to run. (probably mobilerack-interface/lib)
## run this everytime you open a new terminal to run a python script using this library
export PYTHONPATH=$PYTHONPATH:/path/to/lib
## Alternatively, append the line to ~/.bashrc if you don't want to run it every time.
python3
>> import mobilerack
>> vc = mobilerack.ValveController("192.168.0.100", [0, 1], 200)
>> vc.setSinglePressure(0, 100)Uses Doxygen to generate documentation from inline comments in code. Install Doxygen, and
run doxygen Doxyfile in this directory to generate HTML files (can be seen with browser at html/index.html).
The QualisysClient class tracks each RigidBody (labels must be an integer between 0 - 9 in order for the QualisysClient to read it). QualisysClient can auto-discover QTM RT server instances on the same network. The following combination would work:
| QTM running on | QualisysClient running on |
|---|---|
| Windows machine | WSL on same Windows machine |
| Windows machine | Ubuntu or macOS machine on the same network |
Power up the valves and make sure your PC is connected to the router.
refer to 3d-soft-trunk as an example.