Fawkes API
Fawkes Development Version
|
Laser360Interface Fawkes BlackBoard Interface. More...
#include <>>
Classes | |
struct | Laser360Interface_data_t |
Internal data storage, do NOT modify! More... | |
Public Member Functions | |
virtual bool | message_valid (const Message *message) const |
Check if message is valid and can be enqueued. | |
float * | distances () const |
Get distances value. | |
float | distances (unsigned int index) const |
Get distances value at given index. | |
void | set_distances (unsigned int index, const float new_distances) |
Set distances value at given index. | |
void | set_distances (const float *new_distances) |
Set distances value. | |
size_t | maxlenof_distances () const |
Get maximum length of distances value. | |
bool | is_clockwise_angle () const |
Get clockwise_angle value. | |
void | set_clockwise_angle (const bool new_clockwise_angle) |
Set clockwise_angle value. | |
size_t | maxlenof_clockwise_angle () const |
Get maximum length of clockwise_angle value. | |
virtual Message * | create_message (const char *type) const |
Create message based on type name. | |
virtual void | copy_values (const Interface *other) |
Copy values from other interface. | |
virtual const char * | enum_tostring (const char *enumtype, int val) const |
Convert arbitrary enum value to string. |
Laser360Interface Fawkes BlackBoard Interface.
This interface provides access to data of a laser scanner that produces 360 beams per scan. The inter-beam distance is 1 deg, 0 deg is "forward", i.e. in the Fawkes coordinate system pointing towards the cartesian point (1,0). The direction in which the angle grows is indicated by the clockwise_angle field.
void fawkes::Laser360Interface::copy_values | ( | const Interface * | other | ) | [virtual] |
Copy values from other interface.
other | other interface to copy values from |
Implements fawkes::Interface.
Definition at line 182 of file Laser360Interface.cpp.
References fawkes::Message::type(), and fawkes::Interface::type().
Message * fawkes::Laser360Interface::create_message | ( | const char * | type | ) | const [virtual] |
Create message based on type name.
This will create a new message of the given type. The type must be given without the InterfaceName:: prefix but just the plain class name of the message.
type | message type |
UnknownTypeException | thrown if this interface cannot create a message of the given type. |
Implements fawkes::Interface.
Definition at line 171 of file Laser360Interface.cpp.
float * fawkes::Laser360Interface::distances | ( | ) | const |
Get distances value.
The distances in meter of the beams.
Definition at line 74 of file Laser360Interface.cpp.
Referenced by LaserSensorThread::loop(), LaserHtSensorProcThread::loop(), LaserDrawingArea::draw_beams(), and LaserDrawingArea::draw_segments().
float fawkes::Laser360Interface::distances | ( | unsigned int | index | ) | const |
Get distances value at given index.
The distances in meter of the beams.
index | index of value |
Exception | thrown if index is out of bounds |
Definition at line 88 of file Laser360Interface.cpp.
const char * fawkes::Laser360Interface::enum_tostring | ( | const char * | enumtype, |
int | val | ||
) | const [virtual] |
Convert arbitrary enum value to string.
Given the string representation of the enum type and the value this method returns the string representation of the specific value, or the string UNKNOWN if the value is not defined. An exception is thrown if the enum type is invalid.
enumtype | enum type as string |
val | value to convert |
UnknownTypeException | thrown if enumtype is not specified for interface. |
Implements fawkes::Interface.
Definition at line 193 of file Laser360Interface.cpp.
bool fawkes::Laser360Interface::is_clockwise_angle | ( | ) | const |
Get clockwise_angle value.
True if the angle grows clockwise.
Definition at line 141 of file Laser360Interface.cpp.
Referenced by LaserDrawingArea::draw_beams().
size_t fawkes::Laser360Interface::maxlenof_clockwise_angle | ( | ) | const |
Get maximum length of clockwise_angle value.
Definition at line 151 of file Laser360Interface.cpp.
size_t fawkes::Laser360Interface::maxlenof_distances | ( | ) | const |
Get maximum length of distances value.
Definition at line 101 of file Laser360Interface.cpp.
Referenced by LaserHtSensorProcThread::loop(), and LaserDrawingArea::draw_beams().
bool fawkes::Laser360Interface::message_valid | ( | const Message * | message | ) | const [virtual] |
Check if message is valid and can be enqueued.
message | Message to check |
Implements fawkes::Interface.
Definition at line 204 of file Laser360Interface.cpp.
void fawkes::Laser360Interface::set_clockwise_angle | ( | const bool | new_clockwise_angle | ) |
Set clockwise_angle value.
True if the angle grows clockwise.
new_clockwise_angle | new clockwise_angle value |
Definition at line 163 of file Laser360Interface.cpp.
References fawkes::Interface::data_changed.
Referenced by LaserSensorThread::init().
void fawkes::Laser360Interface::set_distances | ( | unsigned int | index, |
const float | new_distances | ||
) |
Set distances value at given index.
The distances in meter of the beams.
new_distances | new distances value |
index | index for of the value |
Definition at line 127 of file Laser360Interface.cpp.
Referenced by LaserSensorThread::loop(), and PlayerLaserMapper::sync_player_to_fawkes().
void fawkes::Laser360Interface::set_distances | ( | const float * | new_distances | ) |
Set distances value.
The distances in meter of the beams.
new_distances | new distances value |
Definition at line 113 of file Laser360Interface.cpp.
References fawkes::Interface::data_changed.