Aerospace Blockset for Xcos  

Aerospace Blockset for Xcos Commit Details

Date:2014-09-13 17:54:33 (4 years 2 months ago)
Author:Paweł Zagórski
Branch:master
Commit:fe506cf29811816e1ec6e042bdaf44714dd02c87
Parents: c528cf6b907d1a05ab93ffd8401aa7739a08e99c
Message:Added CAR_TO_ELL tet

Changes:
Atests/unit_tests/car_to_ell.tst (full)
Atests/unit_tests/car_to_ell.zcos
Mmacros/AB_co_car2ell.sci (1 diff)

File differences

macros/AB_co_car2ell.sci
3333
3434
3535
36
36
3737
3838
3939
case 4 then
// Initialization
AB_check_param_number(block_name, block, 0, 1, 2);
AB_check_param_number(block_name, block, 0, 0, 4);
case 5 then
// Ending
;
tests/unit_tests/car_to_ell.tst
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
// This file is released under the 3-clause BSD license. See COPYING-BSD.
//=================================
// Test flags
//<-- XCOS TEST -->
//<-- NO CHECK ERROR OUTPUT -->
//Load xcos test diagram for car_to_ell tests
[macros,path] = libraryinfo('xcos_aerolib');
result = importXcosDiagram(path + "../tests/unit_tests" +"/car_to_ell.zcos");
assert_checktrue(result);
//This diagram uses 3 variables :
// car_in : cartesian position
// ell_out : elliptical position output vectors (to_workspace)
// jacob_out : jacobian of the transformation (to_workspace)
car_in=[ 0.5;
1;
1.5];
scicos_simulate(scs_m);
// Define expected values
exp_time = [0.1; 1.1; 2.1];
exp_pos = [ 1.1071487
1.5707702
-6356750.1 ];
exp_jacob = [ -0.8 0.4 0
-0.0000104 -0.0000209 6.091D-10
0.0000117 0.0000233 1];
//Validate results
assert_checkequal(exp_time, pos_out.time);
assert_checkequal(exp_time, jacob_out.time);
assert_checkalmostequal(exp_pos', pos_out.values(1,:),1e-4);
assert_checkalmostequal(exp_pos', pos_out.values(2,:),1e-4);
assert_checkalmostequal(exp_pos', pos_out.values(3,:),1e-4);
assert_checkalmostequal(exp_jacob, jacob_out.values(:,:,1),1e-2);
assert_checkalmostequal(exp_jacob, jacob_out.values(:,:,2),1e-2);
assert_checkalmostequal(exp_jacob, jacob_out.values(:,:,3),1e-2);

Archive Download the corresponding diff file

Branches