moveit / moveit2

:robot: MoveIt for ROS 2
https://moveit.ai/
BSD 3-Clause "New" or "Revised" License
1.12k stars 536 forks source link

OMPL for under-actuated robotic arms #346

Closed DentOpt closed 9 months ago

DentOpt commented 3 years ago

I am currently integrating a 3DOF robotic arm. Accordingly I would like to have a control only of the arm orientation. If I give the full pose, there is evidently no solution found as the problem is over-constraint. I am currently using ompl with the following C++ interface:

    geometry_msgs::msg::PoseStamped goal;
    goal.header.frame_id="world";
    goal.pose.position.x = 0;
    goal.pose.position.y = 0;
    goal.pose.position.z = 0;
    goal.pose.orientation.x = 1;
    goal.pose.orientation.y = 0;
    goal.pose.orientation.z = 0;
    goal.pose.orientation.w = 0;
    goal.header.frame_id="world";

    arm_->setGoal(goal, std::string("end_effector"));
    const auto plan_solution = arm_->plan();
    if (plan_solution)
    {
      arm_->execute();
    }

Is there a smart way to configure ompl to only track specific axis/rotations (e.g. x,y,yaw) according to the degrees of freedom of the arm?

Thanks

mamoll commented 3 years ago

You could set the position/angle tolerance for the goal with constructGoalConstraints to indicate that error in certain dimensions can be ignored. A constraint generated with this helper function can then be used to set the goal via the moveit_cpp or MoveGroup interface.