當前位置: 首頁>>代碼示例>>Python>>正文


Python Viewer.displayRoadmap方法代碼示例

本文整理匯總了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")




開發者ID:pFernbach,項目名稱:hpp_perso,代碼行數:27,代碼來源:xyzAxis.py

示例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)
開發者ID:pFernbach,項目名稱:hpp_dynamic_test,代碼行數:32,代碼來源:testCube.py

示例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
開發者ID:pFernbach,項目名稱:hpp_perso,代碼行數:33,代碼來源:tutorial_2_roadmap.py

示例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')
開發者ID:airobert,項目名稱:hpp_tutorial,代碼行數:33,代碼來源:tutorial_1_roadmap.py

示例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)





開發者ID:pFernbach,項目名稱:hpp_perso,代碼行數:27,代碼來源:testRoadmap.py

示例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)
開發者ID:pFernbach,項目名稱:hpp_perso,代碼行數:33,代碼來源:ur5_2.py


注:本文中的hpp.gepetto.Viewer.displayRoadmap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。