g2o
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
g2o::UnarySensor< RobotType_, EdgeType_ > Class Template Reference

#include <simulator.h>

Inheritance diagram for g2o::UnarySensor< RobotType_, EdgeType_ >:
Inheritance graph
[legend]
Collaboration diagram for g2o::UnarySensor< RobotType_, EdgeType_ >:
Collaboration graph
[legend]

Public Types

typedef RobotType_ RobotType
 
typedef RobotType::PoseObject PoseObject
 
typedef RobotType::TrajectoryType TrajectoryType
 
typedef RobotType::PoseObject::VertexType PoseVertexType
 
typedef EdgeType_ EdgeType
 
typedef EdgeType::InformationType InformationType
 

Public Member Functions

 UnarySensor (const std::string &name)
 
void setInformation (const InformationType &information_)
 
const InformationTypeinformation ()
 
virtual void sense ()
 
- 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 ()
 

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 

Protected Member Functions

EdgeTypemkEdge ()
 
virtual void addNoise (EdgeType *)
 

Protected Attributes

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 RobotType_, class EdgeType_>
class g2o::UnarySensor< RobotType_, EdgeType_ >

Definition at line 177 of file simulator.h.

Member Typedef Documentation

◆ EdgeType

template<class RobotType_ , class EdgeType_ >
typedef EdgeType_ g2o::UnarySensor< RobotType_, EdgeType_ >::EdgeType

Definition at line 184 of file simulator.h.

◆ InformationType

template<class RobotType_ , class EdgeType_ >
typedef EdgeType::InformationType g2o::UnarySensor< RobotType_, EdgeType_ >::InformationType

Definition at line 185 of file simulator.h.

◆ PoseObject

template<class RobotType_ , class EdgeType_ >
typedef RobotType::PoseObject g2o::UnarySensor< RobotType_, EdgeType_ >::PoseObject

Definition at line 181 of file simulator.h.

◆ PoseVertexType

template<class RobotType_ , class EdgeType_ >
typedef RobotType::PoseObject::VertexType g2o::UnarySensor< RobotType_, EdgeType_ >::PoseVertexType

Definition at line 183 of file simulator.h.

◆ RobotType

template<class RobotType_ , class EdgeType_ >
typedef RobotType_ g2o::UnarySensor< RobotType_, EdgeType_ >::RobotType

Definition at line 180 of file simulator.h.

◆ TrajectoryType

template<class RobotType_ , class EdgeType_ >
typedef RobotType::TrajectoryType g2o::UnarySensor< RobotType_, EdgeType_ >::TrajectoryType

Definition at line 182 of file simulator.h.

Constructor & Destructor Documentation

◆ UnarySensor()

template<class RobotType_ , class EdgeType_ >
g2o::UnarySensor< RobotType_, EdgeType_ >::UnarySensor ( const std::string &  name)
inline

Definition at line 187 of file simulator.h.

187 : BaseSensor(name) {
188 _information.setIdentity();
189 }
BaseSensor(const std::string &name_)
Definition simulator.h:161
InformationType _information
Definition simulator.h:221

References g2o::UnarySensor< RobotType_, EdgeType_ >::_information.

Member Function Documentation

◆ addNoise()

template<class RobotType_ , class EdgeType_ >
virtual void g2o::UnarySensor< RobotType_, EdgeType_ >::addNoise ( EdgeType )
inlineprotectedvirtual

Definition at line 231 of file simulator.h.

231{};

Referenced by g2o::UnarySensor< RobotType_, EdgeType_ >::sense().

◆ information()

template<class RobotType_ , class EdgeType_ >
const InformationType & g2o::UnarySensor< RobotType_, EdgeType_ >::information ( )
inline

Definition at line 196 of file simulator.h.

196{ return _information; }

References g2o::UnarySensor< RobotType_, EdgeType_ >::_information.

◆ mkEdge()

template<class RobotType_ , class EdgeType_ >
EdgeType * g2o::UnarySensor< RobotType_, EdgeType_ >::mkEdge ( )
inlineprotected

Definition at line 223 of file simulator.h.

223 {
224 PoseVertexType* robotVertex = (PoseVertexType*)_robotPoseObject->vertex();
225 EdgeType* e = new EdgeType();
226 e->vertices()[0] = robotVertex;
227 e->information().setIdentity();
228 return e;
229 }
PoseObject * _robotPoseObject
Definition simulator.h:220
RobotType::PoseObject::VertexType PoseVertexType
Definition simulator.h:183
EdgeType_ EdgeType
Definition simulator.h:184

References g2o::UnarySensor< RobotType_, EdgeType_ >::_robotPoseObject.

Referenced by g2o::UnarySensor< RobotType_, EdgeType_ >::sense().

◆ sense()

template<class RobotType_ , class EdgeType_ >
virtual void g2o::UnarySensor< RobotType_, EdgeType_ >::sense ( )
inlinevirtual

Implements g2o::BaseSensor.

Reimplemented in g2o::SensorSE3Prior.

Definition at line 198 of file simulator.h.

198 {
200 // set the robot pose
201 if (!robot()) return;
202
203 RobotType* r = dynamic_cast<RobotType*>(robot());
204 if (!r) return;
205
206 if (!r->trajectory().empty())
207 _robotPoseObject = *(r->trajectory().rbegin());
208
209 if (!world() || !graph()) return;
210
211 EdgeType* e = mkEdge();
212 if (e) {
213 e->setMeasurementFromState();
214 addNoise(e);
215 graph()->addEdge(e);
216 }
217 }
OptimizableGraph * graph() const
Definition simulator.cpp:76
World * world() const
Definition simulator.cpp:71
BaseRobot * robot()
Definition simulator.h:162
EdgeType * mkEdge()
Definition simulator.h:223
virtual void addNoise(EdgeType *)
Definition simulator.h:231
RobotType_ RobotType
Definition simulator.h:180
virtual bool addEdge(HyperGraph::Edge *e)

References g2o::UnarySensor< RobotType_, EdgeType_ >::_robotPoseObject, g2o::OptimizableGraph::addEdge(), g2o::UnarySensor< RobotType_, EdgeType_ >::addNoise(), g2o::BaseSensor::graph(), g2o::UnarySensor< RobotType_, EdgeType_ >::mkEdge(), g2o::BaseSensor::robot(), and g2o::BaseSensor::world().

◆ setInformation()

template<class RobotType_ , class EdgeType_ >
void g2o::UnarySensor< RobotType_, EdgeType_ >::setInformation ( const InformationType information_)
inline

Definition at line 191 of file simulator.h.

191 {
192 _information = information_;
194 }
void setDistribution(const CovarianceType &cov)
Definition sampler.h:53
GaussianSampler< typename EdgeType::ErrorVector, InformationType > _sampler
Definition simulator.h:230

References g2o::UnarySensor< RobotType_, EdgeType_ >::_information, g2o::UnarySensor< RobotType_, EdgeType_ >::_sampler, and g2o::GaussianSampler< SampleType, CovarianceType >::setDistribution().

Member Data Documentation

◆ _information

template<class RobotType_ , class EdgeType_ >
InformationType g2o::UnarySensor< RobotType_, EdgeType_ >::_information
protected

◆ _robotPoseObject

template<class RobotType_ , class EdgeType_ >
PoseObject* g2o::UnarySensor< RobotType_, EdgeType_ >::_robotPoseObject
protected

◆ _sampler

template<class RobotType_ , class EdgeType_ >
GaussianSampler<typename EdgeType::ErrorVector, InformationType> g2o::UnarySensor< RobotType_, EdgeType_ >::_sampler
protected

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW

template<class RobotType_ , class EdgeType_ >
g2o::UnarySensor< RobotType_, EdgeType_ >::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 179 of file simulator.h.


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