Controlling a real robot with MoveIt

asked 2018-12-05 07:49:26 -0500

Tim_ros_user gravatar image


I try to control a UR3 with MoveIt. If i set values for every joint or set a pose as a goal everything works great. But i try to move the tool of the robot to a coordinate (x,y,z + orientation) MoveIt calculates every time a new movement. Sometimes MoveIt don't find a solution, sometimes everything is great and sometimes the robot does some very senseless movement (but reaches to goal). For example: the robot just has to move one joint but MoveIt calculates a movement with 2 rotations on the base and every joint....

Is is maybe possible to simple up the movement or to save a movement? Thanks!

my code:

import sys
import copy
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg

rospy.init_node('move_group_python_interface_tutorial', anonymous=True)

robot = moveit_commander.RobotCommander()
scene = moveit_commander.PlanningSceneInterface()    
group = moveit_commander.MoveGroupCommander("arm")
display_trajectory_publisher = rospy.Publisher('/move_group/display_planned_path', moveit_msgs.msg.DisplayTrajectory, queue_size=1)

pose_target = geometry_msgs.msg.Pose()
pose_target.orientation.w = 1.0
pose_target.position.x = 0.96
pose_target.position.y = 0
pose_target.position.z = 1.18

plan1 = group.plan()


edit retag flag offensive close merge delete


Have you tried setting all four elements of the orientation quaternion as well as just w? It's possible you have uninitialised values.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-12-05 09:34:15 -0500 )edit

You also seem quite close to the edge of the working volume of a UR3, so I wouldn't be surprised if some orientation had no solution, and complex moves are required to reach others.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-12-05 09:36:04 -0500 )edit