File: flat.dem

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (45 lines) | stat: -rw-r--r-- 1,167 bytes parent folder | download | duplicates (2)
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
mode(0);
// Copyright INRIA
xbasc();
getf('SCI/demos/flat/fcts.sci')
getf('SCI/demos/flat/car.sci')

demolist=['Car  ';
          'Two trailers truck ';];
rep=x_message(['Car and truck parking via flatness and frenet formulas';
    'see:'
    '  SCI/demos/flat/fcts.sci'
    'and'
    '  SCI/demos/flat/car.sci'
    'for details'],['Ok','Cancel']);

go_on=rep==1;

while go_on then
  num=x_choose(demolist(:,1),'Choose a vehicle');
  if num==0 then go_on=%f;
  else
     select num
     case 1 then 
       ystr=[ 'x_0'; 'y_0'; 'theta (direction) ';'phi (steering wheel)'];
       rep=x_mdialog(['Choose initial state'],ystr,...
			string([0;4;%pi/3;-%pi/6]));
       if rep<>[] then 
	     xstart=evstr(rep);
	     xbasc();
	     mvcr(xstart(1),xstart(2),xstart(3),xstart(4));
       end 
     case 2 then 
       ystr=[ 'x2';'y2';'theta2 ' ;'theta12';'theta01'; 'phi'];
       rep= x_mdialog(['Choose initial state'],...
                 ystr,string([-2;3;%pi/6;0;0;1]));
       if rep<>[] then 
	     xstart=evstr(rep);
       	     xbasc();
             mvcr2T(xstart(1),xstart(2),xstart(3),xstart(4),xstart(5),...
		xstart(6));
       end
     end;
  end,
end;