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

Revision history [back]

click to hide/show revision 1
initial version

Have a look at the MoveGroupCommander - it's how you usually control a robot arm through MoveIt. MoveIt is the component doing path planning with obstacle avoidance and so on. To use it launch ur5_moveit_planning_execution.launch from the urX_moveit_config (or your own MoveIt config). Then in python you'd do something like

from moveit_commander import MoveGroupCommander
cmd = MoveGroupCommander(movegroup)
cmd.set_pose_target(pose)  # to move the endeffector into a specific pose, OR
cmd.set_joint_value_target(joint_values) # if you know the positions the joints should be in
cmd.go()

There are many other useful methods, have a look at them!

Keep in mind that when using set_pose_target, only the endeffector is specified and the rest of the joints will be in a rather random state depending on the solution computed by the inverse kinematic (e.g. elbow down when you really wanted an elbow up pose). To query the IK directly you can use the /compute_ik service.

I recommend using TracIK and configuring the UR driver accordingly since it created the best solutions in my experience (see urX_moveit_config/config/kinematics.yaml). Also you should probably use the driver from here since the current version of the driver tends to move the robot in unexpected ways after a while (jerky movement, position catch ups ignoring speed limits, etc.). You will need to install the industrial_core package as well to use it.

Have a look at the MoveGroupCommander - it's how you usually control a robot arm through MoveIt. MoveIt is the component doing path planning with obstacle avoidance and so on. To use it launch ur5_moveit_planning_execution.launch from the urX_moveit_config (or your own MoveIt config). Then in python you'd do something like

from moveit_commander import MoveGroupCommander
cmd = MoveGroupCommander(movegroup)
cmd.set_pose_target(pose)  # to move the endeffector into a specific pose, OR
cmd.set_joint_value_target(joint_values) # if you know the positions the joints should be in
cmd.go()

There are many other useful methods, have a look at them!

Keep in mind that when using set_pose_target, only the endeffector is specified and the rest of the joints will be in a rather random state depending on the solution computed by the inverse kinematic (e.g. elbow down when you really wanted an elbow up pose). To query the IK directly you can use the /compute_ik service.

I recommend using TracIK and configuring the UR driver accordingly since it created the best solutions in my experience (see urX_moveit_config/config/kinematics.yaml). Also you should probably use the driver from here since the current version of the driver tends to move the robot in unexpected ways after a while (jerky movement, position catch ups ignoring speed limits, etc.). You will need to install the industrial_core package as well to use it.

As an alternative, if you already have a trajectory message ready you could create a SimpleActionClient on the appropriate action-topic to send it.