Skip to content

Commit

Permalink
use hasBounds terminology instead of isContinuous
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wiznitzer committed Jan 26, 2023
1 parent 2dab231 commit 9f6db75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/bio_ik/robot_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class RobotInfo
std::vector<VariableInfo> variables;
std::vector<size_t> activeVariables;
std::vector<moveit::core::JointModel::JointType> variable_joint_types;
std::vector<bool> continuous_joints;
std::vector<bool> has_bounds;
moveit::core::RobotModelConstPtr robot_model;

__attribute__((always_inline)) static inline double clamp2(double v, double lo, double hi)
Expand Down Expand Up @@ -98,7 +98,7 @@ class RobotInfo
info.max_velocity_rcp = info.max_velocity > 0.0 ? 1.0 / info.max_velocity : 0.0;

variables.push_back(info);
continuous_joints.push_back(!bounded);
has_bounds.push_back(!bounded);
}

for(size_t ivar = 0; ivar < model->getVariableCount(); ivar++)
Expand All @@ -122,7 +122,7 @@ class RobotInfo

inline bool isRevolute(size_t variable_index) const { return variable_joint_types[variable_index] == moveit::core::JointModel::REVOLUTE; }
inline bool isPrismatic(size_t variable_index) const { return variable_joint_types[variable_index] == moveit::core::JointModel::PRISMATIC; }
inline bool isContinuous(size_t variable_index) const { return continuous_joints[variable_index]; }
inline bool hasBounds(size_t variable_index) const { return has_bounds[variable_index]; }
inline double getMaxVelocity(size_t i) const { return variables[i].max_velocity; }
inline double getMaxVelocityRcp(size_t i) const { return variables[i].max_velocity_rcp; }
};
Expand Down
2 changes: 1 addition & 1 deletion src/kinematics_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ struct BioIKKinematicsPlugin : kinematics::KinematicsBase {
state[ivar] = v;

// wrap angles that are not continuous
if(!robot_info.isContinuous(ivar))
if(!robot_info.hasBounds(ivar))
{
auto* joint_model = robot_model->getJointOfVariable(ivar);
joint_model->enforcePositionBounds(state.data() + ivar, joint_model->getVariableBounds());
Expand Down

0 comments on commit 9f6db75

Please sign in to comment.