本文整理汇总了Python中moveit_commander.MoveGroupCommander.set_random_target方法的典型用法代码示例。如果您正苦于以下问题:Python MoveGroupCommander.set_random_target方法的具体用法?Python MoveGroupCommander.set_random_target怎么用?Python MoveGroupCommander.set_random_target使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moveit_commander.MoveGroupCommander
的用法示例。
在下文中一共展示了MoveGroupCommander.set_random_target方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MoveGroupCommander
# 需要导入模块: from moveit_commander import MoveGroupCommander [as 别名]
# 或者: from moveit_commander.MoveGroupCommander import set_random_target [as 别名]
from moveit_commander import MoveGroupCommander
if name == '__main__':
group = MoveGroupCommander("arm")
# move to a random target
group.set_random_target()
group.go()
示例2: req
# 需要导入模块: from moveit_commander import MoveGroupCommander [as 别名]
# 或者: from moveit_commander.MoveGroupCommander import set_random_target [as 别名]
rospy.sleep(1)
####################### POSICION DE GRASP ###############################
pose.pose.position.x = 0.4508
pose.pose.position.y = -0.3605
pose.pose.position.z = 1.1423
pose.pose.orientation.w = 0.6812
pose.pose.orientation.x = -0.21744
pose.pose.orientation.y = 0.65471
pose.pose.orientation.z = 0.24387
pose.header.frame_id = robot.get_planning_frame()
pose.header.stamp = rospy.Time.now()
# move to a random target
group_right.set_random_target()
group_right.set_pose_target(pose, "r_eef")
result = group_right.go(None,1)
if result == 0:
print "ERROR Grasp position"
sys.exit()
####################### CLOSE RIGHT HAND ###############################
scene.remove_world_object("right_shoe")
rospy.sleep(1)
res = req(2,2) # 2 -> Right _hand 2-> Grasp
示例3: MoveGroupCommander
# 需要导入模块: from moveit_commander import MoveGroupCommander [as 别名]
# 或者: from moveit_commander.MoveGroupCommander import set_random_target [as 别名]
groups.append("r_arm")
groups.append("l_arm")
# move_group
move_group_right = MoveGroupCommander("r_arm")
move_group_left = MoveGroupCommander("l_arm")
#Get Current state
state = robot.get_current_variable_values()
####################### INIT POSITION RIGHT ARM ###############################
move_group_right.set_random_target()
result = move_group_right.go(None,0)
####################### INIT POSITION LEFT ARM ###############################
move_group_left.set_random_target()
result = move_group_left.go(None,0)
if result == 0:
print "ERROR Moving"
sys.exit()