34inline bool getJointLimits(urdf::JointConstSharedPtr urdf_joint, JointLimits & limits)
36 if (!urdf_joint || !urdf_joint->limits)
41 limits.has_position_limits =
42 urdf_joint->type == urdf::Joint::REVOLUTE || urdf_joint->type == urdf::Joint::PRISMATIC;
43 if (limits.has_position_limits)
45 limits.min_position = urdf_joint->limits->lower;
46 limits.max_position = urdf_joint->limits->upper;
49 if (!limits.has_position_limits && urdf_joint->type == urdf::Joint::CONTINUOUS)
51 limits.angle_wraparound =
true;
54 limits.has_velocity_limits =
true;
55 limits.max_velocity = urdf_joint->limits->velocity;
57 limits.has_acceleration_limits =
false;
59 limits.has_effort_limits =
true;
60 limits.max_effort = urdf_joint->limits->effort;
71inline bool getSoftJointLimits(urdf::JointConstSharedPtr urdf_joint, SoftJointLimits & soft_limits)
73 if (!urdf_joint || !urdf_joint->safety)
78 soft_limits.min_position = urdf_joint->safety->soft_lower_limit;
79 soft_limits.max_position = urdf_joint->safety->soft_upper_limit;
80 soft_limits.k_position = urdf_joint->safety->k_position;
81 soft_limits.k_velocity = urdf_joint->safety->k_velocity;