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


Python Viewer.displayPathMap方法代碼示例

本文整理匯總了Python中hpp.gepetto.Viewer.displayPathMap方法的典型用法代碼示例。如果您正苦於以下問題:Python Viewer.displayPathMap方法的具體用法?Python Viewer.displayPathMap怎麽用?Python Viewer.displayPathMap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在hpp.gepetto.Viewer的用法示例。


在下文中一共展示了Viewer.displayPathMap方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: robot

# 需要導入模塊: from hpp.gepetto import Viewer [as 別名]
# 或者: from hpp.gepetto.Viewer import displayPathMap [as 別名]
#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')


# hide roadmap in the scene
#v.client.gui.removeFromGroup("rmL",v.sceneName)
開發者ID:airobert,項目名稱:hpp_tutorial,代碼行數:33,代碼來源:tutorial_1_roadmap.py


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