g2o
Public Member Functions | Public Attributes | Protected Attributes | List of all members
g2o::RobotLaser Class Reference

laser measurement obtained by a robot More...

#include <robot_laser.h>

Inheritance diagram for g2o::RobotLaser:
Inheritance graph
[legend]
Collaboration diagram for g2o::RobotLaser:
Collaboration graph
[legend]

Public Member Functions

 RobotLaser ()
 
 ~RobotLaser ()
 
virtual bool write (std::ostream &os) const
 write the data to a stream More...
 
virtual bool read (std::istream &is)
 read the data from a stream More...
 
SE2 laserPose () const
 
const SE2odomPose () 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 More...
 
void setRanges (const std::vector< double > &ranges)
 
const std::vector< double > & remissions () const
 the remission measurements by the laser More...
 
void setRemissions (const std::vector< double > &remissions)
 
const LaserParameterslaserParams () const
 the parameters of the laser More...
 
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 Datanext () const
 
Datanext ()
 
void setNext (Data *next_)
 
DataContainerdataContainer ()
 
const DataContainerdataContainer () const
 
void setDataContainer (DataContainer *dataContainer_)
 
- Public Member Functions inherited from g2o::HyperGraph::HyperGraphElement
virtual ~HyperGraphElement ()
 
HyperGraphElementclone () const
 

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 

Protected Attributes

SE2 _odomPose
 
double _laserTv
 velocities and safety distances of the robot. More...
 
double _laserRv
 
double _forwardSafetyDist
 
double _sideSaftyDist
 
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 More...
 
double _loggerTimestamp
 timestamp when the measurement was recorded More...
 
std::string _tag
 string tag (FLASER, ROBOTLASER, ODOM..) of the line in the log More...
 
std::string _hostname
 name of the computer/robot generating the data More...
 
- Protected Attributes inherited from g2o::HyperGraph::Data
Data_next
 
DataContainer_dataContainer
 

Additional Inherited Members

- Public Types inherited from g2o::RawLaser
typedef std::vector< Vector2D, Eigen::aligned_allocator< Vector2D > > Point2DVector
 

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 42 of file robot_laser.h.

Constructor & Destructor Documentation

g2o::RobotLaser::RobotLaser ( )

Definition at line 40 of file robot_laser.cpp.

40  :
41  RawLaser(),
43  {
44  }
double _turnAxis
Definition: robot_laser.h:59
double _laserTv
velocities and safety distances of the robot.
Definition: robot_laser.h:59
double _sideSaftyDist
Definition: robot_laser.h:59
double _forwardSafetyDist
Definition: robot_laser.h:59
g2o::RobotLaser::~RobotLaser ( )

Definition at line 46 of file robot_laser.cpp.

47  {
48  }

Member Function Documentation

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

Definition at line 52 of file robot_laser.h.

Referenced by main(), and setOdomPose().

52 { return _odomPose * _laserParams.laserPose;}
LaserParameters _laserParams
Definition: raw_laser.h:78
const SE2& g2o::RobotLaser::odomPose ( ) const
inline

Definition at line 53 of file robot_laser.h.

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

53 { return _odomPose;}
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.

References _forwardSafetyDist, g2o::RobotData::_hostname, g2o::RawLaser::_laserParams, _laserRv, _laserTv, g2o::RobotData::_loggerTimestamp, _odomPose, g2o::RawLaser::_ranges, g2o::RawLaser::_remissions, _sideSaftyDist, g2o::RobotData::_timestamp, _turnAxis, g2o::SE2::inverse(), and g2o::LaserParameters::laserPose.

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

51  {
52  int type;
53  double angle, fov, res, maxrange, acc;
54  int remission_mode;
55  is >> type >> angle >> fov >> res >> maxrange >> acc >> remission_mode;
56 
57  int beams;
58  is >> beams;
59  _laserParams = LaserParameters(type, beams, angle, res, maxrange, acc, remission_mode);
60  _ranges.resize(beams);
61  for (int i=0; i<beams; i++)
62  is >> _ranges[i];
63 
64  is >> beams;
65  _remissions.resize(beams);
66  for (int i = 0; i < beams; i++)
67  is >> _remissions[i];
68 
69  // special robot laser stuff
70  double x,y,theta;
71  is >> x >> y >> theta;
72  SE2 lp(x,y,theta);
73  //cerr << "x: " << x << " y:" << y << " th:" << theta << " ";
74  is >> x >> y >> theta;
75  //cerr << "x: " << x << " y:" << y << " th:" << theta;
76  _odomPose = SE2(x,y,theta);
79 
80  // timestamp + host
81  is >> _timestamp;
82  is >> _hostname;
83  is >> _loggerTimestamp;
84  return true;
85  }
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:60
double _loggerTimestamp
timestamp when the measurement was recorded
Definition: robot_data.h:61
std::vector< double > _ranges
Definition: raw_laser.h:76
double _turnAxis
Definition: robot_laser.h:59
double _laserTv
velocities and safety distances of the robot.
Definition: robot_laser.h:59
double _sideSaftyDist
Definition: robot_laser.h:59
LaserParameters _laserParams
Definition: raw_laser.h:78
SE2 inverse() const
invert :-)
Definition: se2.h:82
double _forwardSafetyDist
Definition: robot_laser.h:59
std::vector< double > _remissions
Definition: raw_laser.h:77
void g2o::RobotLaser::setOdomPose ( const SE2 odomPose)
bool g2o::RobotLaser::write ( std::ostream &  os) const
virtual

write the data to a stream

Reimplemented from g2o::RawLaser.

Definition at line 87 of file robot_laser.cpp.

References _forwardSafetyDist, g2o::RawLaser::_laserParams, _laserRv, _laserTv, _odomPose, g2o::RawLaser::_remissions, _sideSaftyDist, _turnAxis, g2o::LaserParameters::accuracy, g2o::LaserParameters::angularStep, g2o::LaserParameters::firstBeamAngle, g2o::LaserParameters::fov, g2o::RobotData::hostname(), g2o::LaserParameters::laserPose, g2o::RobotData::loggerTimestamp(), g2o::LaserParameters::maxRange, g2o::RawLaser::ranges(), g2o::LaserParameters::remissionMode, g2o::RobotData::timestamp(), g2o::SE2::toVector(), and g2o::LaserParameters::type.

88  {
89  os << _laserParams.type << " " << _laserParams.firstBeamAngle << " " << _laserParams.fov << " "
91  << _laserParams.remissionMode << " ";
92  os << ranges().size();
93  for (size_t i = 0; i < ranges().size(); ++i)
94  os << " " << ranges()[i];
95  os << " " << _remissions.size();
96  for (size_t i = 0; i < _remissions.size(); ++i)
97  os << " " << _remissions[i];
98 
99  // odometry pose
100  Vector3D p = (_odomPose * _laserParams.laserPose).toVector();
101  os << " " << p.x() << " " << p.y() << " " << p.z();
102  p = _odomPose.toVector();
103  os << " " << p.x() << " " << p.y() << " " << p.z();
104 
105  // crap values
106  os << FIXED(" " << _laserTv << " " << _laserRv << " " << _forwardSafetyDist << " "
107  << _sideSaftyDist << " " << _turnAxis);
108  os << FIXED(" " << timestamp() << " " << hostname() << " " << loggerTimestamp());
109 
110  return os.good();
111  }
Vector3D toVector() const
convert to a 3D vector (x, y, theta)
Definition: se2.h:108
Eigen::Matrix< double, 3, 1, Eigen::ColMajor > Vector3D
Definition: eigen_types.h:46
double timestamp() const
Definition: robot_data.h:47
double _turnAxis
Definition: robot_laser.h:59
double loggerTimestamp() const
Definition: robot_data.h:50
const std::vector< double > & ranges() const
the range measurements by the laser
Definition: raw_laser.h:64
double _laserTv
velocities and safety distances of the robot.
Definition: robot_laser.h:59
double _sideSaftyDist
Definition: robot_laser.h:59
const std::string & hostname() const
Definition: robot_data.h:56
LaserParameters _laserParams
Definition: raw_laser.h:78
double _forwardSafetyDist
Definition: robot_laser.h:59
std::vector< double > _remissions
Definition: raw_laser.h:77

Member Data Documentation

double g2o::RobotLaser::_forwardSafetyDist
protected

Definition at line 59 of file robot_laser.h.

Referenced by read(), and write().

double g2o::RobotLaser::_laserRv
protected

Definition at line 59 of file robot_laser.h.

Referenced by read(), and write().

double g2o::RobotLaser::_laserTv
protected

velocities and safety distances of the robot.

Definition at line 59 of file robot_laser.h.

Referenced by read(), and write().

SE2 g2o::RobotLaser::_odomPose
protected

Definition at line 57 of file robot_laser.h.

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

double g2o::RobotLaser::_sideSaftyDist
protected

Definition at line 59 of file robot_laser.h.

Referenced by read(), and write().

double g2o::RobotLaser::_turnAxis
protected

Definition at line 59 of file robot_laser.h.

Referenced by read(), and write().

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: