Function to create the MOT. The memory area for managing the set of points is created.
|
i32 mot_create (i32 nEl, i32 nInt, i32 sizeOfOther, i32 flag)
|
|
Size in number of points of the MOT (>=1)
|
|
Number of units to be interpolated (ordered) for each point (>= 1)
|
|
Size in bytes of auxiliary information associated with the point (>=0)
|
|
Management flag:
|
|
|
0
|
0x00000001
|
If TRUE, allows insertion of points with any abscissa instead of increasing abscissa (see mot_append())
|
1
|
0x00000002
|
If TRUE, the additional data returned by mv_mot_exec() is referenced to the end point instead of the starting point of the interpolation segment
|
4
|
0x00000010
|
If TRUE, deletes points after execution (point (n-1) is deleted when execution passes point n)
|
Interpolation type value code (Bit 16-:-19, 0x000F00xx):
|
16
|
0x000100xx
|
Linear interpolation
|
17
|
0x000200xx
|
Cubic interpolation with automatic calculation of parameters
|
16-17
|
0x000300xx
|
Cubic interpolation calculated by specifying the value of the first derivative at the point (the velocity, if interpolating positions)
|
18
|
0x000400xx
|
Pentic (fifth-order) interpolation with automatic calculation of parameters
|
16-18
|
0x000500xx
|
Pentic interpolation calculated by specifying the values of the first and second derivatives at the point (the velocity and acceleration, if it is interpolation of positions)
|
16-17-18-19
|
0x000F00xx
|
Mixed interpolation (different for each segment).
The type is specified in the other structure (see mot_append()). The first field of the other structure used in mot_append() must necessarily be of type i32 and contain the type of interpolation: 1=linear, 2=automatic cubic, 4=automatic pent
|
|
|
Returns:
|
|
> 0
|
OK operation.
The value represents the code of the MOT
|
-1
|
Illegal nEl value
|
-2
|
Value nInt illegal
|
-3
|
Excessive nEl value, insufficient memory
|
-4
|
Internal error
|
-8
|
Selected mixed interpolation, but other structure does not exist or has size < sizeOfOther
|
-9
|
Unknown interpolation code
|
|
|
Rule, Task
|
|
|
NOTE: Each memory zone created with mot_create() must be destroyed with a corresponding mot_delete(); next calls to mot_create() create different memory zones.
Example of use:
int flag, flag2
string appo
flag.(0) = 1
flag = flag r_or (0x50000)
rMotID = mot_create(1000, 1, 0, flag)
if(rMotID < 0)
str_format(appo, "Unable to create MOT error code :%d", rMotID)
inf_report(0x100, appo)
rMotID = 0
endif
flag2.(0) = 1
flag2 = flag2 r_or (0x40000)
rMotID2 = mot_create(1000, 1, 0, flag2)
if(rMotID2 < 0)
str_format(appo, "Unable to create MOT2 error code :%d", rMotID2)
inf_report(0x100, appo)
rMotID2 = 0
endif
|
|