Hi
I followed the instruction to run the python script to move the UR5 arm. But I met a problem that I can 100% follow the given example with group.go in the simulator. While if I comment that, the trajectory is not complete in the Rviz environment. Below is my code
#! /usr/bin/env python
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("manipulator")
display_trajectory_publisher = rospy.Publisher('/move_group/display_planned_path', moveit_msgs.msg.DisplayTrajectory)
group_variable_values = group.get_current_joint_values()
group_variable_values[1] = 0
group_variable_values[2] = 0
group.set_joint_value_target(group_variable_values)
plan1 = group.plan()
group.go(wait=True)
group_variable_values[1] = -1.5
group_variable_values[2] = 1.5
group.set_joint_value_target(group_variable_values)
plan1 = group.plan()
group.go(wait=True)
group_variable_values[2] = 0
group.set_joint_value_target(group_variable_values)
plan1 = group.plan()
group.go(wait=True)
group_variable_values[1] = -1.5
group_variable_values[2] = 1.5
group.set_joint_value_target(group_variable_values)
plan1 = group.plan()
group.go(wait=True)
group_variable_values[1] = 0
group_variable_values[2] = 0
group.set_joint_value_target(group_variable_values)
plan1 = group.plan()
group.go(wait=True)
rospy.sleep(5)
moveit_commander.roscpp_shutdown()