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") plotCone (q1, cl, r, 0.5, 0.4, "c1") plotCone (q2, cl, r, 0.5, 0.4, "c2") index = cl.robot.getConfigSize () - cl.robot.getExtraConfigSize () q = qa[::] q = [-4.77862,-1.56995,2.87339,-0.416537,-0.469186,-0.619709,0.471511,-0.197677,-0.0998335,0.97517,0.619095] qprojCorba=[-4.778619492059025, -1.5699444231861588, 2.873387956706481, 0.9470998051218645, 0.017748399125124163, -0.10999926666084152, 0.3009769340010935, -0.19767685053184691, -0.0998334947491579, 0.9751703113251448, 0.619095] plotStraightLine ([q [index],q [index+1],q [index+2]], q, r, "normale2") plotConeWaypoints (cl, 0, r, 0.5, 0.4, "wpcones") wp = cl.problem.getWaypoints (0) for i in np.arange(0, len(wp), 1): plotCone (wp[i], cl, r, 0.5, 0.4, "wpcones"+str(i))
ps.setInitialConfig (q1); ps.addGoalConfig (q2); ps.solve () # Load box obstacle in HPP for collision avoidance #cl.obstacle.loadObstacleModel('puzzle_description','decor_very_easy','') r( ps.configAtParam(0,2) ) ps.pathLength(0) ps.getWaypoints (0) cl.problem.generateValidConfig(2) plotPath (cl, 0, r, "pathy", 0.1) # time-step should depend on sub-path length ? plotFrame (r, "framy", [0,0,1], 0.5) plotThetaPlane (qt1, qt2, r, "ThetaPlane2") q = q1[::] plotStraightLine ([q[index], q[index+1], q[index+2]], q, r, "normale") plotCone (q1, cl, r, 0.5, 0.2, "cone1") r.startCapture ("capture","png") pp(1) r.stopCapture () #ffmpeg -r 50 -i capture_0_%d.png -r 25 -vcodec libx264 video.mp4 ## DEBUG commands cl.obstacle.getObstaclePosition('decor_base') robot.getJointOuterObjects('base_joint_xyz') robot.isConfigValid(q1)