Robot facade backed by Rust Robot<CppRobotModel>. More...
#include <robot.hpp>
Public Member Functions | |
| Robot (std::size_t dim, std::size_t capacity=0) | |
| Robot (std::size_t dim, InverseDynamics inverse_dynamics, std::size_t capacity=0) | |
| Robot (Robot &&) noexcept | |
| Robot & | operator= (Robot &&) noexcept |
| ~Robot () | |
| Robot (const Robot &)=delete | |
| Robot & | operator= (const Robot &)=delete |
| ConstraintsRef | constraints () noexcept |
| Return a borrowed raw constraint-buffer facade. | |
| std::size_t | dim () const |
| std::size_t | len () const |
| std::size_t | size () const |
| std::size_t | capacity () const |
| bool | is_empty () const |
| std::pair< std::size_t, std::size_t > | idx_s_range () const |
| bool | has_inverse_dynamics () const |
| Return whether a user inverse-dynamics callback is installed. | |
| Robot & | set_inverse_dynamics (InverseDynamics inverse_dynamics) |
| Replace the inverse-dynamics callback. | |
| Robot & | clear_inverse_dynamics () |
| Restore point-mass torque evaluation (tau = ddq). | |
| Robot & | append_s (Span< const double > s) |
| Append strictly increasing path station samples. | |
| Robot & | set_q_2nd (MatrixView q, MatrixView dq, MatrixView ddq, std::size_t idx_s) |
| Store path derivatives up to second order over an existing station interval. | |
| Robot & | set_q_3rd (MatrixView q, MatrixView dq, MatrixView ddq, MatrixView dddq, std::size_t idx_s) |
| Store path derivatives up to third order over an existing station interval. | |
| Robot & | set_q_from_path_2nd (const Path &path, std::size_t idx_s_from, std::size_t idx_s_to) |
| Sample a path and store derivatives up to second order. | |
| Robot & | set_q_from_path_3rd (const Path &path, std::size_t idx_s_from, std::size_t idx_s_to) |
| Sample a path and store derivatives up to third order. | |
| Robot & | add_velocity_limits (Span< const double > upper, Span< const double > lower, std::size_t start_idx_s, std::size_t length=0) |
| Add velocity limits from broadcast vectors. | |
| Robot & | add_velocity_limits (MatrixView upper, MatrixView lower, std::size_t start_idx_s) |
| Add velocity limits from explicit (dim x n) matrices. | |
| Robot & | add_acceleration_limits (Span< const double > upper, Span< const double > lower, std::size_t start_idx_s, std::size_t length=0) |
| Add acceleration limits from broadcast vectors. | |
| Robot & | add_acceleration_limits (MatrixView upper, MatrixView lower, std::size_t start_idx_s) |
| Add acceleration limits from explicit (dim x n) matrices. | |
| Robot & | add_jerk_limits (Span< const double > upper, Span< const double > lower, std::size_t start_idx_s, std::size_t length=0) |
| Add jerk limits from broadcast vectors. | |
| Robot & | add_jerk_limits (MatrixView upper, MatrixView lower, std::size_t start_idx_s) |
| Add jerk limits from explicit (dim x n) matrices. | |
| Robot & | add_torque_limits (Span< const double > upper, Span< const double > lower, std::size_t start_idx_s, std::size_t length=0) |
| Add torque limits from broadcast vectors. | |
| Robot & | add_torque_limits (MatrixView upper, MatrixView lower, std::size_t start_idx_s) |
| Add torque limits from explicit (dim x n) matrices. | |
Friends | |
| const void * | detail::robot_handle (const Robot &robot) noexcept |
| void * | detail::robot_handle_mut (Robot &robot) noexcept |
Robot facade backed by Rust Robot<CppRobotModel>.
By default, torque evaluation uses point-mass dynamics (tau = ddq). Passing or setting an inverse-dynamics callback enables robot-specific torque limits and torque objectives. The callback is owned by Robot and may be replaced or cleared later; any state captured by reference must outlive the robot or the period in which torque-related operations run.
A typical TOPP/COPP setup is:
|
explicit |
| copp::Robot::Robot | ( | std::size_t | dim, |
| InverseDynamics | inverse_dynamics, | ||
| std::size_t | capacity = 0 ) |
|
noexcept |
| copp::Robot::~Robot | ( | ) |
|
delete |
|
noexcept |
Return a borrowed raw constraint-buffer facade.
| std::size_t copp::Robot::dim | ( | ) | const |
| std::size_t copp::Robot::len | ( | ) | const |
| std::size_t copp::Robot::size | ( | ) | const |
| std::size_t copp::Robot::capacity | ( | ) | const |
| bool copp::Robot::is_empty | ( | ) | const |
| std::pair< std::size_t, std::size_t > copp::Robot::idx_s_range | ( | ) | const |
| bool copp::Robot::has_inverse_dynamics | ( | ) | const |
Return whether a user inverse-dynamics callback is installed.
| Robot & copp::Robot::set_inverse_dynamics | ( | InverseDynamics | inverse_dynamics | ) |
Replace the inverse-dynamics callback.
Existing station and constraint data are preserved. Future torque-limit construction and torque objectives use the new callback.
| Robot & copp::Robot::clear_inverse_dynamics | ( | ) |
Restore point-mass torque evaluation (tau = ddq).
Append strictly increasing path station samples.
| Robot & copp::Robot::set_q_2nd | ( | MatrixView | q, |
| MatrixView | dq, | ||
| MatrixView | ddq, | ||
| std::size_t | idx_s ) |
Store path derivatives up to second order over an existing station interval.
Matrices must have shape (dim, n) where n is the number of station columns starting at idx_s. These are the geometric derivatives q(s), dq/ds, and d2q/ds2.
| Robot & copp::Robot::set_q_3rd | ( | MatrixView | q, |
| MatrixView | dq, | ||
| MatrixView | ddq, | ||
| MatrixView | dddq, | ||
| std::size_t | idx_s ) |
Store path derivatives up to third order over an existing station interval.
Adds d3q/ds3, which is required by TOPP3/COPP3 jerk constraints.
| Robot & copp::Robot::set_q_from_path_2nd | ( | const Path & | path, |
| std::size_t | idx_s_from, | ||
| std::size_t | idx_s_to ) |
Sample a path and store derivatives up to second order.
The station samples must already be stored in [idx_s_from, idx_s_to). The path is evaluated at those station values and copied into the robot constraint buffer.
| Robot & copp::Robot::set_q_from_path_3rd | ( | const Path & | path, |
| std::size_t | idx_s_from, | ||
| std::size_t | idx_s_to ) |
Sample a path and store derivatives up to third order.
Use this before adding jerk limits or constructing third-order solver problems.
| Robot & copp::Robot::add_velocity_limits | ( | Span< const double > | upper, |
| Span< const double > | lower, | ||
| std::size_t | start_idx_s, | ||
| std::size_t | length = 0 ) |
Add velocity limits from broadcast vectors.
upper and lower must have length dim. length == 0 means "infer from the currently stored station window starting at `start_idx_s`".
| Robot & copp::Robot::add_velocity_limits | ( | MatrixView | upper, |
| MatrixView | lower, | ||
| std::size_t | start_idx_s ) |
Add velocity limits from explicit (dim x n) matrices.
| Robot & copp::Robot::add_acceleration_limits | ( | Span< const double > | upper, |
| Span< const double > | lower, | ||
| std::size_t | start_idx_s, | ||
| std::size_t | length = 0 ) |
Add acceleration limits from broadcast vectors.
Limits are physical joint-space bounds. COPP maps them into second-order path constraints using the stored q, dq, and ddq.
| Robot & copp::Robot::add_acceleration_limits | ( | MatrixView | upper, |
| MatrixView | lower, | ||
| std::size_t | start_idx_s ) |
Add acceleration limits from explicit (dim x n) matrices.
| Robot & copp::Robot::add_jerk_limits | ( | Span< const double > | upper, |
| Span< const double > | lower, | ||
| std::size_t | start_idx_s, | ||
| std::size_t | length = 0 ) |
Add jerk limits from broadcast vectors.
Requires third-order path derivatives already stored by set_q_3rd or set_q_from_path_3rd.
| Robot & copp::Robot::add_jerk_limits | ( | MatrixView | upper, |
| MatrixView | lower, | ||
| std::size_t | start_idx_s ) |
Add jerk limits from explicit (dim x n) matrices.
| Robot & copp::Robot::add_torque_limits | ( | Span< const double > | upper, |
| Span< const double > | lower, | ||
| std::size_t | start_idx_s, | ||
| std::size_t | length = 0 ) |
Add torque limits from broadcast vectors.
Uses the installed inverse-dynamics callback when present; otherwise uses point-mass dynamics (tau = ddq).
| Robot & copp::Robot::add_torque_limits | ( | MatrixView | upper, |
| MatrixView | lower, | ||
| std::size_t | start_idx_s ) |
Add torque limits from explicit (dim x n) matrices.
|
friend |
|
friend |