screenCap.py 1.72 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30


import time
pp.dt = 1/30.
pp.speed=0.25
r(pp.client.problem.configAtParam(ps.numberPaths ()-1,0)) 
r.startCapture ("capture/capture","png")
time.sleep(2)
pp(ps.numberPaths ()-1)
#r(pp.client.problem.configAtParam(ps.numberPaths ()-1,pp.client.problem.pathLength(ps.numberPaths() - 1)))
time.sleep(2);
r.stopCapture ()


import time
r(configs[1]) 
r.client.gui.startCapture (0,"capture/capture","png")
time.sleep(2)
player.play()
r(configs[len(configs)-2])
time.sleep(2);
r.client.gui.stopCapture(0)

import time
r(configs[0])
tp.r.startCapture ("capture/capture","png")
time.sleep(2)
player.displayContactPlan(1)
tp.r.stopCapture ()

Pierre Fernbach's avatar
Pierre Fernbach committed
31
32
33
34
35
36
37
import time
r(configs[6])
tp.r.startCapture ("capture/capture","png")
time.sleep(2)
player.play(1/2.)
tp.r.stopCapture ()

38

39
40
41
42
43
44
r(configs[0])
tp.r.startCapture ("capture/capture","png")
time.sleep(2)
play_trajectory(fullBody,pp, trajectory)
time.sleep(1)
tp.r.stopCapture ()
45

46
47
id = r.client.gui.getWindowID("window_hpp_")
r.client.gui.attachCameraToNode( 'hrp2_14/BODY_0',id)
48
49


50
51
52
53
tp.r.startCapture ("capture/capture","png")
tp.r.stopCapture ()


54
55
56
57
r.startCapture ("capture/capture","png")
r.stopCapture ()


58

59
60
61
62
63
gui.startCapture (1,"capture/capture","png")

gui.stopCapture (1)


Pierre Fernbach's avatar
Pierre Fernbach committed
64

65
66
67
68
69
70
71
72
tp.r.startCapture ("capture/capture","png")
time.sleep(1)
pp(int(total_paths_ids[10]))
time.sleep(1)
tp.r.stopCapture ()



73
74
75
"""

## avconv (bash) commands
76
avconv -i capture_0_%d.png  -r 25 -vcodec mpeg4 -filter:v "setpts=2.*PTS" -qscale 1 -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -y hrp2_darpa_cs.mp4
77
78
79
80
81
82
83

avconv -i capture_0_%d.png -r 30 -vcodec mpeg4 -qscale 1 -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 2  hyq_darpa.mp4

avconv -i video.mp4 -vcodec mpeg4 -crf 24 prepare_jump.mp4
rm capture*.png
rm video.mp4
"""