g2o
Loading...
Searching...
No Matches
Public Member Functions | List of all members
g2o::SensorOdometry3D Class Reference

#include <sensor_odometry3d.h>

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

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW SensorOdometry3D (const std::string &name_)
 
virtual void sense ()
 
void addNoise (EdgeType *e)
 
- Public Member Functions inherited from g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >
 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< Robot3D, EdgeSE3, WorldObjectSE3 >
typedef Robot3D RobotType
 
typedef RobotType::PoseObject PoseObject
 
typedef RobotType::TrajectoryType TrajectoryType
 
typedef RobotType::PoseObject::VertexType PoseVertexType
 
typedef EdgeSE3 EdgeType
 
typedef WorldObjectSE3 WorldObjectType
 
typedef WorldObjectType::VertexType VertexType
 
typedef EdgeType::InformationType InformationType
 
- Public Attributes inherited from g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >
 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 
- Protected Member Functions inherited from g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >
EdgeTypemkEdge (WorldObjectType *object)
 
virtual void addNoise (EdgeType *)
 
- Protected Attributes inherited from g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >
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 35 of file sensor_odometry3d.h.

Constructor & Destructor Documentation

◆ SensorOdometry3D()

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

Definition at line 34 of file sensor_odometry3d.cpp.

35 : BinarySensor<Robot3D, EdgeSE3, WorldObjectSE3>(name_) {
36 _information.setIdentity();
37 _information *= 100;
38 _information(3, 3) = 10000;
39 _information(4, 4) = 10000;
40 _information(5, 5) = 10000;
42}
void setInformation(const InformationType &information_)
Definition simulator.h:251

References g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >::_information, and g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >::setInformation().

Member Function Documentation

◆ addNoise()

void g2o::SensorOdometry3D::addNoise ( EdgeType e)

Definition at line 44 of file sensor_odometry3d.cpp.

44 {
47 e->setMeasurement(e->measurement() * n);
48 e->setInformation(information());
49}
internal::BaseEdgeTraits< D >::ErrorVector ErrorVector
Definition base_edge.h:90
GaussianSampler< typename EdgeType::ErrorVector, InformationType > _sampler
Definition simulator.h:298
SampleType generateSample()
return a sample of the Gaussian distribution
Definition sampler.h:63
Isometry3 fromVectorMQT(const Vector6 &v)

References g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >::_sampler, g2o::internal::fromVectorMQT(), g2o::GaussianSampler< SampleType, CovarianceType >::generateSample(), and g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >::information().

Referenced by sense().

◆ sense()

void g2o::SensorOdometry3D::sense ( )
virtual

Reimplemented from g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >.

Definition at line 51 of file sensor_odometry3d.cpp.

51 {
52 if (!robot()) return;
53
54 RobotType* r = dynamic_cast<RobotType*>(robot());
55 if (!r) return;
56
57 PoseObject *pprev = 0, *pcurr = 0;
58 std::list<PoseObject*>::reverse_iterator it = r->trajectory().rbegin();
59 if (it != r->trajectory().rend()) {
60 pcurr = *it;
61 ++it;
62 }
63 if (it != r->trajectory().rend()) {
64 pprev = *it;
65 ++it;
66 }
67 if (!(pcurr && pprev)) {
68 cerr << __PRETTY_FUNCTION__ << ": fatal, trajectory empty" << endl;
69 return;
70 }
71 _robotPoseObject = pprev;
72 EdgeType* e = mkEdge(pcurr);
73 if (e) {
74 if (graph()) {
75 graph()->addEdge(e);
76 e->setMeasurementFromState();
77 addNoise(e);
78 }
79 }
80 _robotPoseObject = pcurr;
81}
OptimizableGraph * graph() const
Definition simulator.cpp:76
BaseRobot * robot()
Definition simulator.h:162
EdgeType * mkEdge(WorldObjectType *object)
Definition simulator.h:290
void addNoise(EdgeType *e)
#define __PRETTY_FUNCTION__
Definition macros.h:90
virtual bool addEdge(HyperGraph::Edge *e)

References __PRETTY_FUNCTION__, g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >::_robotPoseObject, g2o::OptimizableGraph::addEdge(), addNoise(), g2o::BaseSensor::graph(), g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >::mkEdge(), and g2o::BaseSensor::robot().


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