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(std::string name)
Definition: rangesensor.cpp:5
std::vector< Beam > m_beams
Definition: rangesensor.h:31
double maxrange
Definition: gfs2stream.cpp:22
OrientedPoint m_pose
Definition: rangesensor.h:30


openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Mon Feb 28 2022 22:59:20