Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[r9133]: code / player / trunk / server / drivers / localization / ekfvloc / localize.hh Maximize Restore History

Download this file

localize.hh    75 lines (65 with data), 2.7 kB

 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
/*
* Player - One Hell of a Robot Server
* Copyright (C) 2010
* Alejandro R. Mosteo
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef LOCALIZE_HH_
#define LOCALIZE_HH_
#include "robot_location.hh"
#include "scan.hh"
#include "segment_map.hh"
class Localize
{
public:
/// Initialize parameters
Localize(double laser_max_range,
double laser_pose_x,
double laser_pose_y,
double laser_pose_angle,
double laser_noise_range, // uncertainty in distance measured (2sigma)
double laser_noise_bearing, // uncertainty in sample bearing (2sigma)
double odom_noise_x,
double odom_noise_y,
double odom_noise_angle // uncertainty for odometry model
);
/// Initialize robot map pose, and reset odometry to zero
void SetRobotPose(double x, double y, double angle);
/// Initialize both odometry (if it is not zero) and global (map) pose
void SetPoses(double ox, double oy, double oth,
double gx, double gy, double gth);
/// Initial pose error
void SetRobotPoseError(double ex, double ey, double eth);
/// Update laser pose (limited to x, y ,a for now, though)
/// m m rad
void SetLaserPose(double x, double y, double a);
void LoadMap(const char* filename);
void SetMap(const SegmentsVector& map);
void AddSegment(const Segment& segment);
const SegmentMap &Map(void) const;
/// Compute actualization from robot accumulated odometry and laser reading
/// Returns true if the update was performed (minimum delta in odometry)
bool Update(double robot_x, double robot_y, double robot_angle,
DoublesVector ranges, DoublesVector bearings);
Pose pose(void) const;
MatrixXd GetCovariance(void) const { return robot_.Covariance(); };
private:
Scan scan_;
RobotLocation robot_;
bool has_pose_;
};
#endif /* LOCALIZE_HH_ */