Schiebung is german for "shift" as in "shift the frame" or "shift the coordinate system".
Schiebung offers a library which stores transformations (or isometries) between frames. These isometries are between two frames. It is assumed that all frames are either connected or root/leaf nodes. The resulting structure is used to produce any transformation between frames by chaining their transformations. Additionally each pair of frames keeps a history of transformations, this allows a user to ask for transformations in the past, if the exact time cannot be found the transformation between the two best matching times will be interpolated.
The original concept and a far better explanation can be found here: ROS tf It also draws inspiration form the rust implementation for ROS 1 rosrust_tf
The motivation for this package is a missing implementation for Rust in ROS 2.
Design goals
- ROS agnostic library. The core functionality should be usable without any ROS dependencies or knowledge.
- A client server architecture which works without ROS. We want to focus on low latency without remote access.
- Integration into the ROS ecosystem without compromising on the points above.
The project consists of the following crates:
- schiebung-core: data-structures and functions to store and lookup transforms.
- schiebung-client/server: A standalone server which can be accessed by multiple clients which can store and lookup transformations. They interface via iceoryx2 IPC.
- schiebung_ros2: A ROS 2 interface to fill the buffer on a schiebung-server with data while still allowing a client to connect to it without ROS. It also offers a library which fills a buffer locally without any server/client access (The traditional ROS implementation).
For small applications a few local instances of the Buffer are of no concern, however for larger projects it can make sense to limit the amount of subscribers to tf and keep a global buffer.
Currently we use iceoryx2 for inter-process communication.
They claim extremely low latencies. However this has to be evaluated and tested.
However in an integrated system you might already have a ROS-tf2 context and want to use that.
In this case you can use schiebung_ros2: README.
This library is still under development and the API is not considered stable yet.
Crate | Usable | Published |
---|---|---|
schiebung-core | Yes | No |
schiebung-ros2 | Yes | No |
schiebung-client | Yes | No |
schiebung-server | Yes | No |
The client and server are tested for correct results, however until iceoryx2 merges the request/response functionality heavy traffic may cause issues.
git clone [email protected]:MaxiMaerz/schiebung.git
cd schiebung
cargo build
Schiebung can be used as a library or as a client-server application.
This will create a local buffer, this buffer will NOT fill itself!
use schiebung_core::BufferTree;
let buffer = BufferTree::new();
let stamped_isometry = StampedIsometry {
isometry: Isometry::from_parts(
Translation3::new(
1.0,
2.0,
3.0,
),
UnitQuaternion::new_normalize(Quaternion::new(
0.0,
0.0,
0.0,
1.0,
)),
),
stamp: 1.0
};
buffer.update("base_link", "target_link", stamped_isometry, TransformType::Static);
let transform = buffer.lookup_transform("base_link", "target_link", 1.0);
Here the server runs as a standalone process. Clients can connect to the server and request and send transforms.
cargo run --bin schiebung-server
Now the server is running we need to provide transforms, this can be done manually with a client:
Update the server with a new static transform:
cargo run --bin schiebung-client update --from a --to b --tx 1 --ty 0 --tz 0 --qx 0 --qy 0 --qz 0 --qw 1
cargo run --bin schiebung-client update --from b --to c --tx 0 --ty 1 --tz 0 --qx 0 --qy 0 --qz 0 --qw 1
cargo run --bin schiebung-client update --from c --to d --tx 0 --ty 0 --tz 1 --qx 0 --qy 0 --qz 0 --qw 1
cargo run --bin schiebung-client update --from b --to x --tx 1 --ty 1 --tz 1 --qx 0 --qy 0 --qz 0 --qw 1
Request a transform from the server:
cargo run --bin schiebung-client request --from a --to d
Transform:
a -> d:
stamp: 0,
translation: 1.000, -1.000, 1.000,
rotation (xyzw): 0.000, 0.000, -1.000, -0.000,
rotation (rpy): -0.000, -0.000, 3.142
Visualize the transforms:
The default save path is your home directory and may be changed within the server config.
cargo run --bin schiebung-client visualize