g2o
Loading...
Searching...
No Matches
g2o::RobotLaser Class Reference

laser measurement obtained by a robot More...

#include <robot_laser.h>

Inheritance diagram for g2o::RobotLaser:
Collaboration diagram for g2o::RobotLaser:

Public Member Functions

 RobotLaser ()
 ~RobotLaser ()
virtual bool write (std::ostream &os) const
 write the data to a stream
virtual bool read (std::istream &is)
 read the data from a stream
SE2 laserPose () const
const SE2 & odomPose () const
void setOdomPose (const SE2 &odomPose)
Public Member Functions inherited from g2o::RawLaser
 RawLaser ()
 ~RawLaser ()
Point2DVector cartesian () const
const std::vector< double > & ranges () const
 the range measurements by the laser
void setRanges (const std::vector< double > &ranges)
const std::vector< double > & remissions () const
 the remission measurements by the laser
void setRemissions (const std::vector< double > &remissions)
const LaserParameters & laserParams () const
 the parameters of the laser
void setLaserParams (const LaserParameters &laserParams)
Public Member Functions inherited from g2o::RobotData
 RobotData ()
virtual ~RobotData ()
double timestamp () const
void setTimestamp (double ts)
double loggerTimestamp () const
void setLoggerTimestamp (double ts)
const std::string & tag () const
void setTag (const std::string &tag)
const std::string & hostname () const
void setHostname (const std::string &hostname)
Public Member Functions inherited from g2o::HyperGraph::Data
 Data ()
 ~Data ()
virtual HyperGraph::HyperGraphElementType elementType () const
const Data * next () const
Data * next ()
void setNext (Data *next_)
DataContainer * dataContainer ()
const DataContainer * dataContainer () const
void setDataContainer (DataContainer *dataContainer_)
Public Member Functions inherited from g2o::HyperGraph::HyperGraphElement
virtual ~HyperGraphElement ()

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Protected Attributes

SE2 _odomPose
double _laserTv
 velocities and safety distances of the robot.
double _laserRv
double _forwardSafetyDist
double _sideSafetyDist
double _turnAxis
Protected Attributes inherited from g2o::RawLaser
std::vector< double > _ranges
std::vector< double > _remissions
LaserParameters _laserParams
Protected Attributes inherited from g2o::RobotData
double _timestamp
 timestamp when the measurement was generated
double _loggerTimestamp
 timestamp when the measurement was recorded
std::string _tag
 string tag (FLASER, ROBOTLASER, ODOM..) of the line in the log
std::string _hostname
 name of the computer/robot generating the data
Protected Attributes inherited from g2o::HyperGraph::Data
Data * _next
DataContainer * _dataContainer

Additional Inherited Members

Public Types inherited from g2o::RawLaser
using Point2DVector = std::vector<Vector2>

Detailed Description

laser measurement obtained by a robot

A laser measurement obtained by a robot. The measurement is equipped with a pose of the robot at which the measurement was taken. The read/write function correspond to the CARMEN logfile format.

Definition at line 43 of file robot_laser.h.

Constructor & Destructor Documentation

◆ RobotLaser()

g2o::RobotLaser::RobotLaser ( )

Definition at line 40 of file robot_laser.cpp.

41 : RawLaser(),
42 _laserTv(0.),
43 _laserRv(0.),
46 _turnAxis(0.) {}
double _forwardSafetyDist
Definition robot_laser.h:59
double _laserTv
velocities and safety distances of the robot.
Definition robot_laser.h:59
double _sideSafetyDist
Definition robot_laser.h:59

References _forwardSafetyDist, _laserRv, _laserTv, _sideSafetyDist, _turnAxis, and g2o::RawLaser::RawLaser().

◆ ~RobotLaser()

g2o::RobotLaser::~RobotLaser ( )

Definition at line 48 of file robot_laser.cpp.

48{}

Member Function Documentation

◆ laserPose()

SE2 g2o::RobotLaser::laserPose ( ) const
inline

Definition at line 52 of file robot_laser.h.

52{ return _odomPose * _laserParams.laserPose; }
LaserParameters _laserParams
Definition raw_laser.h:77

References g2o::RawLaser::_laserParams, and _odomPose.

Referenced by main().

◆ odomPose()

const SE2 & g2o::RobotLaser::odomPose ( ) const
inline

Definition at line 53 of file robot_laser.h.

53{ return _odomPose; }

References _odomPose.

Referenced by g2o::addOdometryCalibLinksDifferential(), main(), and setOdomPose().

◆ read()

bool g2o::RobotLaser::read ( std::istream & is)
virtual

read the data from a stream

Reimplemented from g2o::RawLaser.

Definition at line 50 of file robot_laser.cpp.

50 {
51 int type;
52 double angle, fov, res, maxrange, acc;
53 int remission_mode;
54 is >> type >> angle >> fov >> res >> maxrange >> acc >> remission_mode;
55
56 int beams;
57 is >> beams;
59 LaserParameters(type, beams, angle, res, maxrange, acc, remission_mode);
60 _ranges.resize(beams);
61 for (int i = 0; i < beams; i++) is >> _ranges[i];
62
63 is >> beams;
64 _remissions.resize(beams);
65 for (int i = 0; i < beams; i++) is >> _remissions[i];
66
67 // special robot laser stuff
68 double x, y, theta;
69 is >> x >> y >> theta;
70 SE2 lp(x, y, theta);
71 is >> x >> y >> theta;
72 _odomPose = SE2(x, y, theta);
73 _laserParams.laserPose = _odomPose.inverse() * lp;
76
77 // timestamp + host
78 is >> _timestamp;
79 is >> _hostname;
80 is >> _loggerTimestamp;
81 return true;
82}
std::vector< double > _remissions
Definition raw_laser.h:76
std::vector< double > _ranges
Definition raw_laser.h:75
double _loggerTimestamp
timestamp when the measurement was recorded
Definition robot_data.h:60
std::string _hostname
name of the computer/robot generating the data
Definition robot_data.h:63
double _timestamp
timestamp when the measurement was generated
Definition robot_data.h:59

References _forwardSafetyDist, g2o::RobotData::_hostname, g2o::RawLaser::_laserParams, _laserRv, _laserTv, g2o::RobotData::_loggerTimestamp, _odomPose, g2o::RawLaser::_ranges, g2o::RawLaser::_remissions, _sideSafetyDist, g2o::RobotData::_timestamp, and _turnAxis.

Referenced by g2o::Gm2dlIO::readGm2dl(), and g2o::Gm2dlIO::readRobotLaser().

◆ setOdomPose()

void g2o::RobotLaser::setOdomPose ( const SE2 & odomPose)

Definition at line 109 of file robot_laser.cpp.

109{ _odomPose = odomPose; }
const SE2 & odomPose() const
Definition robot_laser.h:53

References _odomPose, and odomPose().

Referenced by g2o::Gm2dlIO::updateLaserData().

◆ write()

bool g2o::RobotLaser::write ( std::ostream & os) const
virtual

write the data to a stream

Reimplemented from g2o::RawLaser.

Definition at line 84 of file robot_laser.cpp.

84 {
85 os << _laserParams.type << " " << _laserParams.firstBeamAngle << " "
86 << _laserParams.fov << " " << _laserParams.angularStep << " "
87 << _laserParams.maxRange << " " << _laserParams.accuracy << " "
88 << _laserParams.remissionMode << " ";
89 os << ranges().size();
90 for (size_t i = 0; i < ranges().size(); ++i) os << " " << ranges()[i];
91 os << " " << _remissions.size();
92 for (size_t i = 0; i < _remissions.size(); ++i) os << " " << _remissions[i];
93
94 // odometry pose
95 Vector3 p = (_odomPose * _laserParams.laserPose).toVector();
96 os << " " << p.x() << " " << p.y() << " " << p.z();
97 p = _odomPose.toVector();
98 os << " " << p.x() << " " << p.y() << " " << p.z();
99
100 // crap values
101 os << FIXED(" " << _laserTv << " " << _laserRv << " " << _forwardSafetyDist
102 << " " << _sideSafetyDist << " " << _turnAxis);
103 os << FIXED(" " << timestamp() << " " << hostname() << " "
104 << loggerTimestamp());
105
106 return os.good();
107}
const std::vector< double > & ranges() const
the range measurements by the laser
Definition raw_laser.h:63
double timestamp() const
Definition robot_data.h:46
double loggerTimestamp() const
Definition robot_data.h:49
const std::string & hostname() const
Definition robot_data.h:55
VectorN< 3 > Vector3
Definition eigen_types.h:51

References _forwardSafetyDist, g2o::RawLaser::_laserParams, _laserRv, _laserTv, _odomPose, g2o::RawLaser::_remissions, _sideSafetyDist, _turnAxis, g2o::RobotData::hostname(), g2o::RobotData::loggerTimestamp(), g2o::RawLaser::ranges(), and g2o::RobotData::timestamp().

Member Data Documentation

◆ _forwardSafetyDist

double g2o::RobotLaser::_forwardSafetyDist
protected

Definition at line 59 of file robot_laser.h.

Referenced by read(), RobotLaser(), and write().

◆ _laserRv

double g2o::RobotLaser::_laserRv
protected

Definition at line 59 of file robot_laser.h.

Referenced by read(), RobotLaser(), and write().

◆ _laserTv

double g2o::RobotLaser::_laserTv
protected

velocities and safety distances of the robot.

Definition at line 59 of file robot_laser.h.

Referenced by read(), RobotLaser(), and write().

◆ _odomPose

SE2 g2o::RobotLaser::_odomPose
protected

Definition at line 57 of file robot_laser.h.

Referenced by laserPose(), odomPose(), read(), setOdomPose(), and write().

◆ _sideSafetyDist

double g2o::RobotLaser::_sideSafetyDist
protected

Definition at line 59 of file robot_laser.h.

Referenced by read(), RobotLaser(), and write().

◆ _turnAxis

double g2o::RobotLaser::_turnAxis
protected

Definition at line 59 of file robot_laser.h.

Referenced by read(), RobotLaser(), and write().

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW

g2o::RobotLaser::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 45 of file robot_laser.h.


The documentation for this class was generated from the following files: