Robotics StackExchange | Archived questions

Loading a plan to MoveGroupInterface::Plan

Hey all!

I have a set of waypoints on a txt file, which I wanna use to compute a plan. (I'm doing this because Moveit does not reproduce the same path/trajectory when I plan it everytime).

My questions is, how do I load a set of points to Plan and compute a new plan ? For now I have the code below, But i gives a segmentation fault since I'm not able to define the array size to moveit_msgs::RobotTrajectory msg (there is no way to do it)

std::ifstream infile("wet_points.txt");
  ROS_INFO( "Loaded file");

  float a,b,c;

  moveit_msgs::RobotTrajectory msg;  
  msg = my_plan.trajectory_;


  while (infile >> a >> b >> c)
{
    msg.joint_trajectory.points[count].positions[0] = a;
    msg.joint_trajectory.points[count].positions[1] = b;
    msg.joint_trajectory.points[count].positions[2] = c;


}
  my_plan.trajectory_ = msg;
  move_group.plan(my_plan);
  ROS_INFO( "New plan planned");

Asked by pranavb104 on 2019-01-22 02:27:16 UTC

Comments

Have you seen the tutorial? The link points directly to where waypoints are explained.

Asked by aPonza on 2019-01-22 03:40:32 UTC

Im looking at it now! This seems like an option... I have also looked at descartes (http://wiki.ros.org/descartes) . Is this something more promising because as next steps I would have to make reliable repetitive motions with my robot. Let me know

Asked by pranavb104 on 2019-01-22 04:15:39 UTC

I've seen Descartes mentioned here as well (a question you now reminded me also talks about something similar to what you need), but know nothing more, so I can't help on the choice. I'm having myself a challenging time with MoveIt.

Asked by aPonza on 2019-01-22 04:42:18 UTC

Answers