# Draw a circle with a robotic arm?

I believe the technical term for this would be "arm navigation planning with hard dynamic geometric constraints". But my question would be how can I implement trajectory planning of a circle or similar geometric path with a robotic arm?

Using a series of concentrated waypoints in the arm navigation would be one way I would guess. But slow to compute and carry out?

To want to draw a circle or other geometric object with a robotic arm seems fairly fundamental, yet it actually appears to be quite complicated.

edit retag close merge delete

I don't work with arms but I suppose you can set something similar to a nav_msgs/Path sampling your trajectory.

( 2012-08-02 00:03:13 -0500 )edit

Sort by ยป oldest newest most voted

Look at the ROS Scan and Plane application from ROS-Industrial. you can use the Descartes planner for that.

Here is a link to the ROS-Industrial training examples. I just took the training and I made a UR-5 Arm follow a complex trajectory. Getting the robot to move in a circle will be very easy to do. You need to feed the Descartes planner a list of trajectory points for your circle and it will take care of the rest.

http://aeswiki.datasys.swri.edu/rosit...

Review Session 4 and then do Application Demo - Descartes Planning and Execution

that will get you want you need.

more

Pretty much all the code I'm aware of that Willow Garage has produced in the arm navigation space is focused on getting the arm from Point A to Point B, generally in order to perform a manipulation operation. We allow users to impose constraints on the path - keep the end effector upright, for instance - but the path constraints are still designed to condition the path from point A to point B, not change the purpose of the planner.

Having the end effector follow a shape is a different kind of planning problem, one where the purpose is the path, not moving from one point to another, and we really don't have much code for such things. Coverage algorithm - for instance, plan a path that would paint an irregular surface as quickly as possible - are other examples of areas Willow Garage hasn't really focused on. There may be other code in the larger ROS landscape that does such things, but I'm not aware of it.

If I were to attempt to address such problems I'd look at the literature and try a few things out, using some of the lower-level tools from arm_navigation, like collision-checking and inverse kinematics. An approach that might work ok for attempting a geometric path would be to discretize the shape into a series of end effector positions, call IK for each one, and try to interpolate between the poses, making sure that the arm didn't hit joint limits or singularities. This might not give a great path, but could get the job done.

I suspect that general code that would do for coverage/path-focused problems what arm_navigation does for Point to Point travel would be a protracted research/tech-transfer project.

more

I have moved the PR2 arm in "circles", but primarily using waypointss and wayvelocities(?).

more

I use the waypoints by following this Tutorial http://docs.ros.org/indigo/api/pr2_mo...

Note that, you can specify the the interpotion resolution between two consecutive waypoints. Here is my implementation

  //2. Create Cartesian Paths
std::vector<geometry_msgs::Pose> waypoints;
geometry_msgs::Pose ee_point_goal; //end_effector_trajectory
ee_point_goal.orientation.w = 1.0;
ee_point_goal.position.z = 0.8;
// Trajectory parameters (circle)
double d_angle = angle_resolution*3.14/180;
double angle= 0;

//----------------------------------------------------------------------
//3. Plan for the trajectory
for (int i= 0; i< (360/angle_resolution); i++)
{
//discretize the trajectory
angle+= d_angle;
waypoints.push_back(ee_point_goal);
//ROS_INFO("%d",i);
}

ROS_INFO("There are %d number of waypoints", waypoints.size());
// We want cartesian path to be interpolated at a eef_resolution
double jump_threshold = 0.0; //disable the jump threshold =0
moveit_msgs::RobotTrajectory trajectory;
double fraction =plan_group.computeCartesianPath(waypoints, eef_resolution,jump_threshold, trajectory);

ROS_INFO("Visualizing plan 4 (cartesian path) (%.2f%% acheived)",  fraction * 100.0);

more

Hi! I'm following this tutorial you have shared (it looks really helpful), but, the robot only plans the trajectory, it doesn't execute the trajectory, how can I execute it? Usually I use group.move() for moving my robot, but in this case, it doesn't work.

( 2015-11-27 15:05:59 -0500 )edit

You can add the following code to make it move. Hope this help

moveit::planning_interface::MoveGroup::Plan my_plan;
my_plan.trajectory_ = trajectory;
sleep(5.0);
plan_group.execute(my_plan);

( 2015-11-27 16:12:00 -0500 )edit

Thank you very much, indeed it moves; nevertheless, it is very slow.

( 2015-11-30 10:58:58 -0500 )edit

what's the"angle_resolution"mean ,where is its definition?@Freaylucas

( 2016-05-06 01:29:59 -0500 )edit

That is just a constant you set, it means the resolution in degrees you want for the rotational movement; d_angle is the same but in radians. I.e, in this way you set the number of points you want for interpolating your trajectory.

( 2016-05-06 15:25:00 -0500 )edit

@Fredylucas It's just move the first waypoints,not a circle,how to do ?

( 2016-05-14 05:22:27 -0500 )edit