Robotics StackExchange | Archived questions

Unable to plan motion for panda hand

Here is the relevant code

  moveit::planning_interface::MoveGroupInterface hand_group("hand");

  const robot_state::JointModelGroup* joint_model_group =
      hand_group.getCurrentState()->getJointModelGroup("hand");

  moveit::core::RobotStatePtr current_state = hand_group.getCurrentState();

  std::vector<double> joint_group_positions;
  current_state->copyJointGroupPositions(joint_model_group, joint_group_positions);

  joint_group_positions[0] = 0.2;
  joint_group_positions[1] = 0.2;

  hand_group.setJointValueTarget(joint_group_positions);

  bool success = (hand_group.plan(my_plan) == moveit::planning_interface::MoveItErrorCode::SUCCESS);
  if (success)
  {
    hand_group.move();
  }

The error that I am getting is:

[ INFO] [1528546088.759251274]: Loading robot model 'panda'...
[ INFO] [1528546088.879916832]: Loading robot model 'panda'...
[ INFO] [1528546089.928447024]: Ready to take commands for planning group panda_arm.
[ INFO] [1528546091.680119770]: Ready to take commands for planning group hand.
[ WARN] [1528546093.292230343]: Fail: ABORTED: No motion plan found. No execution attempted.

thank you in advance

Asked by Ridhwanluthra on 2018-06-09 07:42:44 UTC

Comments

Answers

There is multiple things wrong with this question / code.

  1. Please write in full sentences and explain what you want to achieve and what moveit configuration you use. Also include links to the repositories. Otherwise nobody understands what you mean.

I believe you are using https://github.com/frankaemika/franka_ros and https://github.com/ros-planning/panda_moveit_config .

I have no idea what you are trying to achieve.

The code is overly redundant and can be reduced to less lines of code.

  1. you apparently try to control the hand group of the robot, which consists of two prismatic joints defined here. As can be seen in the line pointed out in the link, the upper joint limits of both are 0.04m. You specify a target position of 0.2m per joint. The gripper cannot open that wide, so the plan request fails. You probably see an output like "No valid goal state sampled" in the terminal where you started moveit.

  2. You don't need current_state at all - nor do you need a moveit::core::RobtState anywhere. You could just specify your target as hand_group.setJointValueTarget(std::vector<double> {0.04,0.04}) or similar.

  3. The way you use plan and move suggests you expect move to execute the plan you generated before. This is not the case. As a matter of fact the logic you implement here is equivalent to just calling move() without plan before.

Asked by v4hn on 2018-06-10 10:38:44 UTC

Comments

I don't understand point 3: I believe he was following the MoveIt! tutorials (this). Why is move not using the generated plan?

Asked by aPonza on 2018-09-27 07:31:37 UTC

my_plan in that code is never actually used for moving the robot, only for visualisation using moveit_visual_tools.

Asked by gvdhoorn on 2018-09-27 07:39:06 UTC

I see, he should have called hand_group.execute(my_plan); to move according to the planned plan. Thanks!

Asked by aPonza on 2018-09-27 08:02:47 UTC

As far as I understand, hand_group.execute(my_plan); is used for Cartesian paths. I have used point 2 with success with move() afterwards, and as stated before, MoveIt! tutorials present a similar code. I don't think the code is equivalent to just calling move() without plan before as point 3 suggests.

Edit 17/07/2019 After reading the class documentation I found that:

move() = plan(new_plan) + execute(new_plan) so point 3 is correct. It is important to notice that move() creates and executes a new plan every time, therefore plan(my_plan) is a different path which can be the same occasionally.

It is also worth noting that execute(some_plan) will not allow the control of velocity and acceleration if used with a real robot as stated here.

Asked by byque on 2019-07-10 10:08:08 UTC