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

#include <sensor_se3_prior.h>

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

Public Member Functions

 SensorSE3Prior (const std::string &name_)
 
virtual void sense ()
 
virtual void addParameters ()
 
ParameterSE3OffsetoffsetParam ()
 
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 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 ()
 

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 >
EdgeTypemkEdge ()
 
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_)

Definition at line 35 of file sensor_se3_prior.cpp.

36 : UnarySensor<Robot3D, EdgeSE3Prior>(name_) {
37 _offsetParam = 0;
38 _information.setIdentity();
39 _information *= 1000;
40 _information(2, 2) = 10;
42}
ParameterSE3Offset * _offsetParam
void setInformation(const InformationType &information_)
Definition simulator.h:191

References g2o::UnarySensor< Robot3D, EdgeSE3Prior >::_information, _offsetParam, and g2o::UnarySensor< Robot3D, EdgeSE3Prior >::setInformation().

Member Function Documentation

◆ addNoise()

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

Definition at line 50 of file sensor_se3_prior.cpp.

50 {
53 e->setMeasurement(e->measurement() * n);
54 e->setInformation(information());
55}
internal::BaseEdgeTraits< D >::ErrorVector ErrorVector
Definition base_edge.h:90
SampleType generateSample()
return a sample of the Gaussian distribution
Definition sampler.h:63
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(), g2o::GaussianSampler< SampleType, CovarianceType >::generateSample(), 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; };

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
const Isometry3 & offset() const
rotation of the offset as 3x3 rotation matrix
int id() const
Definition parameter.h:44
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::Parameter::id(), g2o::UnarySensor< Robot3D, EdgeSE3Prior >::mkEdge(), g2o::ParameterSE3Offset::offset(), and g2o::BaseSensor::robot().

Member Data Documentation

◆ _offsetParam

ParameterSE3Offset* g2o::SensorSE3Prior::_offsetParam
protected

Definition at line 49 of file sensor_se3_prior.h.

Referenced by addParameters(), 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: