本文整理汇总了Python中hpp.gepetto.Viewer.displayRoadmap方法的典型用法代码示例。如果您正苦于以下问题:Python Viewer.displayRoadmap方法的具体用法?Python Viewer.displayRoadmap怎么用?Python Viewer.displayRoadmap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hpp.gepetto.Viewer
的用法示例。
在下文中一共展示了Viewer.displayRoadmap方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from hpp.gepetto import Viewer [as 别名]
# 或者: from hpp.gepetto.Viewer import displayRoadmap [as 别名]
ps.selectPathPlanner("rrtPerso")
print("Debut motion planning")
ps.setInitialConfig (q_init)
ps.addGoalConfig (q_goal)
v.solveAndDisplay(white,0.02,1,yellow)
ps.solve ()
v.displayRoadmap(white,0.02,1,yellow)
v.client.gui.addXYZaxis("test0",white,0.05,1)
v.client.gui.addToGroup("test0",v.sceneName)
pp = PathPlayer (robot.client, v)
#print("affichage solution")
#pp (0)
print("affichage solution optimise")
示例2: Robot
# 需要导入模块: from hpp.gepetto import Viewer [as 别名]
# 或者: from hpp.gepetto.Viewer import displayRoadmap [as 别名]
orange=[1,0.42,0,1]
robot = Robot ('box')
robot.setJointBounds ("base_joint_xyz", [0,5,0,2,0,2])
robot.client.robot.setDimensionExtraConfigSpace(robot.getNumberDof()) # extraDof for velocitiy
ps = ProblemSolver (robot)
ps.selectPathPlanner("dyn")
v = Viewer (ps)
#v.loadObstacleModel ("iai_maps", "tunnel", "tunnel")
v.loadObstacleModel ("iai_maps", "abstract", "abstract")
q_init = [0,1,1,1,0,0,0]
q_goal = [5,1,1,0.9239,0,-0.3827,0]
v (q_init)
ps.setInitialConfig (q_init)
ps.addGoalConfig (q_goal)
ps.addPathOptimizer ("RandomShortcut")
ps.solve ()
v.displayRoadmap("rmB",white,0.01,1,green)
pp = PathPlayer (robot.client, v)
pp (0)
pp (1)
示例3: robot
# 需要导入模块: from hpp.gepetto import Viewer [as 别名]
# 或者: from hpp.gepetto.Viewer import displayRoadmap [as 别名]
rank = robot.rankInConfiguration ['r_shoulder_lift_joint']
q_goal [rank] = 0.5
rank = robot.rankInConfiguration ['r_elbow_flex_joint']
q_goal [rank] = -0.5
#r (q_goal)
v.loadObstacleModel ("iai_maps", "kitchen_area", "kitchen")
ps.setInitialConfig (q_init)
ps.addGoalConfig (q_goal)
#ps.selectPathPlanner("rrtConnect")
ps.solve ()
# display roadmap for the base of the robot (no specified joint)
v.displayRoadmap("rmB",white,0.02,1,brown)
# hide previous roadmap
v.client.gui.removeFromGroup("rmB",v.sceneName)
#display roadmap for the tools :
v.displayRoadmap("rmR",blue,0.02,1,green,'r_gripper_tool_joint')
v.displayRoadmap("rmL",red,0.02,1,grey,'l_gripper_tool_joint')
# alternative method : replace ps.solve() and v.displayRoadmap() with :
# v.solveAndDisplay("rmR",2,blue,0.02,1,green,'r_gripper_tool_joint')
# v.displayRoadmap("rmL",red,0.02,1,grey,'l_gripper_tool_joint')
################################################################
pp = PathPlayer (robot.client, v)
#display path
示例4: robot
# 需要导入模块: from hpp.gepetto import Viewer [as 别名]
# 或者: from hpp.gepetto.Viewer import displayRoadmap [as 别名]
rank = robot.rankInConfiguration ['r_shoulder_lift_joint']
q_goal [rank] = 0.5
rank = robot.rankInConfiguration ['r_elbow_flex_joint']
q_goal [rank] = -0.5
#v (q_goal)
v.loadObstacleModel ("iai_maps", "kitchen_area", "kitchen")
ps.setInitialConfig (q_init)
ps.addGoalConfig (q_goal)
ps.addPathOptimizer ("RandomShortcut")
ps.solve ()
# display roadmap for the base of the robot (no specified joint)
# displayRoadmap(name ,sizeNode)
v.displayRoadmap("rmB",0.02)
# display the path found in the roadmap :
# displayPathMap(name,pathID,sizeNode) or :
# displayPathMap(name,pathID,sizeNode,sizeAxis,colorNode,colorEdge,JointName)
v.displayPathMap("rmPath",0,0.03)
# hide previous roadmap
v.client.gui.removeFromGroup("rmB",v.sceneName)
v.client.gui.removeFromGroup("rmPath",v.sceneName)
# display roadmap for the tools, the full prototype is :
# displayRoadmap(name,sizeNode,sizeAxis,colorNode,colorEdge,JointName)
# The joint defined by "jointName" (see robot.getAllJointNames()) is used to compute the position of the node of the roadmap
# You can use the colors defined in viewer.color or give an array of 4 float which define a normalized RGBA color
v.displayRoadmap("rmR",0.02,1,v.color.blue,v.color.lightBlue,'r_gripper_tool_joint')
v.displayRoadmap("rmL",0.02,1,v.color.green,v.color.lightGreen,'l_gripper_tool_joint')
示例5: v
# 需要导入模块: from hpp.gepetto import Viewer [as 别名]
# 或者: from hpp.gepetto.Viewer import displayRoadmap [as 别名]
#6 7 pour en dehors de la zone
v (q_init)
q_goal = q_init [::]
q_goal [0:3] = [-2.5, -3.5, 0.5]
#v (q_goal)
print("chargement map")
v.loadObstacleModel ("iai_maps", "room", "room")
ps.setInitialConfig (q_init)
ps.addGoalConfig (q_goal)
ps.selectPathPlanner("rrtPerso")
v.solveAndDisplay(white,0.02,1,brown)
ps.solve ()
v.displayRoadmap(white,0.02,1,brown)
pp = PathPlayer (robot.client, v)
print("affichage solution")
pp (0)
print("affichage solution optimise")
pp (1)
示例6: robot
# 需要导入模块: from hpp.gepetto import Viewer [as 别名]
# 或者: from hpp.gepetto.Viewer import displayRoadmap [as 别名]
q_goal [rank] = -1.778
rank = robot.rankInConfiguration ['wrist_2_joint']
q_goal [rank] = -1.607
#r (q_goal)
v.loadObstacleModel ("iai_maps", "kitchen_area", "kitchen")
ps.setInitialConfig (q_init)
ps.addGoalConfig (q_goal)
#ps.selectPathPlanner("rrtConnect")
ps.solve ()
# display roadmap for the base of the robot (no specified joint)
v.displayRoadmap("rmB",white,0.02,1,brown)
# hide previous roadmap
v.client.gui.removeFromGroup("rmB",v.sceneName)
#display roadmap for the tools :
v.displayRoadmap("rmEND",blue,0.02,1,green,'ee_fixed_joint')
# alternative method : replace ps.solve() and v.displayRoadmap() with :
# v.solveAndDisplay("rmB",2,white,0.02,1,brown)
################################################################
pp = PathPlayer (robot.client, v)
#display path
pp (0)