An interface to a custom board which interfaces two SICK laser scanners.
Implemented for the board v1.0 designed by 2008 @ ISA (University of Malaga).
PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS: ------------------------------------------------------- [DualLMS] driver = CBoardDLMS process_rate = 30 ; Hz USB_serialname = DLMS-001 mPose_x = 0 ; Master laser range scaner 6D position on the robot (meters) mPose_y = 0 mPose_z = 0 mPose_yaw = 0 mPose_pitch = 0 mPose_roll = 0 sPose_x = 0 ; Slave laser range scaner 6D position on the robot (meters) sPose_y = 0 sPose_z = 0 sPose_yaw = 0 sPose_pitch = 0 sPose_roll = 0
#include <mrpt/hwdrivers/CBoardDLMS.h>

Public Types | |||
| enum | TSeekOrigin { sFromBeginning = 0, sFromCurrent = 1, sFromEnd = 2 } | ||
| Used in CStream::Seek. More... | |||
| enum | TSensorState { ssInitializing = 0, ssWorking, ssError } | ||
| The current state of the sensor. More... | |||
| typedef std::multimap < mrpt::system::TTimeStamp, mrpt::utils::CSerializablePtr > | TListObservations | ||
| typedef std::pair < mrpt::system::TTimeStamp, mrpt::utils::CSerializablePtr > | TListObsPair | ||
Public Member Functions | |||
| CBoardDLMS () | |||
| Constructor. | |||
| virtual | ~CBoardDLMS () | ||
| Destructor. | |||
| void | doProcess () | ||
| This method should be called periodically (at least at 1Hz to capture ALL the real-time data) It is thread safe, i.e. | |||
| virtual void | initialize () | ||
| This method can or cannot be implemented in the derived class, depending on the need for it. | |||
| bool | queryFirmwareVersion (std::string &out_firmwareVersion) | ||
| Query the firmware version on the device (can be used to test communications). | |||
| bool | sendCommand (uint8_t command, std::vector< unsigned char > &response) | ||
| Send a command to the DLMS Board. | |||
| bool | queryTimeStamp (mrpt::system::TTimeStamp &tstamp) | ||
| bool | isOpen () | ||
| Checks whether the chip has been successfully open. | |||
| void | OpenBySerialNumber (const std::string &serialNumber) | ||
| Open by device serial number. | |||
| void | OpenByDescription (const std::string &description) | ||
| Open by device description. | |||
| void | Close () | ||
| Close the USB device. | |||
| void | ResetDevice () | ||
| Reset the USB device. | |||
| void | Purge () | ||
| Purge the I/O buffers. | |||
| void | SetLatencyTimer (unsigned char latency_ms) | ||
| Change the latency timer (in milliseconds) implemented on the FTDI chip: for a few ms, data is not sent to the PC waiting for possible more data, to save USB trafic. | |||
| void | SetTimeouts (unsigned long dwReadTimeout_ms, unsigned long dwWriteTimeout_ms) | ||
| Change read & write timeouts, in milliseconds. | |||
| void | ListAllDevices (TFTDIDeviceList &outList) | ||
| Generates a list with all FTDI devices connected right now. | |||
| size_t | ReadSync (void *Buffer, size_t Count) | ||
| Tries to read, raising no exception if not all the bytes are available, but raising one if there is some communication error. | |||
| size_t | WriteSync (const void *Buffer, size_t Count) | ||
| Tries to write, raising no exception if not all the bytes are available, but raising one if there is some communication error. | |||
| virtual size_t | ReadBufferImmediate (void *Buffer, size_t Count) | ||
| Reads a block of bytes from the stream into Buffer, and returns the amound of bytes actually read, without waiting for more extra bytes to arrive (just those already enqued in the stream). | |||
| size_t | ReadBuffer (void *Buffer, size_t Count) | ||
Reads a block of bytes from the stream into Buffer
| |||
| template<typename T > | |||
| size_t | ReadBufferFixEndianness (T *ptr, size_t ElementCount) | ||
| Reads a sequence of elemental datatypes, taking care of reordering their bytes from the MRPT stream standard (little endianness) to the format of the running architecture. | |||
| void | WriteBuffer (const void *Buffer, size_t Count) | ||
| Writes a block of bytes to the stream from Buffer. | |||
| template<typename T > | |||
| void | WriteBufferFixEndianness (const T *ptr, size_t ElementCount) | ||
| Writes a sequence of elemental datatypes, taking care of reordering their bytes from the running architecture to MRPT stream standard (little endianness). | |||
| size_t | CopyFrom (CStream *Source, size_t Count) | ||
| Copies a specified number of bytes from one stream to another. | |||
| void | WriteObject (const CSerializable *o) | ||
| Writes an object to the stream. | |||
| CSerializablePtr | ReadObject () | ||
| Reads an object from stream, its class determined at runtime, and returns a smart pointer to the object. | |||
| void | ReadObject (CSerializable *existingObj) | ||
| Reads an object from stream, where its class must be the same as the supplied object, where the loaded object will be stored in. | |||
| CStream & | operator<< (const CSerializablePtr &pObj) | ||
| Write an object to a stream in the binary MRPT format. | |||
| CStream & | operator<< (const CSerializable &obj) | ||
| Write an object to a stream in the binary MRPT format. | |||
| CStream & | operator>> (CSerializablePtr &pObj) | ||
| CStream & | operator>> (CSerializable &obj) | ||
| virtual int | printf (const char *fmt,...) MRPT_printf_format_check(2 | ||
| Writes a string to the stream in a textual form. | |||
| template<typename T > | |||
| virtual int void | printf_vector (const char *fmt, const std::vector< T > &V) | ||
| Prints a vector in the format [A,B,C,...] using CStream::printf, and the fmt string for each vector element. | |||
| void | sendMessage (const utils::CMessage &msg) | ||
| Send a message to the device. | |||
| bool | receiveMessage (utils::CMessage &msg) | ||
| Tries to receive a message from the device. | |||
| bool | getline (std::string &out_str) | ||
| Reads from the stream until a ' ' character is found ('' characters are ignored). | |||
| virtual const mrpt::hwdrivers::TSensorClassId * | GetRuntimeClass () const =0 | ||
| TSensorState | getState () const | ||
| The current state of the sensor. | |||
| double | getProcessRate () const | ||
| std::string | getSensorLabel () const | ||
| void | setSensorLabel (const std::string &sensorLabel) | ||
| void | loadConfig (const mrpt::utils::CConfigFileBase &configSource, const std::string §ion) | ||
Loads the generic settings common to any sensor (See CGenericSensor), then call to "loadConfig_sensorSpecific"
| |||
| void | getObservations (TListObservations &lstObjects) | ||
| Returns a list of enqueued objects, emptying it (thread-safe). | |||
| virtual void | setPathForExternalImages (const std::string &directory) | ||
| Set the path where to save off-rawlog image files (will be ignored in those sensors where this is not applicable). | |||
| void | setExternalImageFormat (const std::string &ext) | ||
| Set the extension ("jpg","gif","png",...) that determines the format of images saved externally The default is "jpg". | |||
| void | setExternalImageJPEGQuality (const unsigned int quality) | ||
| The quality of JPEG compression, when external images is enabled and the format is "jpg". | |||
| unsigned int | getExternalImageJPEGQuality () const | ||
Static Public Member Functions | |||
| static void | registerClass (const TSensorClassId *pNewClass) | ||
| Register a class into the internal list of "CGenericSensor" descendents. | |||
| static CGenericSensor * | createSensor (const std::string &className) | ||
| Creates a sensor by a name of the class. | |||
| static CGenericSensorPtr | createSensorPtr (const std::string &className) | ||
| Just like createSensor, but returning a smart pointer to the newly created sensor object. | |||
Protected Member Functions | |||
| bool | checkConnectionAndConnect () | ||
| Tries to connect to the USB device (if disconnected). | |||
| bool | checkCRC (const std::vector< unsigned char > &frame) | ||
| void | loadConfig_sensorSpecific (const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection) | ||
| Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes) See hwdrivers::CBoardDLMS for the possible parameters. | |||
| size_t | Read (void *Buffer, size_t Count) | ||
| Introduces a pure virtual method responsible for reading from the stream. | |||
| size_t | Write (const void *Buffer, size_t Count) | ||
| Introduces a pure virtual method responsible for writing to the stream. | |||
| uint64_t | Seek (long Offset, CStream::TSeekOrigin Origin=sFromBeginning) | ||
| This virtual method does nothing in this class. | |||
| uint64_t | getTotalBytesCount () | ||
| This virtual method does nothing in this class. | |||
| uint64_t | getPosition () | ||
| This virtual method does nothing in this class. | |||
| void | ftdi_read (void *lpvBuffer, unsigned long dwBuffSize, unsigned long *lpdwBytesRead) | ||
| void | ftdi_write (const void *lpvBuffer, unsigned long dwBuffSize, unsigned long *lpdwBytes) | ||
| void | recursive_fill_list_devices (void *usb_device_structure, TFTDIDeviceList &outList) | ||
| Process recursively a USB device and its children: | |||
| void | appendObservations (const std::vector< mrpt::utils::CSerializablePtr > &obj) | ||
| This method must be called by derived classes to enqueue a new observation in the list to be returned by getObservations. | |||
| void | appendObservation (const mrpt::utils::CSerializablePtr &obj) | ||
| Like appendObservations() but for just one observation. | |||
Protected Attributes | |||
| std::string | m_usbSerialNumber | ||
| A copy of the device serial number (to open the USB FTDI chip) | |||
| uint32_t | m_timeStartUI | ||
| mrpt::system::TTimeStamp | m_timeStartTT | ||
| mrpt::poses::CPose3D | m_mSensorPose | ||
| mrpt::poses::CPose3D | m_sSensorPose | ||
| mrpt::utils::circular_buffer < uint8_t > | m_readBuffer | ||
| Used in Read. | |||
| void * | m_ftdi_context | ||
| size_t | m_grab_decimation_counter | ||
| Used when "m_grab_decimation" is enabled. | |||
| TSensorState | m_state | ||
| std::string | m_path_for_external_images | ||
| The path where to save off-rawlog images: empty means save images embedded in the rawlog. | |||
| std::string | m_external_images_format | ||
| The extension ("jpg","gif","png",...) that determines the format of images saved externally. | |||
| unsigned int | m_external_images_jpeg_quality | ||
| For JPEG images, the quality (default=95%). | |||
Common settings to any sensor, loaded in "loadConfig" | |||
| double | m_process_rate | ||
| See CGenericSensor. | |||
| size_t | m_max_queue_len | ||
| See CGenericSensor. | |||
| size_t | m_grab_decimation | ||
| If set to N>=2, only 1 out of N observations will be saved to m_objList. | |||
| std::string | m_sensorLabel | ||
| See CGenericSensor. | |||
typedef std::multimap< mrpt::system::TTimeStamp, mrpt::utils::CSerializablePtr > mrpt::hwdrivers::CGenericSensor::TListObservations [inherited] |
Definition at line 84 of file CGenericSensor.h.
typedef std::pair< mrpt::system::TTimeStamp, mrpt::utils::CSerializablePtr > mrpt::hwdrivers::CGenericSensor::TListObsPair [inherited] |
Definition at line 85 of file CGenericSensor.h.
enum mrpt::utils::CStream::TSeekOrigin [inherited] |
Used in CStream::Seek.
enum mrpt::hwdrivers::CGenericSensor::TSensorState [inherited] |
The current state of the sensor.
Definition at line 90 of file CGenericSensor.h.
| mrpt::hwdrivers::CBoardDLMS::CBoardDLMS | ( | ) |
Constructor.
| serialNumberUSBdevice | The serial number (text) of the device to open. The constructor will try to open the device. You can check if it failed calling "isOpen()". |
| virtual mrpt::hwdrivers::CBoardDLMS::~CBoardDLMS | ( | ) | [virtual] |
Destructor.
| void mrpt::hwdrivers::CGenericSensor::appendObservation | ( | const mrpt::utils::CSerializablePtr & | obj | ) | [inline, protected, inherited] |
Like appendObservations() but for just one observation.
Definition at line 155 of file CGenericSensor.h.
| void mrpt::hwdrivers::CGenericSensor::appendObservations | ( | const std::vector< mrpt::utils::CSerializablePtr > & | obj | ) | [protected, inherited] |
This method must be called by derived classes to enqueue a new observation in the list to be returned by getObservations.
Passed objects must be created in dynamic memory and a smart pointer passed. Example of creation:
CObservationGPSPtr o = CObservationGPSPtr( new CObservationGPS() ); o-> .... // Set data appendObservation(o);
If several observations are passed at once in the vector, they'll be considered as a block regarding the grabbing decimation factor.
| bool mrpt::hwdrivers::CBoardDLMS::checkConnectionAndConnect | ( | ) | [protected] |
Tries to connect to the USB device (if disconnected).
| bool mrpt::hwdrivers::CBoardDLMS::checkCRC | ( | const std::vector< unsigned char > & | frame | ) | [protected] |
| void mrpt::hwdrivers::CInterfaceFTDI::Close | ( | ) | [inherited] |
Close the USB device.
| size_t mrpt::utils::CStream::CopyFrom | ( | CStream * | Source, |
| size_t | Count | ||
| ) | [inherited] |
Copies a specified number of bytes from one stream to another.
| static CGenericSensor* mrpt::hwdrivers::CGenericSensor::createSensor | ( | const std::string & | className | ) | [static, inherited] |
Creates a sensor by a name of the class.
Typically the user may want to create a smart pointer around the returned pointer, whis is made with:
CGenericSensorPtr sensor = CGenericSensorPtr( CGenericSensor::createSensor("XXX") );
| static CGenericSensorPtr mrpt::hwdrivers::CGenericSensor::createSensorPtr | ( | const std::string & | className | ) | [inline, static, inherited] |
Just like createSensor, but returning a smart pointer to the newly created sensor object.
Definition at line 188 of file CGenericSensor.h.
| void mrpt::hwdrivers::CBoardDLMS::doProcess | ( | ) | [virtual] |
This method should be called periodically (at least at 1Hz to capture ALL the real-time data) It is thread safe, i.e.
you can call this from one thread, then to other methods from other threads. This method processes data from the GPS and update the object state accordingly.
Implements mrpt::hwdrivers::CGenericSensor.
| void mrpt::hwdrivers::CInterfaceFTDI::ftdi_read | ( | void * | lpvBuffer, |
| unsigned long | dwBuffSize, | ||
| unsigned long * | lpdwBytesRead | ||
| ) | [protected, inherited] |
| void mrpt::hwdrivers::CInterfaceFTDI::ftdi_write | ( | const void * | lpvBuffer, |
| unsigned long | dwBuffSize, | ||
| unsigned long * | lpdwBytes | ||
| ) | [protected, inherited] |
| unsigned int mrpt::hwdrivers::CGenericSensor::getExternalImageJPEGQuality | ( | ) | const [inline, inherited] |
Definition at line 241 of file CGenericSensor.h.
| bool mrpt::utils::CStream::getline | ( | std::string & | out_str | ) | [inherited] |
Reads from the stream until a '
' character is found ('' characters are ignored).
| void mrpt::hwdrivers::CGenericSensor::getObservations | ( | TListObservations & | lstObjects | ) | [inherited] |
Returns a list of enqueued objects, emptying it (thread-safe).
The objects must be freed by the invoker.
| uint64_t mrpt::hwdrivers::CInterfaceFTDI::getPosition | ( | ) | [protected, virtual, inherited] |
This virtual method does nothing in this class.
Implements mrpt::utils::CStream.
| double mrpt::hwdrivers::CGenericSensor::getProcessRate | ( | ) | const [inline, inherited] |
Definition at line 100 of file CGenericSensor.h.
| virtual const mrpt::hwdrivers::TSensorClassId* mrpt::hwdrivers::CGenericSensor::GetRuntimeClass | ( | ) | const [pure virtual, inherited] |
| std::string mrpt::hwdrivers::CGenericSensor::getSensorLabel | ( | ) | const [inline, inherited] |
Definition at line 102 of file CGenericSensor.h.
| TSensorState mrpt::hwdrivers::CGenericSensor::getState | ( | ) | const [inline, inherited] |
The current state of the sensor.
Definition at line 98 of file CGenericSensor.h.
| uint64_t mrpt::hwdrivers::CInterfaceFTDI::getTotalBytesCount | ( | ) | [protected, virtual, inherited] |
This virtual method does nothing in this class.
Implements mrpt::utils::CStream.
| virtual void mrpt::hwdrivers::CBoardDLMS::initialize | ( | ) | [virtual] |
This method can or cannot be implemented in the derived class, depending on the need for it.
| This | method must throw an exception with a descriptive message if some critical error is found. |
Reimplemented from mrpt::hwdrivers::CGenericSensor.
| bool mrpt::hwdrivers::CInterfaceFTDI::isOpen | ( | ) | [inherited] |
Checks whether the chip has been successfully open.
| void mrpt::hwdrivers::CInterfaceFTDI::ListAllDevices | ( | TFTDIDeviceList & | outList | ) | [inherited] |
Generates a list with all FTDI devices connected right now.
| void mrpt::hwdrivers::CGenericSensor::loadConfig | ( | const mrpt::utils::CConfigFileBase & | configSource, |
| const std::string & | section | ||
| ) | [inherited] |
Loads the generic settings common to any sensor (See CGenericSensor), then call to "loadConfig_sensorSpecific"
| This | method throws an exception with a descriptive message if some critical parameter is missing or has an invalid value. |
| void mrpt::hwdrivers::CBoardDLMS::loadConfig_sensorSpecific | ( | const mrpt::utils::CConfigFileBase & | configSource, |
| const std::string & | iniSection | ||
| ) | [protected, virtual] |
Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes) See hwdrivers::CBoardDLMS for the possible parameters.
Implements mrpt::hwdrivers::CGenericSensor.
| void mrpt::hwdrivers::CInterfaceFTDI::OpenByDescription | ( | const std::string & | description | ) | [inherited] |
Open by device description.
| void mrpt::hwdrivers::CInterfaceFTDI::OpenBySerialNumber | ( | const std::string & | serialNumber | ) | [inherited] |
Open by device serial number.
| CStream& mrpt::utils::CStream::operator<< | ( | const CSerializablePtr & | pObj | ) | [inherited] |
Write an object to a stream in the binary MRPT format.
| CStream& mrpt::utils::CStream::operator<< | ( | const CSerializable & | obj | ) | [inherited] |
Write an object to a stream in the binary MRPT format.
| CStream& mrpt::utils::CStream::operator>> | ( | CSerializablePtr & | pObj | ) | [inherited] |
| CStream& mrpt::utils::CStream::operator>> | ( | CSerializable & | obj | ) | [inherited] |
| virtual int mrpt::utils::CStream::printf | ( | const char * | fmt, |
| ... | |||
| ) | [virtual, inherited] |
Writes a string to the stream in a textual form.
| virtual int void mrpt::utils::CStream::printf_vector | ( | const char * | fmt, |
| const std::vector< T > & | V | ||
| ) | [inline, inherited] |
Prints a vector in the format [A,B,C,...] using CStream::printf, and the fmt string for each vector element.
| void mrpt::hwdrivers::CInterfaceFTDI::Purge | ( | ) | [inherited] |
Purge the I/O buffers.
| bool mrpt::hwdrivers::CBoardDLMS::queryFirmwareVersion | ( | std::string & | out_firmwareVersion | ) |
Query the firmware version on the device (can be used to test communications).
| bool mrpt::hwdrivers::CBoardDLMS::queryTimeStamp | ( | mrpt::system::TTimeStamp & | tstamp | ) |
| size_t mrpt::hwdrivers::CInterfaceFTDI::Read | ( | void * | Buffer, |
| size_t | Count | ||
| ) | [protected, virtual, inherited] |
Introduces a pure virtual method responsible for reading from the stream.
It integrates a cache buffer to speed-up sequences of many, small readings.
Implements mrpt::utils::CStream.
| size_t mrpt::utils::CStream::ReadBuffer | ( | void * | Buffer, |
| size_t | Count | ||
| ) | [inherited] |
Reads a block of bytes from the stream into Buffer
| std::exception | On any error, or if ZERO bytes are read. |
| size_t mrpt::utils::CStream::ReadBufferFixEndianness | ( | T * | ptr, |
| size_t | ElementCount | ||
| ) | [inline, inherited] |
Reads a sequence of elemental datatypes, taking care of reordering their bytes from the MRPT stream standard (little endianness) to the format of the running architecture.
| ElementCount | The number of elements (not bytes) to read. |
| ptr | A pointer to the first output element in an array (or std::vector<>, etc...). |
uint32_t N; s >> N; vector<float> vec(N); if (N) s.ReadBufferFixEndianness<float>(&vec[0],N);
| std::exception | On any error, or if ZERO bytes are read. |
Definition at line 109 of file CStream.h.
References mrpt::utils::reverseBytesInPlace().
Referenced by mrpt::math::operator>>().
| virtual size_t mrpt::hwdrivers::CInterfaceFTDI::ReadBufferImmediate | ( | void * | Buffer, |
| size_t | Count | ||
| ) | [virtual, inherited] |
Reads a block of bytes from the stream into Buffer, and returns the amound of bytes actually read, without waiting for more extra bytes to arrive (just those already enqued in the stream).
In this class this method actually behaves as expected and does not fallback to ReadBuffer().
| std::exception | On any error, or if ZERO bytes are read. |
Reimplemented from mrpt::utils::CStream.
| CSerializablePtr mrpt::utils::CStream::ReadObject | ( | ) | [inherited] |
Reads an object from stream, its class determined at runtime, and returns a smart pointer to the object.
| std::exception | On I/O error or undefined class. |
| mrpt::utils::CExceptionEOF | On an End-Of-File condition found at a correct place: an EOF that abruptly finishes in the middle of one object raises a plain std::exception instead. |
Referenced by mrpt::math::operator>>().
| void mrpt::utils::CStream::ReadObject | ( | CSerializable * | existingObj | ) | [inherited] |
Reads an object from stream, where its class must be the same as the supplied object, where the loaded object will be stored in.
| std::exception | On I/O error or different class found. |
| mrpt::utils::CExceptionEOF | On an End-Of-File condition found at a correct place: an EOF that abruptly finishes in the middle of one object raises a plain std::exception instead. |
| size_t mrpt::hwdrivers::CInterfaceFTDI::ReadSync | ( | void * | Buffer, |
| size_t | Count | ||
| ) | [inline, inherited] |
Tries to read, raising no exception if not all the bytes are available, but raising one if there is some communication error.
Definition at line 144 of file CInterfaceFTDI.h.
| bool mrpt::utils::CStream::receiveMessage | ( | utils::CMessage & | msg | ) | [inherited] |
Tries to receive a message from the device.
| std::exception | On communication errors |
| void mrpt::hwdrivers::CInterfaceFTDI::recursive_fill_list_devices | ( | void * | usb_device_structure, |
| TFTDIDeviceList & | outList | ||
| ) | [protected, inherited] |
Process recursively a USB device and its children:
| static void mrpt::hwdrivers::CGenericSensor::registerClass | ( | const TSensorClassId * | pNewClass | ) | [static, inherited] |
Register a class into the internal list of "CGenericSensor" descendents.
Used internally in the macros DEFINE_GENERIC_SENSOR, etc...
Can be used as "CGenericSensor::registerClass( SENSOR_CLASS_ID(CMySensor) );" if building custom sensors outside mrpt libraries in user code.
| void mrpt::hwdrivers::CInterfaceFTDI::ResetDevice | ( | ) | [inherited] |
Reset the USB device.
| uint64_t mrpt::hwdrivers::CInterfaceFTDI::Seek | ( | long | Offset, |
| CStream::TSeekOrigin | Origin = sFromBeginning |
||
| ) | [protected, virtual, inherited] |
This virtual method does nothing in this class.
Implements mrpt::utils::CStream.
| bool mrpt::hwdrivers::CBoardDLMS::sendCommand | ( | uint8_t | command, |
| std::vector< unsigned char > & | response | ||
| ) |
Send a command to the DLMS Board.
| void mrpt::utils::CStream::sendMessage | ( | const utils::CMessage & | msg | ) | [inherited] |
Send a message to the device.
Note that only the low byte from the "type" field will be used.
For frames of size < 255 the frame format is an array of bytes in this order:
<START_FLAG> <HEADER> <LENGTH> <BODY> <END_FLAG>
<START_FLAG> = 0x69
<HEADER> = A header byte
<LENGHT> = Number of bytes of BODY
<BODY> = N x bytes
<END_FLAG> = 0X96
Total length = <LENGTH> + 4
For frames of size > 255 the frame format is an array of bytes in this order:
<START_FLAG> <HEADER> <HIBYTE(LENGTH)> <LOBYTE(LENGTH)> <BODY> <END_FLAG>
<START_FLAG> = 0x79
<HEADER> = A header byte
<LENGHT> = Number of bytes of BODY
<BODY> = N x bytes
<END_FLAG> = 0X96
Total length = <LENGTH> + 5
| std::exception | On communication errors |
| void mrpt::hwdrivers::CGenericSensor::setExternalImageFormat | ( | const std::string & | ext | ) | [inline, inherited] |
Set the extension ("jpg","gif","png",...) that determines the format of images saved externally The default is "jpg".
Definition at line 233 of file CGenericSensor.h.
| void mrpt::hwdrivers::CGenericSensor::setExternalImageJPEGQuality | ( | const unsigned int | quality | ) | [inline, inherited] |
The quality of JPEG compression, when external images is enabled and the format is "jpg".
Definition at line 238 of file CGenericSensor.h.
| void mrpt::hwdrivers::CInterfaceFTDI::SetLatencyTimer | ( | unsigned char | latency_ms | ) | [inherited] |
Change the latency timer (in milliseconds) implemented on the FTDI chip: for a few ms, data is not sent to the PC waiting for possible more data, to save USB trafic.
| virtual void mrpt::hwdrivers::CGenericSensor::setPathForExternalImages | ( | const std::string & | directory | ) | [inline, virtual, inherited] |
Set the path where to save off-rawlog image files (will be ignored in those sensors where this is not applicable).
An empty string (the default value at construction) means to save images embedded in the rawlog, instead of on separate files.
| std::exception | If the directory doesn't exists and cannot be created. |
Reimplemented in mrpt::hwdrivers::CKinect, mrpt::hwdrivers::CCameraSensor, and mrpt::hwdrivers::CSwissRanger3DCamera.
Definition at line 225 of file CGenericSensor.h.
| void mrpt::hwdrivers::CGenericSensor::setSensorLabel | ( | const std::string & | sensorLabel | ) | [inline, inherited] |
Definition at line 103 of file CGenericSensor.h.
| void mrpt::hwdrivers::CInterfaceFTDI::SetTimeouts | ( | unsigned long | dwReadTimeout_ms, |
| unsigned long | dwWriteTimeout_ms | ||
| ) | [inherited] |
Change read & write timeouts, in milliseconds.
| size_t mrpt::hwdrivers::CInterfaceFTDI::Write | ( | const void * | Buffer, |
| size_t | Count | ||
| ) | [protected, virtual, inherited] |
Introduces a pure virtual method responsible for writing to the stream.
Write attempts to write up to Count bytes to Buffer, and returns the number of bytes actually written.
Implements mrpt::utils::CStream.
| void mrpt::utils::CStream::WriteBuffer | ( | const void * | Buffer, |
| size_t | Count | ||
| ) | [inherited] |
Writes a block of bytes to the stream from Buffer.
| std::exception | On any error |
| void mrpt::utils::CStream::WriteBufferFixEndianness | ( | const T * | ptr, |
| size_t | ElementCount | ||
| ) | [inline, inherited] |
Writes a sequence of elemental datatypes, taking care of reordering their bytes from the running architecture to MRPT stream standard (little endianness).
| ElementCount | The number of elements (not bytes) to write. |
| ptr | A pointer to the first input element in an array (or std::vector<>, etc...). Example of usage: vector<float> vec = ... uint32_t N = vec.size(); s << N if (N) s.WriteBufferFixEndianness<float>(&vec[0],N); |
| std::exception | On any error |
| void mrpt::utils::CStream::WriteObject | ( | const CSerializable * | o | ) | [inherited] |
Writes an object to the stream.
| size_t mrpt::hwdrivers::CInterfaceFTDI::WriteSync | ( | const void * | Buffer, |
| size_t | Count | ||
| ) | [inline, inherited] |
Tries to write, raising no exception if not all the bytes are available, but raising one if there is some communication error.
Definition at line 151 of file CInterfaceFTDI.h.
std::string mrpt::hwdrivers::CGenericSensor::m_external_images_format [protected, inherited] |
The extension ("jpg","gif","png",...) that determines the format of images saved externally.
Definition at line 139 of file CGenericSensor.h.
unsigned int mrpt::hwdrivers::CGenericSensor::m_external_images_jpeg_quality [protected, inherited] |
For JPEG images, the quality (default=95%).
Definition at line 140 of file CGenericSensor.h.
void* mrpt::hwdrivers::CInterfaceFTDI::m_ftdi_context [protected, inherited] |
Definition at line 245 of file CInterfaceFTDI.h.
size_t mrpt::hwdrivers::CGenericSensor::m_grab_decimation [protected, inherited] |
If set to N>=2, only 1 out of N observations will be saved to m_objList.
Definition at line 127 of file CGenericSensor.h.
size_t mrpt::hwdrivers::CGenericSensor::m_grab_decimation_counter [protected, inherited] |
Used when "m_grab_decimation" is enabled.
Definition at line 132 of file CGenericSensor.h.
size_t mrpt::hwdrivers::CGenericSensor::m_max_queue_len [protected, inherited] |
See CGenericSensor.
Definition at line 126 of file CGenericSensor.h.
Definition at line 79 of file CBoardDLMS.h.
std::string mrpt::hwdrivers::CGenericSensor::m_path_for_external_images [protected, inherited] |
The path where to save off-rawlog images: empty means save images embedded in the rawlog.
Definition at line 138 of file CGenericSensor.h.
double mrpt::hwdrivers::CGenericSensor::m_process_rate [protected, inherited] |
See CGenericSensor.
Definition at line 125 of file CGenericSensor.h.
mrpt::utils::circular_buffer<uint8_t> mrpt::hwdrivers::CInterfaceFTDI::m_readBuffer [protected, inherited] |
Used in Read.
Definition at line 168 of file CInterfaceFTDI.h.
std::string mrpt::hwdrivers::CGenericSensor::m_sensorLabel [protected, inherited] |
See CGenericSensor.
Definition at line 128 of file CGenericSensor.h.
Definition at line 79 of file CBoardDLMS.h.
TSensorState mrpt::hwdrivers::CGenericSensor::m_state [protected, inherited] |
Definition at line 134 of file CGenericSensor.h.
Definition at line 77 of file CBoardDLMS.h.
uint32_t mrpt::hwdrivers::CBoardDLMS::m_timeStartUI [protected] |
Definition at line 76 of file CBoardDLMS.h.
A copy of the device serial number (to open the USB FTDI chip)
Definition at line 75 of file CBoardDLMS.h.
| Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011 |