g2o
Loading...
Searching...
No Matches
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 () const
 
OptimizableGraphgraph () const
 
const 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

◆ SensorOdometry()

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.

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

Member Function Documentation

◆ sense()

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.

38 {
39 if (!BinarySensor<R, E, O>::robot()) return;
40
41 typename BinarySensor<R, E, O>::RobotType* r =
42 dynamic_cast<typename BinarySensor<R, E, O>::RobotType*>(robot());
43 if (!r) return;
44
45 PoseObject *pprev = 0, *pcurr = 0;
46 std::list<PoseObject*>::reverse_iterator it = r->trajectory().rbegin();
47 if (it != r->trajectory().rend()) {
48 pcurr = *it;
49 ++it;
50 }
51 if (it != r->trajectory().rend()) {
52 pprev = *it;
53 ++it;
54 }
55 if (!(pcurr && pprev)) {
56 cerr << __PRETTY_FUNCTION__ << ": fatal, trajectory empty" << endl;
57 return;
58 }
59 _robotPoseObject = pprev;
60 EdgeType* e = mkEdge(pcurr);
61 if (e) {
62 addNoise(e);
63 if (graph()) graph()->addEdge(e);
64 }
65 _robotPoseObject = pcurr;
66 }
OptimizableGraph * graph() const
Definition simulator.cpp:76
BaseRobot * robot()
Definition simulator.h:162
EdgeType * mkEdge(WorldObjectType *object)
Definition simulator.h:290
RobotType::PoseObject PoseObject
Definition simulator.h:239
virtual void addNoise(EdgeType *)
Definition simulator.h:299
#define __PRETTY_FUNCTION__
Definition macros.h:90
virtual bool addEdge(HyperGraph::Edge *e)

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().


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