g2o
Public Member Functions | List of all members
g2o::SensorOdometry< R, E, O > Class Template Reference

#include <sensor_odometry.h>

Inheritance diagram for g2o::SensorOdometry< R, E, O >:
Inheritance graph
[legend]
Collaboration diagram for g2o::SensorOdometry< R, E, O >:
Collaboration graph
[legend]

Public Member Functions

 SensorOdometry (const std::string name_)
 
virtual EIGEN_MAKE_ALIGNED_OPERATOR_NEW void sense ()
 
- Public Member Functions inherited from g2o::BinarySensor< R, E, O >
 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 ()
 

Additional Inherited Members

- Public Types inherited from g2o::BinarySensor< R, E, O >
typedef R RobotType
 
typedef RobotType::PoseObject PoseObject
 
typedef RobotType::TrajectoryType TrajectoryType
 
typedef RobotType::PoseObject::VertexType PoseVertexType
 
typedef E EdgeType
 
typedef O WorldObjectType
 
typedef WorldObjectType::VertexType VertexType
 
typedef EdgeType::InformationType InformationType
 
- Public Attributes inherited from g2o::BinarySensor< R, E, O >
 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 
- Protected Member Functions inherited from g2o::BinarySensor< R, E, O >
EdgeTypemkEdge (WorldObjectType *object)
 
virtual void addNoise (EdgeType *)
 
- Protected Attributes inherited from g2o::BinarySensor< R, E, O >
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

template<class R, class E, class O>
class g2o::SensorOdometry< R, E, O >

Definition at line 34 of file sensor_odometry.h.

Constructor & Destructor Documentation

template<class R , class E , class O >
g2o::SensorOdometry< R, E, O >::SensorOdometry ( const std::string  name_)
inline

Definition at line 36 of file sensor_odometry.h.

References g2o::BinarySensor< R, E, O >::EIGEN_MAKE_ALIGNED_OPERATOR_NEW.

36 : BinarySensor<R, E, O> (name_){};

Member Function Documentation

template<class R , class E , class O >
virtual EIGEN_MAKE_ALIGNED_OPERATOR_NEW void g2o::SensorOdometry< R, E, O >::sense ( )
inlinevirtual

Reimplemented from g2o::BinarySensor< R, E, O >.

Definition at line 38 of file sensor_odometry.h.

References __PRETTY_FUNCTION__, g2o::BinarySensor< R, E, O >::_robotPoseObject, g2o::OptimizableGraph::addEdge(), g2o::BinarySensor< R, E, O >::addNoise(), g2o::BaseSensor::graph(), g2o::BinarySensor< R, E, O >::mkEdge(), and g2o::BaseSensor::robot().

38  {
40  return;
41 
42  typename BinarySensor<R, E, O>::RobotType* r =dynamic_cast<typename BinarySensor<R, E, O>::RobotType*>(robot());
43  if (!r)
44  return;
45 
46  PoseObject* pprev=0, *pcurr=0;
47  std::list<PoseObject*>::reverse_iterator it=r->trajectory().rbegin();
48  if (it!=r->trajectory().rend()){
49  pcurr = *it;
50  it++;
51  }
52  if (it!=r->trajectory().rend()){
53  pprev = *it;
54  it++;
55  }
56  if (!(pcurr&&pprev)) {
57  cerr << __PRETTY_FUNCTION__ << ": fatal, trajectory empty" << endl;
58  return;
59  }
60  _robotPoseObject = pprev;
61  EdgeType* e=mkEdge(pcurr);
62  if (e){
63  addNoise(e);
64  if (graph())
65  graph()->addEdge(e);
66  }
67  _robotPoseObject = pcurr;
68 
69  }
#define __PRETTY_FUNCTION__
Definition: macros.h:89
RobotType::PoseObject PoseObject
Definition: simulator.h:209
PoseObject * _robotPoseObject
Definition: simulator.h:260
virtual void addNoise(EdgeType *)
Definition: simulator.h:272
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

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