amino  1.0-beta2
Lightweight Robot Utility Library
test.h
1 /* -*- mode: C; c-basic-offset: 4 -*- */
2 /* ex: set shiftwidth=4 tabstop=4 expandtab: */
3 /*
4  * Copyright (c) 2010-2013, Georgia Tech Research Corporation
5  * All rights reserved.
6  *
7  * Author(s): Neil T. Dantam <ntd@gatech.edu>
8  * Georgia Tech Humanoid Robotics Lab
9  * Under Direction of Prof. Mike Stilman <mstilman@cc.gatech.edu>
10  *
11  *
12  * This file is provided under the following "BSD-style" License:
13  *
14  *
15  * Redistribution and use in source and binary forms, with or
16  * without modification, are permitted provided that the following
17  * conditions are met:
18  *
19  * * Redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer.
21  *
22  * * Redistributions in binary form must reproduce the above
23  * copyright notice, this list of conditions and the following
24  * disclaimer in the documentation and/or other materials provided
25  * with the distribution.
26  *
27  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
28  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
29  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
35  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
36  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39  * POSSIBILITY OF SUCH DAMAGE.
40  *
41  */
42 
43 #ifndef AMINO_TEST_H
44 #define AMINO_TEST_H
45 
46 #include "tf/type.h"
47 
48 AA_API void test( const char *name, int check ) ;
50 AA_API void test_feq( const char *name, double a, double b, double tol );
52 AA_API void test_flt( const char *name, double a, double b, double tol );
54 AA_API void test_fgt( const char *name, double a, double b, double tol );
55 
57 AA_API void afeq( double a, double b, double tol ) ;
59 AA_API void aafeq( const char *name, double a, double b, double tol ) ;
60 
62 AA_API void aveq( const char * name, size_t n, const double *a, const double *b, double tol ) ;
63 
65 AA_API void arveq( const char * name, const double *a, const double *b, double tol );
66 
67 AA_API void aneq( double a, double b, double tol ) ;
68 
69 /* Set limits*/
70 AA_API void aa_test_ulimit( void );
71 
72 /* Set random seed */
73 AA_API void aa_test_args(int argc, char *argv[]);
74 
75 
76 AA_API void aa_test_randv(double min, double max, size_t n, double *p);
77 
78 AA_API void aa_test_quat_cmp(const char *name, const double *q1,
79  const double *q2, double tol);
80 
81 AA_API void aa_test_qutr_cmp(const char *name, const double *E1,
82  const double *E2, double tol);
83 
84 
85 AA_API void aa_test_rotmat_cmp(const char *name, const double *R1,
86  const double *R2, double tol);
87 
88 AA_API void aa_test_tfmat_cmp(const char *name, const double *T1,
89  const double *T2, double tol);
90 
91 AA_API void aa_test_isrotmat(const char *name, const double *R, double tol);
92 
93 /*
94  * Compare two rotation vectors up to angle interval [0,pi]
95  */
96 AA_API void aa_test_rotvec_cmp_pi(const char *name, const double *a,
97  const double *b, double tol);
98 
99 AA_API void aa_test_cmplx_cmp(const char *name, const aa_tf_cmplx v1,
100  const aa_tf_cmplx v2, double tol);
101 
102 AA_API void aa_test_vec2_cmp(const char *name, const aa_tf_vec2 v1,
103  const aa_tf_vec2 v2, double tol);
104 
105 AA_API void aa_test_cotr_cmp(const char *name, const double *E1,
106  const double *E2, double tol);
107 
108 AA_API void aa_test_rotmatp_cmp(const char *name, const double *T1,
109  const double *T2, double tol);
110 
111 AA_API void aa_test_tfmatp_cmp(const char *name, const double *T1,
112  const double *T2, double tol);
113 
114 #endif
#define AA_API
calling and name mangling convention for functions
Definition: amino.h:95
Types for transforms.
double _Complex aa_tf_cmplx
Typedef for C99 complex numbers.
Definition: type.h:57
aa_tf_cmplx aa_tf_vec2
Represent 2D vectors as complex numbers.
Definition: type.h:60