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

How can I move my arm between two points using moveit commandator

asked 2013-10-29 19:17:46 -0500

unais gravatar image

updated 2013-11-14 10:40:37 -0500

tfoote gravatar image


I am created a moveit plugin for my 6DOF arm.And I am trying to move my arm through a line. And I have two end co-ordinates of a line say (x1,y1,z1) and (x2, y2, z2) .

I can able to move to a random pose using

from moveit_commander import MoveGroupCommander

#if name == '__main__':
group = MoveGroupCommander("arm")

# move to a random target

But I am not found a function that helps me to plan between two points.


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-10-29 19:27:44 -0500

lindzey gravatar image

1) here is the code defining the MoveGroupCommander class

2) I'd recommend playing around with this (and any python code that you want to explore) in a REPL that has autocomplete (ipython is good). From there, you can see what functions exist for group by typing group.-[tab] , and what their arguments are by typing group.set_pose_target(-[tab].

3) To answer your direct question, this should work:

group.set_position_target([x, y, z])
edit flag offensive delete link more


Thanks lindzey

unais gravatar image unais  ( 2013-10-29 19:51:22 -0500 )edit

hi lindzy .. I can able to set the target. But how can I know which is the origin (0,0,0)

unais gravatar image unais  ( 2013-10-30 19:36:39 -0500 )edit

answered 2013-10-29 19:42:35 -0500

130s gravatar image

In addition to instructive answer from @lindzey, I've made a sample code (link). Although the document is for a particular 6DOF robot called Hiro, you can play with this sample code on your robot too where MoveGroupCommander.get_random_pose() gives random pose and you can investigate what inside of pose looks like.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2013-10-29 19:17:46 -0500

Seen: 1,021 times

Last updated: Oct 29 '13