Wrapper type for position, velocity, and acceleration limits.
Note that enforcement of finite limits by this class is optional; see the require_finite_*
constructor arguments.
NaNs are rejected for all limits and tolerances.
#include <drake/planning/joint_limits.h>
Public Member Functions | |
JointLimits (const multibody::MultibodyPlant< double > &plant, bool require_finite_positions=false, bool require_finite_velocities=false, bool require_finite_accelerations=false) | |
Constructs a JointLimits using the position, velocity, and acceleration limits in the provided plant . More... | |
JointLimits (const multibody::MultibodyPlant< double > &plant, const DofMask &active_dof, bool require_finite_positions=false, bool require_finite_velocities=false, bool require_finite_accelerations=false) | |
Constructs a JointLimits using the position, velocity, and acceleration limits in the provided plant , selecting only the dofs indicated by active_dof. More... | |
JointLimits (const JointLimits &other, const DofMask &active_dof, bool require_finite_positions=false, bool require_finite_velocities=false, bool require_finite_accelerations=false) | |
Constructs a JointLimits using the position, velocity, and acceleration limits in the provided other , selecting only the coefficients indicated by active_dof. More... | |
JointLimits (const Eigen::VectorXd &position_lower, const Eigen::VectorXd &position_upper, const Eigen::VectorXd &velocity_lower, const Eigen::VectorXd &velocity_upper, const Eigen::VectorXd &acceleration_lower, const Eigen::VectorXd &acceleration_upper, bool require_finite_positions=false, bool require_finite_velocities=false, bool require_finite_accelerations=false) | |
Constructs a JointLimits using the provided arguments. More... | |
JointLimits ()=default | |
Constructs a JointLimits with 0-length vectors for all limits. More... | |
~JointLimits () | |
int | num_positions () const |
int | num_velocities () const |
int | num_accelerations () const |
const Eigen::VectorXd & | position_lower () const |
const Eigen::VectorXd & | position_upper () const |
const Eigen::VectorXd & | velocity_lower () const |
const Eigen::VectorXd & | velocity_upper () const |
const Eigen::VectorXd & | acceleration_lower () const |
const Eigen::VectorXd & | acceleration_upper () const |
bool | CheckInPositionLimits (const Eigen::VectorXd &position, double tolerance=0.0) const |
Checks if position is within position limits, relaxed outward by tolerance in both directions. More... | |
bool | CheckInVelocityLimits (const Eigen::VectorXd &velocity, double tolerance=0.0) const |
Checks if velocity is within velocity limits, relaxed outward by tolerance in both directions. More... | |
bool | CheckInAccelerationLimits (const Eigen::VectorXd &acceleration, double tolerance=0.0) const |
Checks if acceleration is within acceleration limits, relaxed outward by tolerance in both directions. More... | |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
JointLimits (const JointLimits &)=default | |
JointLimits & | operator= (const JointLimits &)=default |
JointLimits (JointLimits &&)=default | |
JointLimits & | operator= (JointLimits &&)=default |
|
default |
|
default |
JointLimits | ( | const multibody::MultibodyPlant< double > & | plant, |
bool | require_finite_positions = false , |
||
bool | require_finite_velocities = false , |
||
bool | require_finite_accelerations = false |
||
) |
Constructs a JointLimits using the position, velocity, and acceleration limits in the provided plant
.
std::exception | if plant is not finalized. |
std::exception | if the position, velocity, or acceleration limits contain non-finite values, and the corresponding constructor argument is true. |
std::exception | if any limit value is NaN. |
JointLimits | ( | const multibody::MultibodyPlant< double > & | plant, |
const DofMask & | active_dof, | ||
bool | require_finite_positions = false , |
||
bool | require_finite_velocities = false , |
||
bool | require_finite_accelerations = false |
||
) |
Constructs a JointLimits using the position, velocity, and acceleration limits in the provided plant
, selecting only the dofs indicated by active_dof.
std::exception | if plant is not finalized. |
std::exception | if active_dof.size() != num_positions(). |
std::exception | if active_dof.size() != num_velocities(). |
std::exception | if active_dof.size() != num_accelerations(). |
std::exception | if the position, velocity, or acceleration limits contain non-finite values, and the corresponding constructor argument is true. |
std::exception | if any limit value is NaN. |
JointLimits | ( | const JointLimits & | other, |
const DofMask & | active_dof, | ||
bool | require_finite_positions = false , |
||
bool | require_finite_velocities = false , |
||
bool | require_finite_accelerations = false |
||
) |
Constructs a JointLimits using the position, velocity, and acceleration limits in the provided other
, selecting only the coefficients indicated by active_dof.
std::exception | if active_dof.size() != other.num_positions(). |
std::exception | if active_dof.size() != other.num_velocities(). |
std::exception | if active_dof.size() != other.num_accelerations(). |
std::exception | if the position, velocity, or acceleration limits contain non-finite values, and the corresponding constructor argument is true. |
std::exception | if any limit value is NaN. |
JointLimits | ( | const Eigen::VectorXd & | position_lower, |
const Eigen::VectorXd & | position_upper, | ||
const Eigen::VectorXd & | velocity_lower, | ||
const Eigen::VectorXd & | velocity_upper, | ||
const Eigen::VectorXd & | acceleration_lower, | ||
const Eigen::VectorXd & | acceleration_upper, | ||
bool | require_finite_positions = false , |
||
bool | require_finite_velocities = false , |
||
bool | require_finite_accelerations = false |
||
) |
Constructs a JointLimits using the provided arguments.
std::exception | if the position, velocity, or acceleration limits contain non-finite values, and the corresponding constructor argument is true. |
std::exception | if any lower/upper limit pairs differ in size. |
std::exception | if any upper limit coefficients are less than the corresponding lower limit coefficient. |
std::exception | if velocity and acceleration limits differ in size. |
std::exception | if any limit value is NaN. |
|
default |
Constructs a JointLimits with 0-length vectors for all limits.
~JointLimits | ( | ) |
const Eigen::VectorXd& acceleration_lower | ( | ) | const |
const Eigen::VectorXd& acceleration_upper | ( | ) | const |
bool CheckInAccelerationLimits | ( | const Eigen::VectorXd & | acceleration, |
double | tolerance = 0.0 |
||
) | const |
Checks if acceleration
is within acceleration limits, relaxed outward by tolerance
in both directions.
std::exception | if acceleration.size() != num_accelerations() . |
std::exception | if tolerance is negative. |
std::exception | if acceleration or tolerance contain NaN values. |
bool CheckInPositionLimits | ( | const Eigen::VectorXd & | position, |
double | tolerance = 0.0 |
||
) | const |
Checks if position
is within position limits, relaxed outward by tolerance
in both directions.
std::exception | if position.size() != num_positions() . |
std::exception | if tolerance is negative. |
std::exception | if position or tolerance contain NaN values. |
bool CheckInVelocityLimits | ( | const Eigen::VectorXd & | velocity, |
double | tolerance = 0.0 |
||
) | const |
Checks if velocity
is within velocity limits, relaxed outward by tolerance
in both directions.
std::exception | if velocity.size() != num_velocities() . |
std::exception | if tolerance is negative. |
std::exception | if velocity or tolerance contain NaN values. |
int num_accelerations | ( | ) | const |
int num_positions | ( | ) | const |
int num_velocities | ( | ) | const |
|
default |
|
default |
const Eigen::VectorXd& position_lower | ( | ) | const |
const Eigen::VectorXd& position_upper | ( | ) | const |
const Eigen::VectorXd& velocity_lower | ( | ) | const |
const Eigen::VectorXd& velocity_upper | ( | ) | const |