Hi!
I try to control a UR3 with MoveIt. So fare everything works.. (controlling the robot with the moveit interface). But i want to control the robot with python code like the code below. But if i try to run this code MoveIt can not find a solution for the robot. So i changed the x/y/z coordinates and the orientation and found one example that works, but only in simulation, not with the real robot. I think the movement is to "complex" for MoveIt.
Do you have any idea how to fix this problem? Or some other possibilities how to control the robot?
My goal is to set some waypoints (x/y/z) and let the robot run ...
import sys
import copy
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
moveit_commander.roscpp_initialize(sys.argv)
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
group.set_pose_target(pose_target)
plan1 = group.plan()
rospy.sleep(5)
moveit_commander.roscpp_shutdown()
↧