g2o
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ > Class Template Reference

#include <simulator.h>

Inheritance diagram for g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >:
Inheritance graph
[legend]
Collaboration diagram for g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >:
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 WorldObjectType_ WorldObjectType
 
typedef WorldObjectType::VertexType VertexType
 
typedef EdgeType::InformationType InformationType
 

Public Member Functions

 BinarySensor (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 (WorldObjectType *object)
 
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 WorldObjectType_>
class g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >

Definition at line 205 of file simulator.h.

Member Typedef Documentation

template<class RobotType_, class EdgeType_, class WorldObjectType_>
typedef EdgeType_ g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >::EdgeType

Definition at line 212 of file simulator.h.

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

Definition at line 215 of file simulator.h.

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

Definition at line 209 of file simulator.h.

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

Definition at line 211 of file simulator.h.

template<class RobotType_, class EdgeType_, class WorldObjectType_>
typedef RobotType_ g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >::RobotType

Definition at line 208 of file simulator.h.

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

Definition at line 210 of file simulator.h.

template<class RobotType_, class EdgeType_, class WorldObjectType_>
typedef WorldObjectType::VertexType g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >::VertexType

Definition at line 214 of file simulator.h.

template<class RobotType_, class EdgeType_, class WorldObjectType_>
typedef WorldObjectType_ g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >::WorldObjectType

Definition at line 213 of file simulator.h.

Constructor & Destructor Documentation

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

Definition at line 217 of file simulator.h.

217  : BaseSensor(name) {
218  _information.setIdentity();
219  }
InformationType _information
Definition: simulator.h:261
BaseSensor(const std::string &name_)
Definition: simulator.h:128

Member Function Documentation

template<class RobotType_, class EdgeType_, class WorldObjectType_>
virtual void g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >::addNoise ( EdgeType )
inlineprotectedvirtual
template<class RobotType_, class EdgeType_, class WorldObjectType_>
const InformationType& g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >::information ( )
inline

Definition at line 226 of file simulator.h.

Referenced by main().

226 {return _information; }
InformationType _information
Definition: simulator.h:261
template<class RobotType_, class EdgeType_, class WorldObjectType_>
EdgeType* g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >::mkEdge ( WorldObjectType object)
inlineprotected

Definition at line 263 of file simulator.h.

263  {
264  PoseVertexType* robotVertex = (PoseVertexType*)_robotPoseObject->vertex();
265  EdgeType* e = new EdgeType();
266  e->vertices()[0]=robotVertex;
267  e->vertices()[1]=object->vertex();
268  e->information().setIdentity();
269  return e;
270  }
RobotType::PoseObject::VertexType PoseVertexType
Definition: simulator.h:211
PoseObject * _robotPoseObject
Definition: simulator.h:260
EdgeType_ EdgeType
Definition: simulator.h:212
template<class RobotType_, class EdgeType_, class WorldObjectType_>
virtual void g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >::sense ( )
inlinevirtual

Implements g2o::BaseSensor.

Reimplemented in g2o::SensorPointXYBearing, g2o::SensorPointXYOffset, g2o::SensorPointXYZDisparity, g2o::SensorSegment2D, g2o::SensorSegment2DLine, g2o::SensorSegment2DPointLine, g2o::SensorPointLine3D, g2o::SensorPointXY, g2o::SensorPointXYZ, g2o::SensorPointXYZDepth, g2o::SensorPose2D, g2o::SensorOdometry2D, g2o::SensorOdometry3D, g2o::SensorPose3D, g2o::SensorOdometry< R, E, O >, and g2o::SensorPose3DOffset.

Definition at line 228 of file simulator.h.

228  {
229  _robotPoseObject = 0;
230  // set the robot pose
231  if (! robot())
232  return;
233 
234  RobotType* r =dynamic_cast<RobotType*>(robot());
235  if (!r)
236  return;
237 
238  if(! r->trajectory().empty())
239  _robotPoseObject = *(r->trajectory().rbegin());
240 
241  if (! world() || ! graph())
242  return;
243 
244  // naive search. just for initial testing
245  for(std::set<BaseWorldObject*>::iterator it=world()->objects().begin(); it!=world()->objects().end(); it++){
246  WorldObjectType * wo = dynamic_cast<WorldObjectType*>(*it);
247  if (wo){
248  EdgeType* e=mkEdge(wo);
249  if (e) {
250  e->setMeasurementFromState();
251  addNoise(e);
252  graph()->addEdge(e);
253  }
254  }
255  }
256  }
WorldObjectType_ WorldObjectType
Definition: simulator.h:213
World * world()
Definition: simulator.cpp:69
PoseObject * _robotPoseObject
Definition: simulator.h:260
EdgeType_ EdgeType
Definition: simulator.h:212
virtual void addNoise(EdgeType *)
Definition: simulator.h:272
RobotType_ RobotType
Definition: simulator.h:208
OptimizableGraph * graph()
Definition: simulator.cpp:75
BaseRobot * robot()
Definition: simulator.h:129
std::set< BaseWorldObject * > & objects()
Definition: simulator.h:284
virtual bool addEdge(HyperGraph::Edge *e)
EdgeType * mkEdge(WorldObjectType *object)
Definition: simulator.h:263
template<class RobotType_, class EdgeType_, class WorldObjectType_>
void g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >::setInformation ( const InformationType information_)
inline

Definition at line 221 of file simulator.h.

Referenced by main().

221  {
222  _information = information_ ;
224  }
InformationType _information
Definition: simulator.h:261
GaussianSampler< typename EdgeType::ErrorVector, InformationType > _sampler
Definition: simulator.h:271
void setDistribution(const CovarianceType &cov)
Definition: sampler.h:60

Member Data Documentation

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

Definition at line 261 of file simulator.h.

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

Definition at line 260 of file simulator.h.

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

Definition at line 271 of file simulator.h.

template<class RobotType_, class EdgeType_, class WorldObjectType_>
g2o::BinarySensor< RobotType_, EdgeType_, WorldObjectType_ >::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 207 of file simulator.h.


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