Main Page
Namespaces
Classes
Files
File List
File Members
sensor
sensor_range
rangesensor.cpp
Go to the documentation of this file.
1
#include <
gmapping/sensor/sensor_range/rangesensor.h
>
2
3
namespace
GMapping
{
4
5
RangeSensor::RangeSensor
(std::string name):
Sensor
(name){}
6
7
RangeSensor::RangeSensor
(std::string name,
unsigned
int
beams_num,
double
res,
const
OrientedPoint
& position,
double
span,
double
maxrange
):
Sensor
(name),
8
m_pose
(position),
m_beams
(beams_num){
9
double
angle=-.5*res*beams_num;
10
for
(
unsigned
int
i=0; i<beams_num; i++, angle+=res){
11
RangeSensor::Beam
& beam(
m_beams
[i]);
12
beam.
span
=span;
13
beam.
pose
.
x
=0;
14
beam.
pose
.
y
=0;
15
beam.
pose
.
theta
=angle;
16
beam.
maxRange
=
maxrange
;
17
}
18
newFormat
=0;
19
updateBeamsLookup
();
20
}
21
22
void
RangeSensor::updateBeamsLookup
(){
23
for
(
unsigned
int
i=0; i<
m_beams
.size(); i++){
24
RangeSensor::Beam
& beam(
m_beams
[i]);
25
beam.
s
=sin(
m_beams
[i].pose.theta);
26
beam.
c
=cos(
m_beams
[i].pose.theta);
27
}
28
}
29
30
};
GMapping::orientedpoint::theta
A theta
Definition:
point.h:60
rangesensor.h
GMapping::RangeSensor::RangeSensor
RangeSensor(std::string name)
Definition:
rangesensor.cpp:5
GMapping::RangeSensor::m_beams
std::vector< Beam > m_beams
Definition:
rangesensor.h:30
GMapping::Sensor
Definition:
sensor.h:9
GMapping::RangeSensor::Beam::s
double s
Definition:
rangesensor.h:19
GMapping::RangeSensor::Beam
Definition:
rangesensor.h:15
GMapping::orientedpoint< double, double >
maxrange
double maxrange
Definition:
gfs2stream.cpp:22
GMapping::RangeSensor::updateBeamsLookup
void updateBeamsLookup()
Definition:
rangesensor.cpp:22
GMapping::RangeSensor::m_pose
OrientedPoint m_pose
Definition:
rangesensor.h:29
GMapping::RangeSensor::Beam::c
double c
Definition:
rangesensor.h:19
GMapping
Definition:
carmenwrapper.h:40
GMapping::point::y
T y
Definition:
point.h:16
GMapping::RangeSensor::newFormat
bool newFormat
Definition:
rangesensor.h:27
GMapping::point::x
T x
Definition:
point.h:16
GMapping::RangeSensor::Beam::maxRange
double maxRange
Definition:
rangesensor.h:18
GMapping::RangeSensor::Beam::pose
OrientedPoint pose
Definition:
rangesensor.h:16
GMapping::RangeSensor::Beam::span
double span
Definition:
rangesensor.h:17
openslam_gmapping
Author(s): Giorgio Grisetti, Cyrill Stachniss, Wolfram Burgard
autogenerated on Mon Jun 10 2019 14:04:22