Only the first waypoint executed in a cartesian path

Hey everyone,

I’m trying to create my own program with the robot arm in the manipulation course, but only the first waypoint is being executed. I’ve attached code. Essentially, when I input multiple position waypoints to be executed at once (x += 2.0 and y+=2.0 for example) it properly moves diagonally, but when I want to move x+=2.0 and then push_back() and then move y+=2.0 and then push_back(), only the first is executed. Does anyone know why this might be? I can’t find the discrepancy between my own program and the exercises I did in the course, which run correctly using multiple waypoints.

Thank you!

Hello @rlgraf ,

Could you please send me your package to aezquerro@theconstruct.ai? This way I’ll be able to test it and check it with more detail.

Best,

Thank you so much! Here is the package. Let me know if it didn’t download or send properly,

Russell

(Attachment moveit2_scripts.tar is missing)

Hello @rlgraf ,

When the whole cartesian path is not executed is because the planner has not been able to compute the complete path. This can be measured with the fraction variable, which indicates the percentage of the Cartesian path that the planner was able to compute successfully. For checking this, you could add the following check to your code:

if (fraction > 0.0) {
  RCLCPP_INFO(LOGGER, "Computed Cartesian Path. Fraction: %f", fraction);
  move_group_arm.execute(trajectory);
  RCLCPP_INFO(LOGGER, "Finished waypoints!");
} else {
  RCLCPP_WARN(LOGGER, "Failed to compute Cartesian Path. Fraction: %f", fraction);
}

In the example code you provided you are using waypoints of ± 2.0. This means 2 meters, which is way too big. Try testing with more reasonable values and check that the planner is able to compute 100% of the path. Besides checking the fraction value, you can also see this in the move group output:

Additionally, I’d recommend you add joint limits to your move group configuration, to avoid the planner providing weird path trajectories, which usually end up in more complex joint configurations (which is going to make the planning harder). For this, you can add the following to your joint_limits.yaml file:

wrist_1_joint:
    has_velocity_limits: true
    max_velocity: 6.2831853071795862
    has_acceleration_limits: false
    max_acceleration: 0
    has_position_limits: true
    min_position: -3.1415926535897931
    max_position: 3.1415926535897931

You’d need to add this to the arm joints, not required for the gripper.

Hope this helps,

@albertoezquerro,

this was very useful information! Thank you very much. With the information you provided me, the robot simply computes the joint positions, and then doesn’t compute any waypoints. With the new error code you suggested I add, I am seeing that the Cartesian Path failed to compute with 0% of the requested trajectory. Do you have any idea why this might be? I have attached the updated package.

Russell

(Attachment moveit2_scripts (3).tar is missing)

Unfortunately, the Construct is telling me via email that my package attachment is not allowed to send.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.