Class JointLimitsContainer
Defined in File joint_limits_container.h
Class Documentation
-
class JointLimitsContainer
Container for JointLimits, essentially a map with convenience functions. Adds the ability to as for limits and get a common limit that unifies all given limits.
Public Functions
-
bool addLimit(const std::string &joint_name, JointLimit joint_limit)
Add a limit.
- Parameters:
joint_name – Name if the joint this limit belongs to
joint_limit – Limit of the joint
- Returns:
true if the limit was added, false if joint_limit.has_deceleration_limit && joint_limit.max_deceleration >= 0
-
bool hasLimit(const std::string &joint_name) const
Check if there is a limit for a joint with the given name in this container.
- Parameters:
joint_name – Name of the joint
-
size_t getCount() const
Get Number of limits in the container.
- Returns:
Number of limits in the container
-
bool empty() const
Returns whether the container is empty.
- Returns:
true if empty, false otherwise
-
JointLimit getCommonLimit() const
Returns joint limit fusion of all(position, velocity, acceleration, deceleration) limits for all joint. There are cases where the most strict limit of all limits is needed. If there are no matching limits, the flag has_[position|velocity|…]_limits is set to false.
- Returns:
joint limit
-
JointLimit getCommonLimit(const std::vector<std::string> &joint_names) const
Returns joint limit fusion of all(position, velocity, acceleration, deceleration) limits for given joints. There are cases where the most strict limit of all limits is needed. If there are no matching limits, the flag has_[position|velocity|…]_limits is set to false.
- Parameters:
joint_names –
- Throws:
std::out_of_range – if a joint limit with this name does not exist
- Returns:
joint limit
-
JointLimit getLimit(const std::string &joint_name) const
getLimit get the limit for the given joint name
- Parameters:
joint_name –
- Throws:
std::out_of_range – if a joint limit with this name does not exist
- Returns:
joint limit
-
std::map<std::string, JointLimit>::const_iterator begin() const
ConstIterator to the underlying data structure.
- Returns:
-
std::map<std::string, JointLimit>::const_iterator end() const
ConstIterator to the underlying data structure.
- Returns:
-
bool verifyPositionLimit(const std::string &joint_name, double joint_position) const
verify position limit of single joint
- Parameters:
joint_name –
joint_position –
- Returns:
true if within limits, false otherwise
-
bool verifyVelocityLimit(const std::string &joint_name, double joint_velocity) const
verify velocity limit of single joint
- Parameters:
joint_name –
joint_velocity –
- Returns:
true if within limits, false otherwise
-
bool verifyAccelerationLimit(const std::string &joint_name, double joint_acceleration) const
verify acceleration limit of single joint
- Parameters:
joint_name –
joint_acceleration –
- Returns:
true if within limits, false otherwise
-
bool verifyDecelerationLimit(const std::string &joint_name, double joint_acceleration) const
verify deceleration limit of single joint
- Parameters:
joint_name –
joint_acceleration –
- Returns:
true if within limits, false otherwise
Protected Attributes
-
std::map<std::string, JointLimit> container_
Actual container object containing the data.
-
bool addLimit(const std::string &joint_name, JointLimit joint_limit)