C++
Download and Installation
The C++ SDK is distributed as pre-compiled binaries for easy integration.
Supported platforms:
- Linux: x86_64 and aarch64
- Windows: x86_64
- macOS: arm64
Download: Get the binaries here
Installation: Copy the downloaded files to your C++ project and configure your build system to link against the library.
Usage Demo
We provide a demo to get yourself started with the C++ SDK.
What you'll find in the demo:
- Wrench, Twist, IMU and Pose transformer setup and configuration
- Static and dynamic TF entry patterns
- Real-time loop integration examples in C++
API Description
All four transformation utilities follow the same interface pattern.
Each class lives in the bota namespace and is constructed with a path to a
JSON configuration file (see Concept for the config file structure).
BotaTfWrench
Transforms a 6-DOF wrench [fx, fy, fz, tx, ty, tz] between reference points and
expression axes.
-
class bota::BotaTfWrench
Constructor and Destructor
-
explicit BotaTfWrench(const std::string &config_file = "")
Constructs the object. Optionally loads static TF entries from a JSON config file (section key
"tf_wrench_config"). Ifconfig_fileis empty, all entries must be set via the setters descruved below.- Parameters:
config_file – Path to the JSON configuration file (may be empty).
- Type config_file:
const std::string&
-
~BotaTfWrench()
Default destructor.
Metadata
-
const std::string &name() const
Returns the name specified in the JSON config, or an empty string if no config was loaded.
- Rtype:
const std::string&
TF Setters
-
bool setInputReferencePoint(const std::string &origin, const std::array<double, 3> &translation)
Sets the translation from origin to the input reference point (expressed in origin axes).
- Parameters:
origin –
"fixed_frame"or"moving_frame".translation –
[x, y, z]in metres from origin frame to input reference point.
- Returns:
trueon success;falseif this entry was already loaded from JSON.- Rtype:
bool
-
bool setInputExpressionAxes(const std::string &origin, const std::array<double, 4> &rotation)
Sets the rotation from origin to the input expression axes.
- Parameters:
origin –
"fixed_frame"or"moving_frame".rotation –
[qw, qx, qy, qz]unit quaternion rotation from origin frame to input expression axes.
- Returns:
trueon success;falseif this entry was already loaded from JSON.- Rtype:
bool
-
bool setOutputReferencePoint(const std::string &origin, const std::array<double, 3> &translation)
Sets the translation from origin to the output reference point (expressed in origin axes).
- Parameters:
origin –
"fixed_frame"or"moving_frame".translation –
[x, y, z]in metres from origin frame to output reference point.
- Returns:
trueon success;falseif this entry was already loaded from JSON.- Rtype:
bool
-
bool setOutputExpressionAxes(const std::string &origin, const std::array<double, 4> &rotation)
Sets the rotation from origin to the output expression axes.
- Parameters:
origin –
"fixed_frame"or"moving_frame".rotation –
[qw, qx, qy, qz]unit quaternion rotation from origin frame to output expression axes.
- Returns:
trueon success;falseif this entry was already loaded from JSON.- Rtype:
bool
Dynamic TF
-
void setFixedToMovingFrameTf(const std::array<double, 7> &tf)
Pushes the current fixed-to-moving-frame transform. Must be called every loop iteration when any TF entry uses
"moving_frame". Cannot be set via the JSON config.- Parameters:
tf –
[tx, ty, tz, qw, qx, qy, qz]— translation (metres) followed by unit quaternion.
Transform
-
BotaControlReturnCode update(const std::array<double, 6> &wrench_in, std::array<double, 6> &wrench_out)
Transforms the input wrench and writes the result to
wrench_out.- Parameters:
wrench_in – Input wrench
[fx, fy, fz, tx, ty, tz]at the input reference point, expressed in the input expression axes.wrench_out – Output wrench
[fx, fy, fz, tx, ty, tz]at the output reference point, expressed in the output expression axes.
- Returns:
BotaControlReturnCode::OKon success, or a warning/error code according to the configured policy.- Rtype:
BotaControlReturnCode
-
explicit BotaTfWrench(const std::string &config_file = "")
BotaTfPose
Transforms a 7-DOF pose [px, py, pz, qw, qx, qy, qz] between reference points and
expression axes. Uses config key "tf_pose_config".
Note
BotaTfPose does not have a setFixedToMovingFrameTf() method. The
orientation of the moving frame is encoded directly in the input pose quaternion, so
no separate dynamic TF call is needed each loop iteration.
-
class bota::BotaTfPose
Constructor and Destructor
-
explicit BotaTfPose(const std::string &config_file = "")
Constructs the transformer. Optionally loads static TF entries from
"tf_pose_config".- Parameters:
config_file – Path to the JSON configuration file (may be empty).
-
~BotaTfPose()
Metadata
-
const std::string &name() const
TF Setters
-
bool setInputReferencePoint(const std::string &origin, const std::array<double, 3> &translation)
-
bool setInputExpressionAxes(const std::string &origin, const std::array<double, 4> &rotation)
-
bool setOutputReferencePoint(const std::string &origin, const std::array<double, 3> &translation)
-
bool setOutputExpressionAxes(const std::string &origin, const std::array<double, 4> &rotation)
Transform
-
BotaControlReturnCode update(const std::array<double, 7> &pose_in, std::array<double, 7> &pose_out)
Transforms the input pose and writes the result to
pose_out.- Parameters:
pose_in – Input pose
[px, py, pz, qw, qx, qy, qz].pose_out – Output pose
[px, py, pz, qw, qx, qy, qz].
- Rtype:
BotaControlReturnCode
-
explicit BotaTfPose(const std::string &config_file = "")
BotaTfTwist
Transforms a 6-DOF twist [vx, vy, vz, wx, wy, wz] between reference points and
expression axes. The interface is identical to BotaTfWrench — only the config key
("tf_twist_config") and the signal semantics differ.
-
class bota::BotaTfTwist
-
explicit BotaTfTwist(const std::string &config_file = "")
Constructs the transformer. Optionally loads static TF entries from
"tf_twist_config".
-
~BotaTfTwist()
-
const std::string &name() const
-
bool setInputReferencePoint(const std::string &origin, const std::array<double, 3> &translation)
-
bool setInputExpressionAxes(const std::string &origin, const std::array<double, 4> &rotation)
-
bool setOutputReferencePoint(const std::string &origin, const std::array<double, 3> &translation)
-
bool setOutputExpressionAxes(const std::string &origin, const std::array<double, 4> &rotation)
-
void setFixedToMovingFrameTf(const std::array<double, 7> &tf)
-
BotaControlReturnCode update(const std::array<double, 6> &twist_in, std::array<double, 6> &twist_out)
Transforms the input twist and writes the result to
twist_out.- Parameters:
twist_in – Input twist
[vx, vy, vz, wx, wy, wz].twist_out – Output twist
[vx, vy, vz, wx, wy, wz].
- Rtype:
BotaControlReturnCode
-
explicit BotaTfTwist(const std::string &config_file = "")
BotaTfImu
Transforms a 6-DOF IMU signal [ax, ay, az, wx, wy, wz] between reference points and
expression axes, accounting for the centripetal acceleration term when the reference point
changes. The interface is identical to BotaTfWrench — only the config key
("tf_imu_config") and the signal semantics differ.
-
class bota::BotaTfImu
-
explicit BotaTfImu(const std::string &config_file = "")
Constructs the transformer. Optionally loads static TF entries from
"tf_imu_config".
-
~BotaTfImu()
-
const std::string &name() const
-
bool setInputReferencePoint(const std::string &origin, const std::array<double, 3> &translation)
-
bool setInputExpressionAxes(const std::string &origin, const std::array<double, 4> &rotation)
-
bool setOutputReferencePoint(const std::string &origin, const std::array<double, 3> &translation)
-
bool setOutputExpressionAxes(const std::string &origin, const std::array<double, 4> &rotation)
-
void setFixedToMovingFrameTf(const std::array<double, 7> &tf)
-
BotaControlReturnCode update(const std::array<double, 6> &imu_in, std::array<double, 6> &imu_out)
Transforms the input IMU signal and writes the result to
imu_out.- Parameters:
imu_in – Input IMU signal
[ax, ay, az, wx, wy, wz](m/s² and rad/s).imu_out – Output IMU signal
[ax, ay, az, wx, wy, wz].
- Rtype:
BotaControlReturnCode
-
explicit BotaTfImu(const std::string &config_file = "")