g2o
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 ()
 
OptimizableGraphgraph ()
 
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)
 
- 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

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

Definition at line 35 of file sensor_odometry3d.cpp.

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

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

Member Function Documentation

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

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

Definition at line 45 of file sensor_odometry3d.cpp.

References g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >::_sampler, g2o::internal::fromVectorMQT(), g2o::GaussianSampler< SampleType, CovarianceType >::generateSample(), g2o::BinarySensor< Robot3D, EdgeSE3, WorldObjectSE3 >::information(), g2o::BaseEdge< D, E >::measurement(), g2o::BaseEdge< D, E >::setInformation(), and g2o::EdgeSE3::setMeasurement().

Referenced by sense().

45  {
48  e->setMeasurement(e->measurement()*n);
49  e->setInformation(information());
50  }
GaussianSampler< typename EdgeType::ErrorVector, InformationType > _sampler
Definition: simulator.h:271
BaseEdge< D, Isometry3D >::ErrorVector ErrorVector
SampleType generateSample()
Definition: sampler.h:67
BaseEdge< D, Isometry3D >::Measurement Measurement
Isometry3D fromVectorMQT(const Vector6d &v)
void g2o::SensorOdometry3D::sense ( )
virtual

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

Definition at line 52 of file sensor_odometry3d.cpp.

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

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

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