Public Member Functions | Static Public Attributes | Protected Attributes

JAUS::RangeSensor Class Reference

The RangeSensor service allows you to share range scan information from multiple devices with different capabilities. Example devices include LIDAR, or sonar, etc. More...

#include <rangesensor.h>

Inheritance diagram for JAUS::RangeSensor:
JAUS::Events::Child JAUS::Service

List of all members.

Public Member Functions

 RangeSensor ()
 Constructor.
 ~RangeSensor ()
 Destructor.
void AddRangeDevice (const RangeSensorConfig &configuration)
 Add configuration information and support for a range sensing device.
void SetLocalRangeScan (const Byte deviceID, const Point3D &deviceLocation, const Point3D &deviceOrientation, const std::vector< UShort > &scan, const Time &timestamp=Time())
 Set the current scan collected/received from the device.
void SetLocalRangeScan (const Byte deviceID, const Point3D &deviceLocation, const Point3D &deviceOrientation, const std::vector< double > &scan, const Time &timestamp=Time())
 Set the current scan collected/received from the device.
void SetLocalRangeScan (const Byte deviceID, const Point3D &deviceLocation, const Point3D &deviceOrientation, const Point3D::List &scan, const Time &timestamp=Time())
 Set the current scan collected/received from the device.
virtual bool GenerateEvent (const Events::Subscription &info) const
 Generates an event for the given information.
virtual bool IsEventSupported (const Events::Type type, const double requestedPeriodicRate, const Message *queryMessage, double &confirmedPeriodicRate, std::string &errorMessage) const
 Checks if the event is supported by the Service.
virtual bool IsDiscoverable () const
virtual void Receive (const Message *message)
 Processes message received by the Service. If not supported, then message is passed to inheriting services depending on what type of control has been established for the component.
virtual MessageCreateMessage (const UShort messageCode) const
 Attempts to create the message desired. Only message supported by this Service can be created by this Service.

Static Public Attributes

static const std::string Name = "urn:jaus:jss:jpp:extras:RangeSensor"
 String name of the Service.

Protected Attributes

Mutex mRangeSensorMutex
 Mutex for thread protection of data.
RangeSensorConfig::Map mRangeSensors
 Range sensor information.
std::map< Byte,
ReportLocalRangeScan
mRangeScans
 Current range scan data for sensors.

Detailed Description

The RangeSensor service allows you to share range scan information from multiple devices with different capabilities. Example devices include LIDAR, or sonar, etc.

Definition at line 60 of file rangesensor.h.


Constructor & Destructor Documentation

RangeSensor::RangeSensor (  )

Constructor.

Definition at line 54 of file rangesensor.cpp.

RangeSensor::~RangeSensor (  )

Destructor.

Definition at line 64 of file rangesensor.cpp.


Member Function Documentation

void RangeSensor::AddRangeDevice ( const RangeSensorConfig configuration )

Add configuration information and support for a range sensing device.

This step must be taken before call SetLocalRangeScan, otherwise the data will be ignored. It also must be used to let subscribers know about what range data is available.

Parameters:
[in]configurationRange sensor configuration data.

Definition at line 80 of file rangesensor.cpp.

Message * RangeSensor::CreateMessage ( const UShort  messageCode ) const [virtual]

Attempts to create the message desired. Only message supported by this Service can be created by this Service.

Parameters:
[in]messageCodeMessage to create.
Returns:
Pointer to newly allocated Message data, NULL if message is not supported by the Service.

Implements JAUS::Service.

Definition at line 396 of file rangesensor.cpp.

bool RangeSensor::GenerateEvent ( const Events::Subscription info ) const [virtual]

Generates an event for the given information.

Parameters:
[in]infoThe event information (ID, Sequence #, etc.) for generation.
Returns:
True if event generated, otherwise false.

Implements JAUS::Events::Child.

Definition at line 270 of file rangesensor.cpp.

virtual bool JAUS::RangeSensor::IsDiscoverable (  ) const [inline, virtual]

Implements JAUS::Service.

Definition at line 97 of file rangesensor.h.

bool RangeSensor::IsEventSupported ( const Events::Type  type,
const double  requestedPeriodicRate,
const Message queryMessage,
double &  confirmedPeriodicRate,
std::string &  errorMessage 
) const [virtual]

Checks if the event is supported by the Service.

Parameters:
[in]typeThe event type (Periodic/EveryChange).
[in]requestedPeriodicRateIf type == Periodic, then this is the desired update rate.
[in]queryMessageThe query message associated with the event.
[out]confirmedPeriodicRateThis is the confirmed periodic rate supported by the Service.
[out]errorMessageIf not supported, this is an optional error message.
Returns:
True if event supported, otherwise false.

Implements JAUS::Events::Child.

Definition at line 330 of file rangesensor.cpp.

void RangeSensor::Receive ( const Message message ) [virtual]

Processes message received by the Service. If not supported, then message is passed to inheriting services depending on what type of control has been established for the component.

This Service supports PrimitiveDriver related messages only.

Parameters:
[in]messageMessage data to process.

Reimplemented from JAUS::Service.

Definition at line 358 of file rangesensor.cpp.

void RangeSensor::SetLocalRangeScan ( const Byte  deviceID,
const Point3D deviceLocation,
const Point3D deviceOrientation,
const Point3D::List &  scan,
const Time timestamp = Time() 
)

Set the current scan collected/received from the device.

Parameters:
[in]deviceIDDevice ID number.
[in]deviceLocationLocation on the paltform relative to it's origin when the scan was performed (meters). Values are in the platform coordinate frame (e.g. positive x is in front of vehicle).
[in]deviceOrientationOrientation of the device (x = roll, y = pitch, z = yaw), when the scan was performed.
[in]scanThe scan/range data collected. The units are in meters. Values start from the left, and go to the right (e.g. first value at -90, last at 90 for 180 degree scan). X values in points are the range data.
[in]timestampTime when the data was captured (UTC).

Definition at line 222 of file rangesensor.cpp.

void RangeSensor::SetLocalRangeScan ( const Byte  deviceID,
const Point3D deviceLocation,
const Point3D deviceOrientation,
const std::vector< double > &  scan,
const Time timestamp = Time() 
)

Set the current scan collected/received from the device.

Parameters:
[in]deviceIDDevice ID number.
[in]deviceLocationLocation on the paltform relative to it's origin when the scan was performed (meters). Values are in the platform coordinate frame (e.g. positive x is in front of vehicle).
[in]deviceOrientationOrientation of the device (x = roll, y = pitch, z = yaw), when the scan was performed.
[in]scanThe scan/range data collected. The units are in meters. Values start from the left, and go to the right (e.g. first value at -90, last at 90 for 180 degree scan).
[in]timestampTime when the data was captured (UTC).

Definition at line 165 of file rangesensor.cpp.

void RangeSensor::SetLocalRangeScan ( const Byte  deviceID,
const Point3D deviceLocation,
const Point3D deviceOrientation,
const std::vector< UShort > &  scan,
const Time timestamp = Time() 
)

Set the current scan collected/received from the device.

Parameters:
[in]deviceIDDevice ID number.
[in]deviceLocationLocation on the paltform relative to it's origin when the scan was performed (meters). Values are in the platform coordinate frame (e.g. positive x is in front of vehicle).
[in]deviceOrientationOrientation of the device (x = roll, y = pitch, z = yaw), when the scan was performed.
[in]scanThe scan/range data collected. The units will either be in MM or CM depending on the device and must match the unit type set in the RangeSensorConfig set using the AddRangeDevice method. Values start from the left, and go to the right (e.g. first value at -90, last at 90 for 180 degree scan).
[in]timestampTime when the data was captured (UTC).

Definition at line 113 of file rangesensor.cpp.


Member Data Documentation

Current range scan data for sensors.

Definition at line 105 of file rangesensor.h.

Mutex for thread protection of data.

Definition at line 103 of file rangesensor.h.

Range sensor information.

Definition at line 104 of file rangesensor.h.

const std::string RangeSensor::Name = "urn:jaus:jss:jpp:extras:RangeSensor" [static]

String name of the Service.

Definition at line 63 of file rangesensor.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines