Nav2 Navigation Stack - jazzy
jazzy
ROS 2 Navigation Stack
nav2_amcl
src
map
map.c
1
/*
2
* Player - One Hell of a Robot Server
3
* Copyright (C) 2000 Brian Gerkey & Kasper Stoy
4
* gerkey@usc.edu kaspers@robotics.usc.edu
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
*
20
*/
21
/**************************************************************************
22
* Desc: Global map (grid-based)
23
* Author: Andrew Howard
24
* Date: 6 Feb 2003
25
* CVS: $Id: map.c 1713 2003-08-23 04:03:43Z inspectorg $
26
**************************************************************************/
27
28
#include <assert.h>
29
#include <math.h>
30
#include <stdlib.h>
31
#include <string.h>
32
#include <stdio.h>
33
34
#include "nav2_amcl/map/map.hpp"
35
36
37
// Create a new map
38
map_t
* map_alloc(
void
)
39
{
40
map_t
* map;
41
42
map = (
map_t
*) malloc(
sizeof
(
map_t
));
43
44
// Assume we start at (0, 0)
45
map->origin_x = 0;
46
map->origin_y = 0;
47
48
// Make the size odd
49
map->size_x = 0;
50
map->size_y = 0;
51
map->scale = 0;
52
53
// Allocate storage for main map
54
map->cells = (
map_cell_t
*) NULL;
55
56
return
map;
57
}
58
59
60
// Destroy a map
61
void
map_free(
map_t
* map)
62
{
63
free(map->cells);
64
free(map);
65
}
map_cell_t
Definition:
map.hpp:48
map_t
Definition:
map.hpp:62
Generated by
1.9.1