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>
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 ×tamp=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 ×tamp=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 ×tamp=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 Message * | CreateMessage (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. |
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.
RangeSensor::RangeSensor | ( | ) |
Constructor.
Definition at line 54 of file rangesensor.cpp.
RangeSensor::~RangeSensor | ( | ) |
Destructor.
Definition at line 64 of file rangesensor.cpp.
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.
[in] | configuration | Range sensor configuration data. |
Definition at line 80 of file rangesensor.cpp.
Attempts to create the message desired. Only message supported by this Service can be created by this Service.
[in] | messageCode | Message to create. |
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.
[in] | info | The event information (ID, Sequence #, etc.) for generation. |
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.
[in] | type | The event type (Periodic/EveryChange). |
[in] | requestedPeriodicRate | If type == Periodic, then this is the desired update rate. |
[in] | queryMessage | The query message associated with the event. |
[out] | confirmedPeriodicRate | This is the confirmed periodic rate supported by the Service. |
[out] | errorMessage | If not supported, this is an optional error message. |
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.
[in] | message | Message 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.
[in] | deviceID | Device ID number. |
[in] | deviceLocation | Location 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] | deviceOrientation | Orientation of the device (x = roll, y = pitch, z = yaw), when the scan was performed. |
[in] | scan | The 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] | timestamp | Time 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.
[in] | deviceID | Device ID number. |
[in] | deviceLocation | Location 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] | deviceOrientation | Orientation of the device (x = roll, y = pitch, z = yaw), when the scan was performed. |
[in] | scan | The 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] | timestamp | Time 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.
[in] | deviceID | Device ID number. |
[in] | deviceLocation | Location 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] | deviceOrientation | Orientation of the device (x = roll, y = pitch, z = yaw), when the scan was performed. |
[in] | scan | The 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] | timestamp | Time when the data was captured (UTC). |
Definition at line 113 of file rangesensor.cpp.
std::map<Byte, ReportLocalRangeScan> JAUS::RangeSensor::mRangeScans [protected] |
Current range scan data for sensors.
Definition at line 105 of file rangesensor.h.
Mutex JAUS::RangeSensor::mRangeSensorMutex [protected] |
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.