How to Install the Software¶
Todo
This page can probably be restructured a bit.
There are two options to use the TriFinger software:
Use the provided container with everything installed inside.
Build from source
Use Container with Pre-build Packages¶
The “trifinger_robot” image from trifinger_singularity contains all packages needed to use the robot. This is the easiest way if you just want to use the robots.
Todo
Add more information here.
Build from Source¶
We provide a Apptainer image with all required dependencies to build and run the software. See About Apptainer/Singularity.
We highly recommend to use that container to make sure you have all the dependencies with proper versions. However, you can of course also build the packages without Apptainer. In this case you need to install all dependencies manually, though (see trifinger_base.def in trifinger_singularity for guidance).
Real-Time Requirements¶
To ensure reliable communication with the robot hardware, a real-time Linux kernel is needed. See Real Time Setup in the documentation of robot_interfaces
Get the Source with treep¶
The software for the TriFinger robots is organised as a collection of multiple packages, each in its own git repository. We therefore use a workspace management tool called treep which allows easy cloning of multi-repository projects.
treep can be installed via pip:
pip install treep
Clone the treep configuration containing the “ROBOT_FINGERS” project:
git clone git@github.com:machines-in-motion/treep_machines_in_motion.git
Note: treep searches for a configuration directory from the current working
directory upwards. So you can use treep in the directory in which you invoked
the git clone
command above or any subdirectory.
Now clone the project:
treep --clone ROBOT_FINGERS
# or use --clone-https to use https instead of ssh for cloning
Important
By default treep uses SSH to clone from GitHub. So for the above command to work, you need a GitHub account with a registered SSH key. Further this key needs to work without asking for a password everytime. To achieve this, run
ssh-add
first.
If you don’t want to use SSH, you can also use --clone-https
instead of
--clone
.
If the cloning was successful, your workspace should now have the following structure:
/path/to/your/workspace
├── treep_machines_in_motion
└── workspace
└── src
├── blmc_drivers
├── cli_utils
├── googletest
├── mpi_cmake_modules
├── pybind11
├── pybind11_opencv
├── real_time_tools
├── robot_fingers
├── robot_interfaces
├── robot_properties_fingers
├── serialization_utils
├── shared_memory
├── signal_handler
├── time_series
├── trifinger_cameras
├── trifinger_object_tracking
├── trifinger_simulation
└── yaml_utils
Build¶
With Apptainer¶
Go to the workspace
directory (the one containing the src
directory, see
above) and run the container in shell mode (see About Apptainer/Singularity):
apptainer shell -e --no-home --bind=$(pwd) path/to/image.sif
The current working directory gets automatically mounted into the container so you can edit all the files from outside the container using your preferred editor or IDE and all changes will directly be visible inside the container. Vice versa modifications done from inside the container will modify the files on the host system!
Inside the container first set up the environment:
Apptainer> source /setup.bash
This will source the ROS setup.bash and do some other environment setup.
Now you can build with:
Apptainer> colcon build
Without Apptainer¶
Go to the workspace
directory (the one containing the src
directory, see
above) and run
colcon build
This assumes that colcon
and all build dependencies are installed.
Real-Time-Capable Build¶
When running a PREEMPT_RT Linux kernel, this is automatically detected at
build-time and build flags are set accordingly. If you want to make a real-time-capable
build while running a different kernel (e.g. when cross-compiling), you need to
explicitly set the OS_VERSION
:
colcon build --cmake-args -DOS_VERSION=preempt-rt
Note
If you see the following output during initialisation of the robot, this means you are running a non-real-time build.
Warning this thread is not going to be real time.
Run Demo¶
When the build finished successfully, you can run one of the demos to see if everything works.
Before running anything, you need to source the setup.bash
of the
workspace (this needs to be done every time you open a new terminal):
source ./install/setup.bash
As a first test, you can run the “fake robot” demo (which doesn’t need an actual robot to be connected):
ros2 run robot_fingers demo_fake_finger
It should produce output like this:
Position: [299. 598. 897.]
Position: [ 599. 1198. 1797.]
Position: [ 899. 1798. 2697.]
Position: [1199. 2398. 3597.]
Position: [1499. 2998. 4497.]
Position: [1799. 3598. 5397.]
Position: [2099. 4198. 6297.]
You can cancel it with Ctrl+C.
For more demos (including the actual robot), see Getting Started.