geometry.h

Go to the documentation of this file.
00001 /*********************************************************
00002  *
00003  * This source code is part of the Carnegie Mellon Robot
00004  * Navigation Toolkit (CARMEN)
00005  *
00006  * CARMEN Copyright (c) 2002 Michael Montemerlo, Nicholas
00007  * Roy, and Sebastian Thrun
00008  *
00009  * CARMEN is free software; you can redistribute it and/or 
00010  * modify it under the terms of the GNU General Public 
00011  * License as published by the Free Software Foundation; 
00012  * either version 2 of the License, or (at your option)
00013  * any later version.
00014  *
00015  * CARMEN is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied 
00017  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00018  * PURPOSE.  See the GNU General Public License for more 
00019  * details.
00020  *
00021  * You should have received a copy of the GNU General 
00022  * Public License along with CARMEN; if not, write to the
00023  * Free Software Foundation, Inc., 59 Temple Place, 
00024  * Suite 330, Boston, MA  02111-1307 USA
00025  *
00026  ********************************************************/
00027 
00028 
00030 // @{
00031 
00038 #ifndef GLOBAL_GEOMETRY_H
00039 #define GLOBAL_GEOMETRY_H
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044 
00045 void carmen_geometry_compute_centre_and_curvature(carmen_traj_point_t start_point, double theta, 
00046                                                 carmen_traj_point_t end_point,
00047                                                 carmen_traj_point_t *centre, double *radius);
00048 
00049 /* 
00050    Compute the maximum allowable velocity from the current pose of the 
00051    robot, given by robot, constrained by an obstacle at dest_pt, and the
00052    configuration of the robot given by robot_config.
00053 
00054    If the point is behind the robot, then the robot is unconstrained and can
00055    go max_velocity. 
00056 
00057 */
00058 
00059 double carmen_geometry_compute_velocity(carmen_traj_point_t robot, carmen_traj_point_t dest_pt, 
00060                                      carmen_robot_config_t *robot_config);
00061 
00062 double carmen_geometry_compute_radius_and_centre(carmen_traj_point_p prev, carmen_traj_point_p current,
00063                                               carmen_traj_point_p next, carmen_traj_point_p centre,
00064                                               carmen_traj_point_p end_curve);
00065 
00066 void carmen_geometry_move_pt_to_rotating_ref_frame(carmen_traj_point_p obstacle_pt, 
00067                                                  double tv, double rv);
00068 
00069 void carmen_rotate_2d(double *x, double *y, double theta);
00070 
00071 #ifndef COMPILE_WITHOUT_MAP_SUPPORT 
00072 /* 
00073    Project a ray from (x, y) in direction theta to the edge of the map defined
00074    by map_defn. Stores the co-ordinate of the last point in the map in 
00075    (*x2, *y2).
00076 
00077    For example, if the map is 100x100, then project_point(50, 50, M_PI/2) 
00078    should give back (50, 100).
00079    
00080 */
00081 
00082 void carmen_geometry_project_point(int x, int y, double theta, int *x2, int *y2, 
00083                                  carmen_map_config_t map_defn);
00084 
00085 void carmen_geometry_generate_laser_data(float *laser_data, carmen_traj_point_p traj_point,
00086                                        double start_theta, double end_theta, int num_points, 
00087                                        carmen_map_p map);
00088 
00089 void carmen_geometry_generate_sonar_data(double *sonar_data, carmen_traj_point_p center,
00090                                        carmen_point_p sonar_offsets, int num_sonars,
00091                                        carmen_map_p map);
00092 
00093 void carmen_geometry_fast_generate_laser_data(float *laser_data, carmen_traj_point_p traj_point,
00094                                             double start_theta, double end_theta, int num_points, 
00095                                             carmen_map_p map);
00096 
00097 double carmen_geometry_compute_expected_distance(carmen_traj_point_p traj_point, double theta, 
00098                                               carmen_map_p map);
00099 
00100 void carmen_geometry_cache_stats(int *hits, int *misses);
00101 
00102 #define CARMEN_NUM_OFFSETS 8
00103 extern int carmen_geometry_x_offset[];
00104 extern int carmen_geometry_y_offset[];
00105 
00106 void carmen_geometry_map_to_cspace(carmen_map_p map, carmen_robot_config_t *robot_conf);
00107 #endif
00108 
00109 #ifdef __cplusplus
00110 }
00111 #endif
00112 
00113 #endif
00114 // @}
00115 

Generated on Wed Apr 5 18:34:17 2006 for CARMEN by  doxygen 1.4.4