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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
clear all;
for num_sequences=1:100
seq_name = sprintf('seq_mimofb_range_%d.txt',num_sequences);
header{1} = '#';
header{2} = '# Description: $description';
header{3} = '# Author: Sequencer Library';
header{4} = '# Date: 2020/02/13';
header{5} = '#';
header{6} = sprintf('# This sequence set the mimofb actuator ranges ScalingFactor times actuator rm kicks');
header{7} = '#';
cnt = 0;
% reset executed flag
for seq=1:num_sequences
cnt = cnt + 1;
blk{cnt} = sprintf('step%d;(write($devfb/ActuatorRangesValues[%d]) = abs(read($devfb/ActuatorRMKickValues[%d]) * read(this/ScalingFactor))) && goto(%d);Setting $devfb actuator %d range;Error setting $devfb actuator %d range;-1',cnt,seq,seq,cnt+1,seq,seq);
end
% dynamic attributes
cnt = 0;
cnt = cnt + 1;
footer{cnt} = 'attr;ScalingFactor;double;0';
fileID = fopen(seq_name,'w');
for i=1:size(header,2)
fprintf(fileID,'%s\n',header{i});
end
for i=1:size(blk,2)
fprintf(fileID,'%s\n',blk{i});
end
for i=1:size(footer,2)
fprintf(fileID,'%s\n',footer{i});
end
fclose(fileID);
end
% Dynamic R/W attributes
%
% attr;ScalingFactor;long;0
% Wildcards
% $description=
% $devfb=
% $actuator_idx_1$=
% $actuator_idx_2$=
% $actuator_idx_3$=
% ........