calcul.h
Go to the documentation of this file.
1 /**************************************************************************************************
2  Software License Agreement (BSD License)
3 
4  Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted
8  provided that the following conditions are met:
9 
10  *Redistributions of source code must retain the above copyright notice, this list of
11  conditions and the following disclaimer.
12  *Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided
14  with the distribution.
15  *Neither the name of the University of Aveiro nor the names of its contributors may be used to
16  endorse or promote products derived from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***************************************************************************************************/
27 /***************************************************/
28 /* Last Revised:
29 $Id: calcul.h 8465 2009-12-16 00:44:13Z gbiggs $
30 */
31 /***************************************************/
32 /*
33  * This program is free software; you can redistribute it and/or modify
34  * it under the terms of the GNU General Public License as published by
35  * the Free Software Foundation; either version 2 of the License, or
36  * (at your option) any later version.
37  *
38  * This program is distributed in the hope that it will be useful,
39  * but WITHOUT ANY WARRANTY; without even the implied warranty of
40  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41  * GNU General Public License for more details.
42  *
43  * You should have received a copy of the GNU General Public License
44  * along with this program; if not, write to the Free Software
45  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
46  *
47  */
48 
54 #ifndef Calcul
55 #define Calcul
56 
57 #include <stdio.h>
58 #include <math.h>
59 #include "TData.h"
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
65 /*
66  Este fichero tiene operaciones de transformacion de sistemas de referencia,
67  transformaciones de puntos entre sistemas, de paso de coordenadadas polares,
68  a cartesianas y de corte de segmentos
69 
70 */
71 
72 /* --------------------------------------------------------------------------------------- */
73 /* TRANSFORMACIONES DE PUNTO DE UN SISTEMA DE REFERENCIA A OTRO */
74 /* --------------------------------------------------------------------------------------- */
75 
76 /* --------------------------------------------------------------------------------------- */
77 /* transfor_directa_p */
78 /* .... Hace la transformacion directa de un punto a un sistema a otro */
79 /* .... In: (x,y) las coordenadas del punto, sistema es el sistema de referencia */
80 /* .... Out: en sol se devuelve las coordenadas del punto en el nuevo sistema */
81 
82 void transfor_directa_p ( float x, float y, Tsc *sistema, Tpf *sol );
83 
84 /* --------------------------------------------------------------------------------------- */
85 /* transfor_directa_p */
86 /* .... Hace la transformacion directa de un punto a un sistema a otro */
87 /* .... La diferencia es que aqui el punto de entrada es el (0,0) (optimiza la anterior) */
88 /* .... In: (x,y) las coordenadas del punto, sistema es el sistema de referencia */
89 /* .... Out: en sol se devuelve las coordenadas del punto en el nuevo sistema */
90 
91 void transfor_directa_pt0(float x, float y,
92  Tsc *sistema, Tpf *sol);
93 
94 /* --------------------------------------------------------------------------------------- */
95 /* transfor_inversa_p */
96 /* .... Hace la transformacion inversa de un punto a un sistema a otro */
97 /* .... In: (x,y) las coordenadas del punto, sistema es el sistema de referencia */
98 /* .... Out: en sol se devuelve las coordenadas del punto en el nuevo sistema */
99 
100 void transfor_inversa_p ( float x, float y, Tsc *sistema, Tpf *sol );
101 
102 /* --------------------------------------------------------------------------------------- */
103 /* TRANSFORMACIONES DE COMPOSICION E INVERSION DE SISTEMAS DE REFERENCIA */
104 /* --------------------------------------------------------------------------------------- */
105 
106 /* --------------------------------------------------------------------------------------- */
107 /* composicion_sis */
108 /* .... Realiza la composicion de sistemas de referencia en otro sistema */
109 /* .... In: compone sis1 y sis2 */
110 /* .... Out: la salida sisOut es el resultado de la composicion de los sistemas */
111 /* .... Nota: resulta muy importante el orden de las entradas en la composicion */
112 
113 void composicion_sis(Tsc *sis1,Tsc *sis2,Tsc *sisOut);
114 
115 /* --------------------------------------------------------------------------------------- */
116 /* inversion_sis */
117 /* .... Realiza la inversion de un sistema de referencia */
118 /* .... In: sisIn es el sistema a invertir */
119 /* .... Out: sisOut es el sistema invertido */
120 
121 void inversion_sis(Tsc *sisIn, Tsc *sisOut);
122 
123 /* --------------------------------------------------------------------------------------- */
124 /* TRANSFORMACIONES DE PUNTO DE UN SISTEMA DE REFERENCIA A OTRO */
125 /* --------------------------------------------------------------------------------------- */
126 
127 /* --------------------------------------------------------------------------------------- */
128 /* car2pol */
129 /* .... Transforma un punto de coordenadas cartesianas a polares */
130 /* .... In: el punto en coordenadas cartesianas a transformar */
131 /* .... Out: el punto salida en coordenadas polares */
132 
133 void car2pol(Tpf *in, Tpfp *out);
134 
135 /* --------------------------------------------------------------------------------------- */
136 /* pol2car */
137 /* .... Transforma un punto de coordenadas polares a cartesianas */
138 /* .... In: el punto entrada en coordenadas polares a transformar */
139 /* .... Out: el punto en coordenadas cartesianas transformado */
140 
141 void pol2car(Tpfp *in, Tpf *out);
142 
143 /* --------------------------------------------------------------------------------------- */
144 /* TRANSFORMACIONES DE PUNTO DE UN SISTEMA DE REFERENCIA A OTRO */
145 /* --------------------------------------------------------------------------------------- */
146 
147 /* --------------------------------------------------------------------------------------- */
148 /* corte_segmentos */
149 /* .... Calcula el punto de corte entre dos segmentos */
150 /* .... In: las coordenadas de los puntos extremos (x1,y1)-(x2,y2) y (x3,y3)-(x4,y4) */
151 /* .... Out: sol son las coordenadas del punto de corte. return --> 1 si hay corte. -->0 no */
152 
153 int corte_segmentos ( float x1, float y1, float x2, float y2,
154  float x3, float y3, float x4, float y4,
155  Tpf *sol );
156 
157 
158 /* Normaliza el angulo entre [-PI, PI] */
159 float NormalizarPI(float ang);
160 
161 #ifdef __cplusplus
162 }
163 #endif
164 
165 #endif
void pol2car(Tpfp *in, Tpf *out)
Definition: calcul.c:148
void transfor_directa_p(float x, float y, Tsc *sistema, Tpf *sol)
Definition: calcul.c:58
Types used in the MbICP algorithm.
void car2pol(Tpf *in, Tpfp *out)
Definition: calcul.c:142
Definition: TData.h:68
void inversion_sis(Tsc *sisIn, Tsc *sisOut)
Definition: calcul.c:119
void composicion_sis(Tsc *sis1, Tsc *sis2, Tsc *sisOut)
Definition: calcul.c:130
float NormalizarPI(float ang)
Definition: calcul.c:114
Definition: TData.h:84
void transfor_inversa_p(float x, float y, Tsc *sistema, Tpf *sol)
Definition: calcul.c:92
int corte_segmentos(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, Tpf *sol)
Definition: calcul.c:157
void transfor_directa_pt0(float x, float y, Tsc *sistema, Tpf *sol)
Definition: calcul.c:78
Definition: TData.h:74


lidar_egomotion
Author(s): Jorge Almeida
autogenerated on Mon Mar 2 2015 01:32:10