ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

User defined grasp pose for pick task

asked 2020-06-12 03:46:00 -0500

Madcreator gravatar image

updated 2020-06-12 04:33:12 -0500

Hi,

I am quite satisfied with the grasp generator that MoveIt task constructor offers, but I wanted to know if and also how it would be possible to define a custom grasp pose instead of a generated one for a pick task.

Normally you would do this stage to create a pick :

{
    // grasp generator
    auto grasp_generator = std::make_unique<stages::GenerateGraspPose>("generate grasp pose left");
    grasp_generator->setAngleDelta(M_PI/4);
    grasp_generator->setPreGraspPose("left_open");
    grasp_generator->setGraspPose("left_close");
    grasp_generator->setMonitoredStage(current_state);

    auto grasp = std::make_unique<stages::SimpleGrasp>(std::move(stage));
    grasp->setIKFrame(Eigen::Affine3d::Identity(), "l_gripper_tool_frame");
    grasp->properties().configureInitFrom(Stage::PARENT);
    grasp->setMaxIKSolutions(10);


    // pick container, using the generated grasp generator
    auto pick = std::make_unique<stages::Pick>(std::move(grasp));
    pick->setProperty("eef", "left_gripper");
    pick->setProperty("object", std::string("object"));
    pick->properties().configureInitFrom(Stage::PARENT);

    geometry_msgs::TwistStamped approach;
    approach.header.frame_id = "l_wrist_roll_link";
    approach.twist.linear.x = 1.0;
    pick->setApproachMotion(approach, 0.01, 0.10);

    geometry_msgs::TwistStamped lift;
    lift.header.frame_id = "base_footprint";
    lift.twist.linear.z =  1.0;
    pick->setLiftMotion(lift, 0.05, 0.10);
    current_state = pick.get();
    t.add(std::move(pick));
}

If I understand well, the grasp generator find possible grasp, these information are given to "SimpleGrasp" that assemble them with IK and gripper movement (in a serial container), then "Pick" is a serial container that compile previous information with approach and lift moves, right ?

I thought that I would need to generate a pose with "GeneratePose" stage (and also set the pregrasp and grasp property "manually") and then give it to "SimpleGrasp" but it doesn't seem to work.

Any idea on how I could use a custom grasp pose instead of using the grasp generator ?

Thanks in advance for the help,

Regards

edit retag flag offensive close merge delete

Comments

I found that I would need to carry all of the "open gripper, approach, close gripper, attach object" manually in a serial container. It seems to work but is there any cleaner/compact way to do this ?

Madcreator gravatar image Madcreator  ( 2020-06-16 10:10:56 -0500 )edit

Could you maybe post your solution, as I am currently also struggling to use the task constructor without generating the grasps?

timtuch96 gravatar image timtuch96  ( 2021-07-28 12:08:10 -0500 )edit
1

I finally managed to add custom poses, you can find the stage here : https://github.com/YannickRiou/moveit...

You can then use it by giving it an array with custom poses (please see the function createDropTask that use the stage "GenerateCustomPose") : https://github.com/YannickRiou/pr2_mt...

Feel free to ask question if something is unclear.

Madcreator gravatar image Madcreator  ( 2021-07-29 03:47:34 -0500 )edit

Thank you very much, I will try it out asap :)

timtuch96 gravatar image timtuch96  ( 2021-07-29 04:12:04 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-07-29 03:48:44 -0500

Madcreator gravatar image

I finally managed to add custom poses, you can find the stage here : https://github.com/YannickRiou/moveit...

You can then use it by giving it an array with custom poses (please see the function createDropTask that use the stage "GenerateCustomPose") : https://github.com/YannickRiou/pr2_mt...

Feel free to ask question if something is unclear.

edit flag offensive delete link more

Question Tools

4 followers

Stats

Asked: 2020-06-12 03:46:00 -0500

Seen: 339 times

Last updated: Jul 29 '21