本文整理汇总了Python中moveit_commander.MoveGroupCommander.detach_object方法的典型用法代码示例。如果您正苦于以下问题:Python MoveGroupCommander.detach_object方法的具体用法?Python MoveGroupCommander.detach_object怎么用?Python MoveGroupCommander.detach_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moveit_commander.MoveGroupCommander
的用法示例。
在下文中一共展示了MoveGroupCommander.detach_object方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from moveit_commander import MoveGroupCommander [as 别名]
# 或者: from moveit_commander.MoveGroupCommander import detach_object [as 别名]
p1.pose.orientation.z = b1[2]
p1.pose.orientation.w = b1[3]
#glovebox pose
p2.pose.position.x = 0
p2.pose.position.y = 0
p2.pose.position.z = 0.56
b2 = tf.transformations.quaternion_from_euler(1.57,0,0)
p2.pose.orientation.x = b2[0]
p2.pose.orientation.y = b2[1]
p2.pose.orientation.z = b2[2]
p2.pose.orientation.w = b2[3]
#detach/remove current scene objects
print 'removing objects...'
robot.detach_object("bowl")
rospy.sleep(1)
scene.remove_world_object("bowl")
scene.remove_world_object("punch")
scene.remove_world_object("glovebox")
rospy.sleep(2)
#reset the gripper and arm position to home
robot.set_start_state_to_current_state()
robot.set_named_target("start_glove")
robot.go()
gripper.set_start_state_to_current_state()
gripper.go()
#add scene objects
示例2: RobotCommander
# 需要导入模块: from moveit_commander import MoveGroupCommander [as 别名]
# 或者: from moveit_commander.MoveGroupCommander import detach_object [as 别名]
p.pose.position.x = 0.72
p.pose.position.z = 0.05
# add the pen
scene.add_mesh("pen",p,resourcepath+'objects/pen.dae')
rospy.sleep(1)
# print the existing groups
robot = RobotCommander()
print "Available groups: ",robot.get_group_names()
# setup the arm group and its planner
arm = MoveGroupCommander("arm")
arm.set_start_state_to_current_state()
arm.set_planner_id("RRTstarkConfigDefault")
arm.set_planning_time(5.0)
arm.detach_object("pen")
# set the arm to a safe target
arm.set_named_target("gamma")
# plan and execute the motion
arm.go()
# setup the hand group and its planner
hand = MoveGroupCommander("hand")
hand.set_start_state_to_current_state()
hand.set_planner_id("LBKPIECEkConfigDefault")
hand.set_planning_time(10.0)
# set the hand to a safe target
hand.set_named_target("open")
# plan and execute the motion