openrave.org

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
OpenRAVE::SimpleSensorSystem Class Reference

A very simple sensor system example that manages raw detection data. More...

#include <sensorsystem.h>

Inheritance diagram for OpenRAVE::SimpleSensorSystem:
Inheritance graph
[legend]
Collaboration diagram for OpenRAVE::SimpleSensorSystem:
Collaboration graph
[legend]

Classes

class  BodyData
 
class  SimpleXMLReader
 
class  XMLData
 

Public Member Functions

 SimpleSensorSystem (const std::string &xmlid, EnvironmentBasePtr penv)
 
virtual ~SimpleSensorSystem ()
 
virtual void Reset ()
 resets the system and stops managing all objects. Any objects that are not locked, are deleted
 
virtual void AddRegisteredBodies (const std::vector< KinBodyPtr > &vbodies)
 automatically register bodies that have some type of SensorSystem data (usually done through xml)
 
virtual KinBody::ManageDataPtr AddKinBody (KinBodyPtr pbody, XMLReadableConstPtr pdata)
 
virtual bool RemoveKinBody (KinBodyPtr pbody)
 remove body from sensory system. If bDestroy is true, will also deallocate the memory
 
virtual bool IsBodyPresent (KinBodyPtr pbody)
 returns true if body is present
 
virtual bool EnableBody (KinBodyPtr pbody, bool bEnable)
 enable/disable a body from being updated by the sensor system
 
virtual bool SwitchBody (KinBodyPtr pbody1, KinBodyPtr pbody2)
 
- Public Member Functions inherited from OpenRAVE::SensorSystemBase
 SensorSystemBase (EnvironmentBasePtr penv)
 
virtual ~SensorSystemBase ()
 
- Public Member Functions inherited from OpenRAVE::InterfaceBase
 InterfaceBase (InterfaceType type, EnvironmentBasePtr penv)
 
virtual ~InterfaceBase ()
 
InterfaceType GetInterfaceType () const
 
const std::string & GetXMLId () const
 
const std::string & GetPluginName () const
 
EnvironmentBasePtr GetEnv () const
 
const READERSMAPGetReadableInterfaces () const
 Returns the raw map reference, this is not multithread safe and the GetInterfaceMutex should be locked before using.
 
virtual XMLReadablePtr GetReadableInterface (const std::string &xmltag) const
 Returns the readable interface. [multi-thread safe]
 
virtual XMLReadablePtr SetReadableInterface (const std::string &xmltag, XMLReadablePtr readable)
 Set a new readable interface and return the previously set interface if it exists. [multi-thread safe]
 
virtual const std::string & GetDescription () const
 Documentation of the interface in reStructuredText format. See Documenting Interfaces. [multi-thread safe]
 
virtual void SetDescription (const std::string &description)
 sets a description [multi-thread safe]
 
virtual void SetUserData (const std::string &key, UserDataPtr data) const
 set user data for a specific key. [multi-thread safe]
 
virtual UserDataPtr GetUserData (const std::string &key=std::string()) const
 return the user custom data [multi-thread safe]
 
virtual bool RemoveUserData (const std::string &key) const
 removes a user data pointer. if user data pointer does not exist, then return 0, otherwise 1. [multi-thread safe]
 
virtual void SetUserData (UserDataPtr data) RAVE_DEPRECATED
 
virtual const std::string & GetURI () const
 the URI used to load the interface (sometimes this is not possible if the definition lies inside an environment file). [multi-thread safe]
 
virtual const std::string & GetXMLFilename () const
 
virtual void Clone (InterfaceBaseConstPtr preference, int cloningoptions)
 Clone the contents of an interface to the current interface.
 
virtual bool SendCommand (std::ostream &os, std::istream &is)
 Used to send special commands to the interface and receive output.
 
virtual void Serialize (BaseXMLWriterPtr writer, int options=0) const
 serializes the interface
 

Static Public Member Functions

static UserDataPtr RegisterXMLReaderId (EnvironmentBasePtr penv, const std::string &xmlid)
 registers the XML reader, do not call in the constructor of this class!
 
- Static Public Member Functions inherited from OpenRAVE::SensorSystemBase
static InterfaceType GetInterfaceTypeStatic ()
 return the static interface type this class points to (used for safe casting)
 

Protected Types

typedef std::pair
< boost::shared_ptr< BodyData >
, Transform
SNAPSHOT
 
typedef std::map< int,
boost::shared_ptr< BodyData > > 
BODIES
 

Protected Member Functions

virtual boost::shared_ptr
< BodyData
CreateBodyData (KinBodyPtr pbody, boost::shared_ptr< XMLData const > pdata)
 
virtual void _UpdateBodies (std::list< SNAPSHOT > &listbodies)
 
virtual void _UpdateBodiesThread ()
 
virtual void SetRecentTransform (boost::shared_ptr< BodyData > pdata, const Transform &t)
 
- Protected Member Functions inherited from OpenRAVE::SensorSystemBase
virtual void SetManageData (KinBodyPtr pbody, KinBody::ManageDataPtr data)
 
- Protected Member Functions inherited from OpenRAVE::InterfaceBase
virtual void RegisterCommand (const std::string &cmdname, InterfaceCommandFn fncmd, const std::string &strhelp)
 Registers a command and its help string. [multi-thread safe]
 
virtual void UnregisterCommand (const std::string &cmdname)
 Unregisters the command. [multi-thread safe]
 
virtual boost::shared_mutex & GetInterfaceMutex () const
 

Static Protected Member Functions

static BaseXMLReaderPtr CreateXMLReaderId (const std::string &xmlid, InterfaceBasePtr ptr, const AttributesList &atts)
 creates a reader to parse the data
 

Protected Attributes

std::string _xmlid
 
BODIES _mapbodies
 
boost::mutex _mutex
 
uint64_t _expirationtime
 expiration time in us
 
bool _bShutdown
 
boost::thread _threadUpdate
 

Additional Inherited Members

- Public Types inherited from OpenRAVE::InterfaceBase
typedef std::map< std::string,
XMLReadablePtr,
CaseInsensitiveCompare
READERSMAP
 

Detailed Description

A very simple sensor system example that manages raw detection data.

Definition at line 76 of file sensorsystem.h.

Member Typedef Documentation

typedef std::map<int,boost::shared_ptr<BodyData> > OpenRAVE::SimpleSensorSystem::BODIES
protected

Definition at line 189 of file sensorsystem.h.

typedef std::pair<boost::shared_ptr<BodyData>, Transform > OpenRAVE::SimpleSensorSystem::SNAPSHOT
protected

Definition at line 188 of file sensorsystem.h.

Constructor & Destructor Documentation

OpenRAVE::SimpleSensorSystem::SimpleSensorSystem ( const std::string &  xmlid,
EnvironmentBasePtr  penv 
)

Definition at line 102 of file sensorsystem.cpp.

OpenRAVE::SimpleSensorSystem::~SimpleSensorSystem ( )
virtual

Definition at line 108 of file sensorsystem.cpp.

Member Function Documentation

void OpenRAVE::SimpleSensorSystem::_UpdateBodies ( std::list< SNAPSHOT > &  listbodies)
protectedvirtual

Definition at line 219 of file sensorsystem.cpp.

void OpenRAVE::SimpleSensorSystem::_UpdateBodiesThread ( )
protectedvirtual

Definition at line 277 of file sensorsystem.cpp.

KinBody::ManageDataPtr OpenRAVE::SimpleSensorSystem::AddKinBody ( KinBodyPtr  pbody,
XMLReadableConstPtr  pdata 
)
virtual

add body for registering with sensor system pdata is a pointer to a data structor holding tracking/registration information for the system

Implements OpenRAVE::SensorSystemBase.

Definition at line 135 of file sensorsystem.cpp.

void OpenRAVE::SimpleSensorSystem::AddRegisteredBodies ( const std::vector< KinBodyPtr > &  vbodies)
virtual

automatically register bodies that have some type of SensorSystem data (usually done through xml)

Implements OpenRAVE::SensorSystemBase.

Definition at line 121 of file sensorsystem.cpp.

boost::shared_ptr< SimpleSensorSystem::BodyData > OpenRAVE::SimpleSensorSystem::CreateBodyData ( KinBodyPtr  pbody,
boost::shared_ptr< XMLData const >  pdata 
)
protectedvirtual

Definition at line 212 of file sensorsystem.cpp.

BaseXMLReaderPtr OpenRAVE::SimpleSensorSystem::CreateXMLReaderId ( const std::string &  xmlid,
InterfaceBasePtr  ptr,
const AttributesList atts 
)
staticprotected

creates a reader to parse the data

Definition at line 92 of file sensorsystem.cpp.

bool OpenRAVE::SimpleSensorSystem::EnableBody ( KinBodyPtr  pbody,
bool  bEnable 
)
virtual

enable/disable a body from being updated by the sensor system

Implements OpenRAVE::SensorSystemBase.

Definition at line 175 of file sensorsystem.cpp.

bool OpenRAVE::SimpleSensorSystem::IsBodyPresent ( KinBodyPtr  pbody)
virtual

returns true if body is present

Implements OpenRAVE::SensorSystemBase.

Definition at line 169 of file sensorsystem.cpp.

UserDataPtr OpenRAVE::SimpleSensorSystem::RegisterXMLReaderId ( EnvironmentBasePtr  penv,
const std::string &  xmlid 
)
static

registers the XML reader, do not call in the constructor of this class!

Definition at line 97 of file sensorsystem.cpp.

bool OpenRAVE::SimpleSensorSystem::RemoveKinBody ( KinBodyPtr  pbody)
virtual

remove body from sensory system. If bDestroy is true, will also deallocate the memory

Implements OpenRAVE::SensorSystemBase.

Definition at line 161 of file sensorsystem.cpp.

void OpenRAVE::SimpleSensorSystem::Reset ( )
virtual

resets the system and stops managing all objects. Any objects that are not locked, are deleted

Implements OpenRAVE::SensorSystemBase.

Definition at line 115 of file sensorsystem.cpp.

virtual void OpenRAVE::SimpleSensorSystem::SetRecentTransform ( boost::shared_ptr< BodyData pdata,
const Transform t 
)
inlineprotectedvirtual

Definition at line 194 of file sensorsystem.h.

bool OpenRAVE::SimpleSensorSystem::SwitchBody ( KinBodyPtr  pbody1,
KinBodyPtr  pbody2 
)
virtual

switches the registrations of two bodies. Can be used to quickly change the models of the current bodies

Parameters
pbody1First body to switch
pbody2Second body to switch

Implements OpenRAVE::SensorSystemBase.

Definition at line 188 of file sensorsystem.cpp.

Member Data Documentation

bool OpenRAVE::SimpleSensorSystem::_bShutdown
protected

Definition at line 205 of file sensorsystem.h.

uint64_t OpenRAVE::SimpleSensorSystem::_expirationtime
protected

expiration time in us

Definition at line 204 of file sensorsystem.h.

BODIES OpenRAVE::SimpleSensorSystem::_mapbodies
protected

Definition at line 202 of file sensorsystem.h.

boost::mutex OpenRAVE::SimpleSensorSystem::_mutex
protected

Definition at line 203 of file sensorsystem.h.

boost::thread OpenRAVE::SimpleSensorSystem::_threadUpdate
protected

Definition at line 206 of file sensorsystem.h.

std::string OpenRAVE::SimpleSensorSystem::_xmlid
protected

Definition at line 201 of file sensorsystem.h.


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