rangesensor.cpp
Go to the documentation of this file.
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;
20 }
21 
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 };
rangesensor.h
GMapping::RangeSensor::RangeSensor
RangeSensor(std::string name)
Definition: rangesensor.cpp:5
GMapping
Definition: configfile.cpp:34
GMapping::RangeSensor::m_beams
std::vector< Beam > m_beams
Definition: rangesensor.h:31
GMapping::RangeSensor::updateBeamsLookup
void updateBeamsLookup()
Definition: rangesensor.cpp:22
GMapping::RangeSensor::Beam::s
double s
Definition: rangesensor.h:20
GMapping::RangeSensor::Beam::span
double span
Definition: rangesensor.h:18
GMapping::RangeSensor::Beam::maxRange
double maxRange
Definition: rangesensor.h:19
GMapping::point::y
T y
Definition: point.h:16
GMapping::Sensor
Definition: sensor.h:10
GMapping::orientedpoint::theta
A theta
Definition: point.h:60
GMapping::RangeSensor::Beam::c
double c
Definition: rangesensor.h:20
GMapping::RangeSensor::Beam
Definition: rangesensor.h:16
GMapping::orientedpoint< double, double >
maxrange
double maxrange
Definition: gfs2stream.cpp:22
GMapping::RangeSensor::newFormat
bool newFormat
Definition: rangesensor.h:28
GMapping::RangeSensor::Beam::pose
OrientedPoint pose
Definition: rangesensor.h:17
GMapping::point::x
T x
Definition: point.h:16


openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Thu Oct 19 2023 02:25:51