Skip to content

Commit 343e956

Browse files
authored
Draw attention to return value of MoveGroupInterface::setJointValueTarget (#96)
* Add comment noting beyond joint limits behavior in setJointValueTarget
1 parent cb19033 commit 343e956

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/examples/move_group_interface/src/move_group_interface_tutorial.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,11 @@ int main(int argc, char** argv)
187187

188188
// Now, let's modify one of the joints, plan to the new joint space goal, and visualize the plan.
189189
joint_group_positions[0] = -1.0; // radians
190-
move_group.setJointValueTarget(joint_group_positions);
190+
bool within_bounds = move_group.setJointValueTarget(joint_group_positions);
191+
if (!within_bounds)
192+
{
193+
RCLCPP_WARN(LOGGER, "Target joint position(s) were outside of limits, but we will plan and clamp to the limits ");
194+
}
191195

192196
// We lower the allowed maximum velocity and acceleration to 5% of their maximum.
193197
// The default values are 10% (0.1).

0 commit comments

Comments
 (0)