/usr/include/player-3.0/libpmap/rmap.h is in libpmap3.0-dev 3.0.2+dfsg-4.1ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | /*
pmap: simple mapping utilities
Copyright (C) 2004 Andrew Howard ahoward@usc.edu
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/** @file rmap.h
@brief The rmap library performs relaxation over a set of roughly
aligned laser scans to find the optimal map.
@par Caveats
This library has not yet been optimized, so it please be patient when
using it.
*/
#ifndef RMAP_H
#define RMAP_H
#include "slap.h"
#ifdef __cplusplus
extern "C"
{
#endif
/// Limits
#define RMAP_MAX_RANGES 1024
/// @brief Data for a single scan
typedef struct
{
/// Index of scan (use for indexing vectors during fitting)
int index;
/// Initial (uncorrected) pose.
/// @todo Remove (not very useful).
pose2_t init;
/// Scan pose
pose2_t pose;
/// Correction to pose
pose2_t delta;
/// Raw range list
double ranges[RMAP_MAX_RANGES];
/// List of hit points
int num_hits;
vector2_t hits[RMAP_MAX_RANGES];
} rmap_scan_t;
/// @brief Data for grid cell items; each cell is a linked list of
/// boundary points.
typedef struct rmap_item
{
/// Scan pointer
rmap_scan_t *scan;
/// Position relative to scan
vector2_t local;
/// Position in global frame
vector2_t global;
/// Index of next item
struct rmap_item *next;
} rmap_item_t;
/// @brief Data for a grid cell
typedef struct
{
/// Index of first and last items
rmap_item_t *first, *last;
} rmap_cell_t;
/// @brief Data for a constraint
typedef struct
{
/// Related scans
rmap_scan_t *scan_a, *scan_b;
/// Local points in each scan
vector2_t local_a, local_b;
/// Distance between points
double dist;
} rmap_constraint_t;
/// @brief rmap object data
typedef struct
{
/// Number of range points in each scan
int num_ranges;
/// Maximum accepted range
double range_max;
/// Start angle for scans
double range_start;
/// Angular resolution of scans
double range_step;
/// Maximum distance for matching points
double max_dist;
/// Interval between key-ranges
int range_interval;
/// Interval between key-scans
int key_interval;
/// Scan list
int num_scans, max_scans;
rmap_scan_t *scans;
/// Number of key scans in list
int num_key_scans;
/// Grid dimensions
double grid_res;
int grid_sx, grid_sy, grid_size;
/// Match grid (contains projected boundary points)
rmap_cell_t *grid;
/// Flat list of items from the grid
int num_items, max_items, items_size;
rmap_item_t *items;
/// Constraint list
int num_cons, max_cons;
rmap_constraint_t *cons;
/// Useful counters for keeping stats
int match_count;
double relax_err;
} rmap_t;
/// @brief Allocate object
rmap_t *rmap_alloc(int num_ranges, double range_max,
double range_start, double range_step,
double grid_width, double grid_height);
/// @brief Free object
void rmap_free(rmap_t *self);
/// @brief Add a scan to the map
void rmap_add(rmap_t *self, pose2_t pose, int num_ranges, double *ranges);
/// @brief Match points across scans
void rmap_match(rmap_t *self);
/// @brief Project bounds into the grid
/// @internal
void rmap_match_prepare(rmap_t *self, rmap_scan_t *scan);
/// @brief Match points for a single scan.
/// @internal
void rmap_match_scan(rmap_t *self, rmap_scan_t *scan_a);
/// @brief Relax key-scans
/// @param num_cycles Number of optimization cycles.
void rmap_relax(rmap_t *self, int num_cycles);
/// @brief Interpolate between key-scans
void rmap_interpolate(rmap_t *self);
/// @brief Draw the current map
void rmap_draw_map(rmap_t *self);
/// @brief Draw constraints
void rmap_draw_cons(rmap_t *self);
#ifdef __cplusplus
}
#endif
#endif
|