This repository containes commented examples of use for the XBot2.0 real-time middleware for robotics. The IIT-Teleop robot, a 5-dof robotic arm, is provided as testing platform.
- Simulating a robotic system with Gazebo
- Writing a simple control module as an XBot2 Plugin
- Configuring the middleware
- Inter-plugin communication (data streaming, rpc-like)
- Using ROS from a real-time plugin
- Adding a custom device
Standard CMake workflow
mkdir build && cd build
ccmake <path-to-repo>
- select a build type and an install folder (must be visible to the dynamic linker), type
c
and theng
make -j install
- make sure that the robot sdf and meshes are visible to Gazebo; for instance, you can add the following line to your
.bashrc
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:<path-to-repo>/models/database
- set the XBot2 configuration file to the provided example with
set_xbot2_config <path-to-repo>/config/teleop_simple_example.yaml
- point the
XBOT_ROOT
environment variable to the repository folder withexport XBOT_ROOT=<path-to-repo>
(this can also go to the.bashrc
for convenience)
- load the provided
.world
file to Gazebo with the following command:you should now see the robot inside Gazebogazebo <path-to-repo>/world/teleop_xbot2.world
- run XBot2 with
xbot2-core
orxbot2-core --verbose
You should now be able to (for instance)
- get the list of loaded plugins ->
rosservice call /xbotcore/get_plugin_list
- monitor execution time ->
rostopic echo /xbotcore/statistics
- monitor joint state ->
rostopic echo /xbotcore/joint_states
- install docker and set it up so that it does not require sudo permissions
./docker/run.sh
runs the container (the first time it will also download a crazy amount of data!)- to spawn more
bash
sessions inside the same container instance, do./docker/attach.sh
- open three
bash
sessions - terminal #1:
./build-examples.sh
(compiles the source code of this repository; NOTE that the source code is shared with the host machine!) - terminal #1:
./start.sh
(startsroscore
andgazebo
) - terminal #2:
xbot2-core
(XBot2 executable) - terminal #3:
xbot2-gui
(GUI should appear)