C++ API reference¶
This reference is generated from the C++ headers via Doxygen + Breathe. Documentation
quality tracks the Doxygen comments in the source — types with /** @brief ... */ blocks
render richest. The full namespace is blast::.
Note
Header conversion to Doxygen comments is ongoing. blast_manipulator.hpp is fully
documented; other modules currently expose plain // comments and will improve as
headers are annotated.
Manipulator¶
-
class Manipulator¶
High‐level interface combining limits, kinematics, dynamics, and collision geometry for a manipulator.
Note
Use the constructor to fully specify at least limits and kinematics.
Public Functions
-
Manipulator() = delete¶
-
inline Manipulator(u32 joint_count, const ManipulatorLimits &limits, const ManipulatorKinematics &kinematics, const ManipulatorDynamics *dynamics = nullptr, const ManipulatorCapsules *capsules = nullptr)¶
Construct a GenericManipulator with required data.
- Parameters:
joint_count – Number of joints (excluding fixed).
limits – Mandatory ManipulatorLimits.
kinematics – Mandatory ManipulatorKinematics.
dynamics – Optional pointer to ManipulatorDynamics.
capsules – Optional pointer to ManipulatorCapsules.
-
inline void set_limits(const ManipulatorLimits &limits)¶
Apply provided limits to this manipulator.
- Parameters:
limits – Reference to ManipulatorLimits.
-
inline void set_kinematics(const ManipulatorKinematics &kinematics)¶
Apply provided kinematics to this manipulator.
- Parameters:
kinematics – Reference to ManipulatorKinematics.
-
inline void set_dynamics(const ManipulatorDynamics &dynamics)¶
Apply provided dynamics to this manipulator.
- Parameters:
dynamics – Reference to ManipulatorDynamics.
-
inline void set_capsules(const ManipulatorCapsules &capsules)¶
Apply provided collision capsules to this manipulator.
- Parameters:
capsules – Reference to ManipulatorCapsules.
-
inline void add_tool(const Tool &tool)¶
Attach a tool to this manipulator.
- Parameters:
tool – Tool structure with payload and geometry.
-
inline void set_payload(real m_payload, Vec3 cg_payload, Mat3 I_payload)¶
Add a payload to the last link, adjusting mass and inertia.
- Parameters:
m_payload – Payload mass.
cg_payload – Payload center of mass offset.
I_payload – Payload inertia tensor.
-
Array get_tool_pose() const¶
Update collision capsules in world frame (store internally).
Compute distances for all internal collisions.
Get the current tool pose as [x,y,z,roll,pitch,yaw].
- Returns:
Array of distances between colliding primitives.
- Returns:
Array of six values: position and RPY orientation.
Public Members
-
u32 n_joints = 0¶
-
std::array<real, MAX_JOINTS> position_max = {}¶
-
std::array<real, MAX_JOINTS> position_min = {}¶
-
std::array<real, MAX_JOINTS> velocity_max = {}¶
-
std::array<real, MAX_JOINTS> acceleration_max = {}¶
-
std::array<real, MAX_JOINTS> jerk_max = {}¶
-
std::array<real, MAX_JOINTS> torque_max = {}¶
-
real tool_speed_max = 0.0¶
-
Vec3 base_position = {0, 0, 0}¶
-
Mat3 base_rotation = {1, 0, 0, 0, 1, 0, 0, 0, 1}¶
-
bool has_tool = false¶
-
Vec3 tool_offset = {0, 0, 0}¶
-
Mat3 tool_rotation = {1, 0, 0, 0, 1, 0, 0, 0, 1}¶
-
real tool_mass = 0.0¶
-
Mat3 tool_inertia_tensor = eye()¶
-
Vec3 tool_cog_offset = {0, 0, 0}¶
-
Vec3 first_joint_position = {0, 0, 0}¶
-
std::array<Vec3, MAX_JOINTS> joint_offsets = {}¶
-
std::array<Vec3, MAX_JOINTS> joint_axes = {}¶
-
std::array<Mat3, MAX_JOINTS + 1> static_rotations = {}¶
-
std::array<real, MAX_JOINTS> link_masses = {}¶
-
std::array<Mat3, MAX_JOINTS> inertia_tensors = {}¶
-
std::array<Vec3, MAX_JOINTS> cog_offsets = {}¶
-
std::array<Vec3, MAX_JOINTS> cog_from_next_joint = {}¶
-
int _n_caps = 0¶
-
int _n_internal_collisions = 0¶
-
std::array<CollisionModelCapsule, MAX_CAPSULES> _collision_model = {}¶
-
ObjMatrix<u8> _collision_matrix = {}¶
-
Array _collision_base = {}¶
-
Manipulator() = delete¶
-
struct ManipulatorKinematics¶
Geometric configuration of manipulator joints and base.
-
struct ManipulatorDynamics¶
Dynamic properties of each manipulator link.
-
struct ManipulatorCapsules¶
Collision geometry grouping for manipulator.
-
struct Tool¶
Payload and collision properties of a tool.
World & collision primitives¶
-
struct World¶
Public Functions
-
inline void add_box(Vec3 center_point, Vec3 half_width, Mat3 rotation_matrix)¶
-
inline void add_sphere(Vec3 center_point, real radius)¶
-
inline void add_capsule(Vec3 point1, Vec3 point2, real radius)¶
-
inline void add_dynamic_box(const DynamicBox &box)¶
-
inline void add_dynamic_box(const std::vector<Box> &new_boxes, u32 n_points, real start_time, real end_time)¶
-
inline void add_dynamic_sphere(const DynamicSphere &sphere)¶
-
inline void add_dynamic_sphere(const std::vector<Sphere> &new_spheres, u32 n_points, real start_time, real end_time)¶
-
inline void add_dynamic_capsule(const DynamicCapsule &capsule)¶
Public Members
-
std::vector<DynamicBox> dynamic_boxes¶
-
std::vector<DynamicSphere> dynamic_spheres¶
-
std::vector<DynamicCapsule> dynamic_capsules¶
-
std::vector<DynamicDoor> dynamic_doors¶
-
u32 size = 0¶
-
inline void add_box(Vec3 center_point, Vec3 half_width, Mat3 rotation_matrix)¶
-
struct Box¶
-
struct Sphere¶
-
struct Capsule¶
-
struct DynamicBox¶
-
struct DynamicSphere¶
-
struct DynamicCapsule¶
-
struct DynamicDoor¶
Optimization¶
-
struct Optimization¶
Public Functions
-
Optimization() = delete¶
-
inline Optimization(const Manipulator &new_manip, const Task &new_task)¶
-
inline Optimization(const Manipulator &new_manip, const Task &new_task, const Bspline &new_bspline)¶
-
inline int x_len() const¶
-
inline void set_manip(Manipulator new_manip)¶
-
inline void set_constraints(ConstraintSelection new_constraints)¶
-
Optimization() = delete¶
-
struct Objective¶
Public Functions
-
inline void add_custom_objective(ObjectiveFunction function, real k)¶
Public Members
-
real time_weight = 1.0¶
-
std::vector<real> k_extra_objectives = {}¶
-
std::vector<real (*)(Optimization*)> extra_objectives = {}¶
-
inline void add_custom_objective(ObjectiveFunction function, real k)¶
-
struct Guess¶
Public Types
-
struct ConstraintSelection¶
Public Functions
-
inline void add_constraint(ConstraintFunction, int n_con)¶
Public Members
-
bool position = false¶
-
bool velocity = false¶
-
bool acceleration = false¶
-
bool torque = false¶
-
bool jerk = false¶
-
bool tool_speed = false¶
-
bool self_collisions = false¶
-
bool external_collisions = false¶
-
int n_collision_constraints = 5¶
-
int n_collision_skip = 2¶
-
int n_constraints = 0¶
-
int n_constraints_per_segment = 0¶
-
bool collect_x_each_iteration = false¶
-
std::vector<Array> x_list¶
-
ConstraintFunctionVector extra_constraints = {}¶
-
std::vector<u32> n_extra_constraints = {}¶
-
inline void add_constraint(ConstraintFunction, int n_con)¶
-
struct Result¶
-
Public Members
-
bool success = false¶
-
bool success_false = false¶
-
real compute_time = 0¶
-
Optimization *opt¶
-
Array x¶
-
Array x0¶
-
nlopt_result nlopt_exit_criteria = NLOPT_SUCCESS¶
-
int num_eval = 0¶
-
int num_tries = 0¶
-
Trajectory trajectory¶
-
real max_constraint_value = 0.0¶
-
int max_constraint_idx = 0¶
-
real max_constraint_more_points_value = 0.0¶
-
int max_constraint_more_points_idx = 0¶
-
bool success = false¶
Task & trajectory¶
-
struct Task¶
-
struct Bspline¶
Public Functions
-
inline Bspline() = delete¶
-
inline Bspline(u32 n_control, u32 n_points, u32 degree, u32 n_joints)¶
-
inline explicit Bspline(u32 n_joints)¶
-
inline void compute_trajectory(const Array &x, const Matrix &task)¶
Computes the trajectory of a B-spline curve.
This function computes the trajectory of a B-spline curve given its knots and control points. The knots are passed as an array
xand the control points are passed as a matrixtask. The function first checks that the size ofxis equal to the length oftaskalong the x-axis, and that the number of rows and columns intaskare equal to the number of joints and 6, respectively. Then, it calls thecompute_controlfunction to compute the control points of the B-spline curve. Finally, it computes the position, velocity, and acceleration of each joint at each point along the trajectory using the computed control points and the basis functions for position, velocity, and acceleration.- Parameters:
x – An array of real numbers representing the knots of the B-spline curve.
task – A matrix representing the control points of the B-spline curve.
-
inline u32 x_len(const Matrix &task) const¶
-
inline void compute_basis()¶
-
inline void compute_basis_derivative(int d)¶
-
inline void compute_basis_open()¶
-
inline void compute_control(const Array &x, const Matrix &task, real *dst) const¶
-
inline Bspline() = delete¶
Note
Free functions such as blast::optimize live in blast_optimization.hpp. Once they
carry Doxygen comments, add {doxygenfunction} directives here (a disambiguating
signature is required for overloaded functions).