g2o
Loading...
Searching...
No Matches
g2o::SensorSE3Prior Class Reference

#include <sensor_se3_prior.h>

Inheritance diagram for g2o::SensorSE3Prior:
Collaboration diagram for g2o::SensorSE3Prior:

Public Member Functions

 SensorSE3Prior (const std::string &name_)
virtual void sense ()
virtual void addParameters ()
ParameterSE3Offset * offsetParam ()
void addNoise (EdgeType *e)
Public Member Functions inherited from g2o::PointSensorParameters
 PointSensorParameters ()
double maxRange () const
void setMaxRange (double maxRange_)
double minRange () const
void setMinRange (double minRange_)
double fov () const
void setFov (double fov_)
double maxAngularDifference () const
void setMaxAngularDifference (double angularDifference)
Public Member Functions inherited from g2o::UnarySensor< Robot3D, EdgeSE3Prior >
 UnarySensor (const std::string &name)
void setInformation (const InformationType &information_)
const InformationType & information ()
Public Member Functions inherited from g2o::BaseSensor
 BaseSensor (const std::string &name_)
BaseRobot * robot ()
void setRobot (BaseRobot *robot_)
World * world () const
OptimizableGraph * graph () const
const std::vector< Parameter * > & parameters ()

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef PoseVertexType::EstimateType RobotPoseType
Public Attributes inherited from g2o::UnarySensor< Robot3D, EdgeSE3Prior >
 EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Protected Attributes

RobotPoseType _sensorPose
ParameterSE3Offset * _offsetParam
Protected Attributes inherited from g2o::PointSensorParameters
double _maxRange2
double _minRange2
double _fov
double _maxAngularDifference
Protected Attributes inherited from g2o::UnarySensor< Robot3D, EdgeSE3Prior >
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

Additional Inherited Members

Public Types inherited from g2o::UnarySensor< Robot3D, EdgeSE3Prior >
typedef Robot3D RobotType
typedef RobotType::PoseObject PoseObject
typedef RobotType::TrajectoryType TrajectoryType
typedef RobotType::PoseObject::VertexType PoseVertexType
typedef EdgeSE3Prior EdgeType
typedef EdgeType::InformationType InformationType
Protected Member Functions inherited from g2o::UnarySensor< Robot3D, EdgeSE3Prior >
EdgeType * mkEdge ()
virtual void addNoise (EdgeType *)

Detailed Description

Definition at line 35 of file sensor_se3_prior.h.

Constructor & Destructor Documentation

◆ SensorSE3Prior()

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

Member Function Documentation

◆ addNoise()

void g2o::SensorSE3Prior::addNoise ( EdgeType * e)

Definition at line 50 of file sensor_se3_prior.cpp.

50 {
51 EdgeType::ErrorVector _n = _sampler.generateSample();
52 EdgeType::Measurement n = internal::fromVectorMQT(_n);
53 e->setMeasurement(e->measurement() * n);
54 e->setInformation(information());
55}
GaussianSampler< typename EdgeType::ErrorVector, InformationType > _sampler
Definition simulator.h:230
const InformationType & information()
Definition simulator.h:196
Isometry3 fromVectorMQT(const Vector6 &v)

References g2o::UnarySensor< Robot3D, EdgeSE3Prior >::_sampler, g2o::internal::fromVectorMQT(), and g2o::UnarySensor< Robot3D, EdgeSE3Prior >::information().

Referenced by sense().

◆ addParameters()

void g2o::SensorSE3Prior::addParameters ( )
virtual

Reimplemented from g2o::BaseSensor.

Definition at line 44 of file sensor_se3_prior.cpp.

44 {
45 if (!_offsetParam) _offsetParam = new ParameterSE3Offset();
46 assert(world());
48}
World * world() const
Definition simulator.cpp:71
bool addParameter(Parameter *p)

References _offsetParam, g2o::World::addParameter(), and g2o::BaseSensor::world().

◆ offsetParam()

ParameterSE3Offset * g2o::SensorSE3Prior::offsetParam ( )
inline

Definition at line 44 of file sensor_se3_prior.h.

44{ return _offsetParam; };

References _offsetParam.

Referenced by main().

◆ sense()

void g2o::SensorSE3Prior::sense ( )
virtual

Reimplemented from g2o::UnarySensor< Robot3D, EdgeSE3Prior >.

Definition at line 57 of file sensor_se3_prior.cpp.

57 {
58 if (!_offsetParam) {
59 return;
60 }
62 RobotType* r = dynamic_cast<RobotType*>(robot());
63 std::list<PoseObject*>::reverse_iterator it = r->trajectory().rbegin();
64 int count = 0;
65 while (it != r->trajectory().rend() && count < 1) {
67 ++it;
68 count++;
69 }
70 if (!_robotPoseObject) return;
71 _sensorPose = _robotPoseObject->vertex()->estimate() * _offsetParam->offset();
72 EdgeType* e = mkEdge();
73 if (e && graph()) {
74 e->setParameterId(0, _offsetParam->id());
75 graph()->addEdge(e);
76 e->setMeasurementFromState();
77 addNoise(e);
78 }
79}
OptimizableGraph * graph() const
Definition simulator.cpp:76
BaseRobot * robot()
Definition simulator.h:162
void addNoise(EdgeType *e)
RobotPoseType _sensorPose
virtual bool addEdge(HyperGraph::Edge *e)

References _offsetParam, g2o::UnarySensor< Robot3D, EdgeSE3Prior >::_robotPoseObject, _sensorPose, g2o::OptimizableGraph::addEdge(), addNoise(), g2o::BaseSensor::graph(), g2o::UnarySensor< Robot3D, EdgeSE3Prior >::mkEdge(), g2o::BaseSensor::robot(), and g2o::Robot< RobotPoseObject >::trajectory().

Member Data Documentation

◆ _offsetParam

ParameterSE3Offset* g2o::SensorSE3Prior::_offsetParam
protected

Definition at line 49 of file sensor_se3_prior.h.

Referenced by addParameters(), offsetParam(), sense(), and SensorSE3Prior().

◆ _sensorPose

RobotPoseType g2o::SensorSE3Prior::_sensorPose
protected

Definition at line 48 of file sensor_se3_prior.h.

Referenced by sense().

◆ RobotPoseType

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef PoseVertexType::EstimateType g2o::SensorSE3Prior::RobotPoseType

Definition at line 40 of file sensor_se3_prior.h.


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