g2o
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 ()
 
OptimizableGraphgraph ()
 
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 143 of file simulator.h.

Member Typedef Documentation

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

Definition at line 150 of file simulator.h.

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

Definition at line 151 of file simulator.h.

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

Definition at line 147 of file simulator.h.

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

Definition at line 149 of file simulator.h.

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

Definition at line 146 of file simulator.h.

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

Definition at line 148 of file simulator.h.

Constructor & Destructor Documentation

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

Definition at line 153 of file simulator.h.

153  : BaseSensor(name) {
154  _information.setIdentity();
155  }
BaseSensor(const std::string &name_)
Definition: simulator.h:128
InformationType _information
Definition: simulator.h:191

Member Function Documentation

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

Reimplemented in g2o::SensorSE3Prior.

Definition at line 201 of file simulator.h.

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

Definition at line 162 of file simulator.h.

162 {return _information; }
InformationType _information
Definition: simulator.h:191
template<class RobotType_, class EdgeType_>
EdgeType* g2o::UnarySensor< RobotType_, EdgeType_ >::mkEdge ( )
inlineprotected

Definition at line 193 of file simulator.h.

193  {
194  PoseVertexType* robotVertex = (PoseVertexType*)_robotPoseObject->vertex();
195  EdgeType* e = new EdgeType();
196  e->vertices()[0]=robotVertex;
197  e->information().setIdentity();
198  return e;
199  }
RobotType::PoseObject::VertexType PoseVertexType
Definition: simulator.h:149
PoseObject * _robotPoseObject
Definition: simulator.h:190
EdgeType_ EdgeType
Definition: simulator.h:150
template<class RobotType_, class EdgeType_>
virtual void g2o::UnarySensor< RobotType_, EdgeType_ >::sense ( )
inlinevirtual

Implements g2o::BaseSensor.

Reimplemented in g2o::SensorSE3Prior.

Definition at line 164 of file simulator.h.

164  {
165  _robotPoseObject = 0;
166  // set the robot pose
167  if (! robot())
168  return;
169 
170  RobotType* r =dynamic_cast<RobotType*>(robot());
171  if (!r)
172  return;
173 
174  if(! r->trajectory().empty())
175  _robotPoseObject = *(r->trajectory().rbegin());
176 
177  if (! world() || ! graph())
178  return;
179 
180  EdgeType* e=mkEdge();
181  if (e) {
182  e->setMeasurementFromState();
183  addNoise(e);
184  graph()->addEdge(e);
185  }
186  }
RobotType_ RobotType
Definition: simulator.h:146
EdgeType * mkEdge()
Definition: simulator.h:193
World * world()
Definition: simulator.cpp:69
virtual void addNoise(EdgeType *)
Definition: simulator.h:201
PoseObject * _robotPoseObject
Definition: simulator.h:190
OptimizableGraph * graph()
Definition: simulator.cpp:75
BaseRobot * robot()
Definition: simulator.h:129
EdgeType_ EdgeType
Definition: simulator.h:150
virtual bool addEdge(HyperGraph::Edge *e)
template<class RobotType_, class EdgeType_>
void g2o::UnarySensor< RobotType_, EdgeType_ >::setInformation ( const InformationType information_)
inline

Definition at line 157 of file simulator.h.

157  {
158  _information = information_ ;
160  }
GaussianSampler< typename EdgeType::ErrorVector, InformationType > _sampler
Definition: simulator.h:200
InformationType _information
Definition: simulator.h:191
void setDistribution(const CovarianceType &cov)
Definition: sampler.h:60

Member Data Documentation

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

Definition at line 191 of file simulator.h.

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

Definition at line 190 of file simulator.h.

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

Definition at line 200 of file simulator.h.

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

Definition at line 145 of file simulator.h.


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