def exportMotion(self, viewer, configurations, filename): em.exportStates(viewer, self.client.basic.robot, configurations, filename)
## ffmpeg commands ffmpeg -r 50 -i capture_0_%d.png -r 25 -vcodec libx264 video.mp4 x=0; for i in *png; do counter=$(printf %04d $x); ln "$i" new"$counter".png; x=$(($x+1)); done ffmpeg -r 50 -i new%04d.png -r 25 -vcodec libx264 video.mp4 mencoder video.mp4 -channels 6 -ovc xvid -xvidencopts fixed_quant=4 -vf harddup -oac pcm -o video.avi ffmpeg -i untitled.mp4 -vcodec libx264 -crf 24 video.mp4 # --------------------------------------------------------------------# ## Export to Blender ## r.client.gui.writeNodeFile(0, 'scene.osg') # osgconvd -O NoExtras scene.osg scene.dae from hpp.gepetto.blender.exportmotion import exportStates, exportPath exportPath(r, cl.robot, cl.problem, 0, 1, 'path2.txt') exportStates(r, cl.robot, q11, 'configs.txt') from gepettoimport import loadmotion loadmotion('/local/mcampana/devel/hpp/videos/path2.txt') # and rename first node manually ... # --------------------------------------------------------------------# ## DEBUG commands cl.obstacle.getObstaclePosition('decor_base') robot.isConfigValid(q1) robot.setCurrentConfig(q1) res=robot.distancesToCollision() r( ps.configAtParam(0,5) ) ps.optimizePath (0) ps.clearRoadmap () ps.resetGoalConfigs () from numpy import * argmin(robot.distancesToCollision()[0])