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

#include <sensor_odometry2d.h>

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

Public Member Functions

 SensorOdometry2D (const std::string &name_)
 
virtual void sense ()
 
virtual void addNoise (EdgeType *e)
 
- Public Member Functions inherited from g2o::BinarySensor< Robot2D, EdgeSE2, WorldObjectSE2 >
 BinarySensor (const std::string &name)
 
void setInformation (const InformationType &information_)
 
const InformationTypeinformation ()
 
- Public Member Functions inherited from g2o::BaseSensor
 BaseSensor (const std::string &name_)
 
BaseRobotrobot ()
 
void setRobot (BaseRobot *robot_)
 
Worldworld ()
 
OptimizableGraphgraph ()
 
std::vector< Parameter * > parameters ()
 
virtual void addParameters ()
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Robot2D::PoseObject PoseObject
 
- Public Attributes inherited from g2o::BinarySensor< Robot2D, EdgeSE2, WorldObjectSE2 >
 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 

Additional Inherited Members

- Public Types inherited from g2o::BinarySensor< Robot2D, EdgeSE2, WorldObjectSE2 >
typedef Robot2D RobotType
 
typedef RobotType::PoseObject PoseObject
 
typedef RobotType::TrajectoryType TrajectoryType
 
typedef RobotType::PoseObject::VertexType PoseVertexType
 
typedef EdgeSE2 EdgeType
 
typedef WorldObjectSE2 WorldObjectType
 
typedef WorldObjectType::VertexType VertexType
 
typedef EdgeType::InformationType InformationType
 
- Protected Member Functions inherited from g2o::BinarySensor< Robot2D, EdgeSE2, WorldObjectSE2 >
EdgeTypemkEdge (WorldObjectType *object)
 
- Protected Attributes inherited from g2o::BinarySensor< Robot2D, EdgeSE2, WorldObjectSE2 >
PoseObject_robotPoseObject
 
InformationType _information
 
GaussianSampler< typename EdgeType::ErrorVector, InformationType_sampler
 
- Protected Attributes inherited from g2o::BaseSensor
std::string _name
 
std::vector< Parameter * > _parameters
 
BaseRobot_robot
 

Detailed Description

Definition at line 34 of file sensor_odometry2d.h.

Constructor & Destructor Documentation

g2o::SensorOdometry2D::SensorOdometry2D ( const std::string &  name_)

Definition at line 36 of file sensor_odometry2d.cpp.

36  :
37  BinarySensor<Robot2D, EdgeSE2, WorldObjectSE2>(name_){}

Member Function Documentation

void g2o::SensorOdometry2D::addNoise ( EdgeType e)
virtual
void g2o::SensorOdometry2D::sense ( )
virtual

Reimplemented from g2o::BinarySensor< Robot2D, EdgeSE2, WorldObjectSE2 >.

Definition at line 39 of file sensor_odometry2d.cpp.

References __PRETTY_FUNCTION__, g2o::BinarySensor< Robot2D, EdgeSE2, WorldObjectSE2 >::_robotPoseObject, g2o::OptimizableGraph::addEdge(), addNoise(), g2o::BaseSensor::graph(), g2o::BinarySensor< Robot2D, EdgeSE2, WorldObjectSE2 >::mkEdge(), g2o::BaseSensor::robot(), g2o::EdgeSE2::setMeasurementFromState(), and g2o::Robot< RobotPoseObject >::trajectory().

39  {
40 
41  if (! robot())
42  return;
43 
44  RobotType* r =dynamic_cast<RobotType*>(robot());
45  if (!r)
46  return;
47 
48  PoseObject* pprev=0, *pcurr=0;
49  std::list<PoseObject*>::reverse_iterator it=r->trajectory().rbegin();
50  if (it!=r->trajectory().rend()){
51  pcurr = *it;
52  it++;
53  }
54  if (it!=r->trajectory().rend()){
55  pprev = *it;
56  it++;
57  }
58  if (!(pcurr&&pprev)) {
59  cerr << __PRETTY_FUNCTION__ << ": fatal, trajectory empty" << endl;
60  return;
61  }
62  _robotPoseObject = pprev;
63  EdgeType* e=mkEdge(pcurr);
64  if (e){
65  e->setMeasurementFromState();
66  addNoise(e);
67  if (graph())
68  graph()->addEdge(e);
69  }
70  _robotPoseObject = pcurr;
71  }
#define __PRETTY_FUNCTION__
Definition: macros.h:89
virtual void addNoise(EdgeType *e)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Robot2D::PoseObject PoseObject
OptimizableGraph * graph()
Definition: simulator.cpp:75
BaseRobot * robot()
Definition: simulator.h:129
virtual bool addEdge(HyperGraph::Edge *e)
EdgeType * mkEdge(WorldObjectType *object)
Definition: simulator.h:263

Member Data Documentation

Definition at line 37 of file sensor_odometry2d.h.


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