Skip to content

Commit

Permalink
handle continuous joints in getLowerAndUpperLimits (#3153)
Browse files Browse the repository at this point in the history
(cherry picked from commit ecd5d30)
  • Loading branch information
marioprats authored and mergify[bot] committed Dec 11, 2024
1 parent be68635 commit bd1a13f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,10 @@ class JointModelGroup

/**
* @brief Get the lower and upper position limits of all active variables in the group.
*
* @return std::pair<Eigen::VectorXd, Eigen::VectorXd> Containing the lower and upper joint limits for all active variables.
* @details In the case of variable without position bounds (e.g. continuous joints), the lower and upper limits are
* set to infinity.
* @return std::pair<Eigen::VectorXd, Eigen::VectorXd> Containing the lower and upper joint limits for all active
* variables.
*/
[[nodiscard]] std::pair<Eigen::VectorXd, Eigen::VectorXd> getLowerAndUpperLimits() const;

Expand Down
6 changes: 4 additions & 2 deletions moveit_core/robot_model/src/joint_model_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,10 @@ std::pair<Eigen::VectorXd, Eigen::VectorXd> JointModelGroup::getLowerAndUpperLim
{
for (const moveit::core::VariableBounds& variable_bounds : *joint_bounds)
{
lower_limits[variable_index] = variable_bounds.min_position_;
upper_limits[variable_index] = variable_bounds.max_position_;
lower_limits[variable_index] =
variable_bounds.position_bounded_ ? variable_bounds.min_position_ : -std::numeric_limits<double>::infinity();
upper_limits[variable_index] =
variable_bounds.position_bounded_ ? variable_bounds.max_position_ : std::numeric_limits<double>::infinity();
variable_index++;
}
}
Expand Down

0 comments on commit bd1a13f

Please sign in to comment.