当前位置: 首页>>代码示例>>Python>>正文


Python ProblemSolver.configAtParam方法代码示例

本文整理汇总了Python中hpp.corbaserver.ProblemSolver.configAtParam方法的典型用法代码示例。如果您正苦于以下问题:Python ProblemSolver.configAtParam方法的具体用法?Python ProblemSolver.configAtParam怎么用?Python ProblemSolver.configAtParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hpp.corbaserver.ProblemSolver的用法示例。


在下文中一共展示了ProblemSolver.configAtParam方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pp

# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import configAtParam [as 别名]
ps.pathLength(nInitialPath)

#ps.addPathOptimizer('RandomShortcut') #9
#ps.optimizePath (nInitialPath)
#ps.pathLength(ps.numberPaths()-1)

#ps.clearPathOptimizers()
ps.addPathOptimizer("GradientBased")
ps.optimizePath (nInitialPath)
ps.numberPaths()
ps.pathLength(ps.numberPaths()-1)

pp(ps.numberPaths()-1)


ps.configAtParam(2,0.5)
r(ps.configAtParam(0,2))
ps.getWaypoints (0)
ps.getWaypoints (ps.numberPaths()-1)

# plot paths
import numpy as np
dt = 0.1
nPath = ps.numberPaths()-1
lineNamePrefix = "optimized_path"
for t in np.arange(0., cl.problem.pathLength(nPath), dt):
    lineName = lineNamePrefix+str(t)
    r.client.gui.addLine(lineName,[cl.problem.configAtParam(nPath, t)[0],cl.problem.configAtParam(nPath, t)[1],0],[cl.problem.configAtParam(nPath, t+dt)[0],cl.problem.configAtParam(nPath, t+dt)[1],0],[0,1,0.3,1])
    r.client.gui.addToGroup (lineName, r.sceneName)

nPath = nInitialPath
开发者ID:mylene-campana,项目名称:puzzle_description,代码行数:33,代码来源:rotation_optimization.py

示例2: pp

# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import configAtParam [as 别名]
ps.pathLength(0)

ps.addPathOptimizer('RandomShortcut')
ps.optimizePath (0)
ps.pathLength(1)

ps.clearPathOptimizers()
ps.addPathOptimizer("GradientBased")
ps.optimizePath (0)
ps.numberPaths()
ps.pathLength(ps.numberPaths()-1)

pp(ps.numberPaths()-1)


r(ps.configAtParam(0,2))
ps.getWaypoints (0)


# Add light to scene
lightName = "li4"
r.client.gui.addLight (lightName, r.windowId, 0.01, [0.4,0.4,0.4,0.5])
r.client.gui.addToGroup (lightName, r.sceneName)
r.client.gui.applyConfiguration (lightName, [1,0,0,1,0,0,0])
r.client.gui.refresh ()


## Video recording
pp.dt = 0.02
r.startCapture ("capture","png")
#pp(1)
开发者ID:mylene-campana,项目名称:gravity_description,代码行数:33,代码来源:gravity.py

示例3: ProblemSolver

# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import configAtParam [as 别名]
robot.setJointBounds('base_joint_xy', [-kRange, kRange, -kRange, kRange])
ps = ProblemSolver (robot)
cl = robot.client

# q = [x, y, theta] # (z not considered since planar)
q1 = [-2, 0, 1, 0]; q2 = [2, 0, 1, 0]

ps.setInitialConfig (q1); ps.addGoalConfig (q2)
cl.obstacle.loadObstacleModel('potential_description','cylinder_obstacle','')

ps.createOrientationConstraint ("orConstraint", "base_joint_rz", "", [1,0,0,0], [0,0,1]) # OK
ps.setNumericalConstraints ("constraints", ["orConstraint"])

ps.solve ()

ps.configAtParam(0,2)
ps.configAtParam(0,6)
ps.configAtParam(0,13)
ps.getWaypoints (0)[1]

ps.optimizePath(0)
ps.pathLength(0)
ps.pathLength(1)

ps.configAtParam(1,2)
ps.configAtParam(1,6)
ps.configAtParam(1,13)
ps.getWaypoints (1)[1]

len(ps.getWaypoints (0))
cl.problem.getIterationNumber()
开发者ID:mylene-campana,项目名称:potential_description,代码行数:33,代码来源:potential_test_MIX_cylinder.py

示例4: plotSampleSubPath

# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import configAtParam [as 别名]
ps.setInitialConfig (q1); ps.addGoalConfig (q2)
ps.solve () 
# PROBLEM !! not finding solution for environment_3d_window with mu=0.5 V0max=6.5 Projectionshooter ....  V0 or Vimp too much limiting ?? 'cause V0max=7 gives a too "easy" solution ...

samples = plotSampleSubPath (cl, r, 0, 20, "curvy", [0,0.8,0.2,1])

plotConeWaypoints (cl, 0, r, "wp", "friction_cone")

#ps.saveRoadmap ('/local/mcampana/devel/hpp/data/PARAB_envir3d_with_window.rdm')

r.client.gui.setVisibility('robot/l_bounding_sphere',"OFF")

samples = plotSampleSubPath (cl, r, 0, 20, "curvy", [0,0.8,0.2,1])

r(ps.configAtParam(0,0.001))
ps.pathLength(0)
ps.getWaypoints (0)



## 3D Plot tools ##
q0 = [0, 0, 5, 0, 0, 0, 1, 0, 0, 1, 0];
r(q0)

plotFrame (r, "_", [0,0,4], 0.5)

plotPath (cl, 0, r, "pathy", 0.1)

plotThetaPlane (q1, q2, r, "ThetaPlane2")
开发者ID:mylene-campana,项目名称:animals_description,代码行数:31,代码来源:sphere_test.py

示例5: pp

# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import configAtParam [as 别名]
pp (0)
pp (1)

## Video recording
r.startCapture ("capture","png")
pp(1)
r.stopCapture ()
r.startCapture ("capture","png")
pp(2)
r.stopCapture ()
#ffmpeg -r 50 -i capture_0_%d.png -r 25 -vcodec libx264 video.mp4

robot.getJointNames ()
robot.getJointPosition ("torso_lift_joint")
r(ps.configAtParam(0,5))

ps.configAtParam(0,2)[0]
ps.configAtParam(0,6)[0]
ps.configAtParam(0,13)[0]
ps.getWaypoints (0)[1][0]

ps.configAtParam(0,2)[1]
ps.configAtParam(0,6)[1]
ps.configAtParam(0,13)[1]
ps.getWaypoints (0)[1][1]

ps.configAtParam(1,2)[0]
ps.configAtParam(1,6)[0]
ps.configAtParam(1,13)[0]
ps.getWaypoints (1)[1][0]
开发者ID:mylene-campana,项目名称:hpp_tutorial,代码行数:32,代码来源:tutorial_2.py


注:本文中的hpp.corbaserver.ProblemSolver.configAtParam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。