Main MRPT website > C++ reference
MRPT logo
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
mrpt::hwdrivers::CBoardDLMS Class Referenceabstract

Detailed Description

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

Definition at line 50 of file CBoardDLMS.h.

#include <mrpt/hwdrivers/CBoardDLMS.h>

Inheritance diagram for mrpt::hwdrivers::CBoardDLMS:
Inheritance graph
[legend]

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::CSerializablePtrTListObservations
 
typedef std::pair< mrpt::system::TTimeStamp, mrpt::utils::CSerializablePtrTListObsPair
 

Public Member Functions

 CBoardDLMS ()
 Constructor. More...
 
virtual ~CBoardDLMS ()
 Destructor. More...
 
void doProcess ()
 This method will be invoked at a minimum rate of "process_rate" (Hz) More...
 
virtual void initialize ()
 This method can or cannot be implemented in the derived class, depending on the need for it. More...
 
bool queryFirmwareVersion (std::string &out_firmwareVersion)
 Query the firmware version on the device (can be used to test communications). More...
 
bool sendCommand (uint8_t command, std::vector< unsigned char > &response)
 Send a command to the DLMS Board. More...
 
bool queryTimeStamp (mrpt::system::TTimeStamp &tstamp)
 
bool isOpen ()
 Checks whether the chip has been successfully open. More...
 
void OpenBySerialNumber (const std::string &serialNumber)
 Open by device serial number. More...
 
void OpenByDescription (const std::string &description)
 Open by device description. More...
 
void Close ()
 Close the USB device. More...
 
void ResetDevice ()
 Reset the USB device. More...
 
void Purge ()
 Purge the I/O buffers. More...
 
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. More...
 
void SetTimeouts (unsigned long dwReadTimeout_ms, unsigned long dwWriteTimeout_ms)
 Change read & write timeouts, in milliseconds. More...
 
void ListAllDevices (TFTDIDeviceList &outList)
 Generates a list with all FTDI devices connected right now. More...
 
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. More...
 
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. More...
 
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). More...
 
virtual uint64_t Seek (uint64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning)=0
 Introduces a pure virtual method for moving to a specified position in the streamed resource. More...
 
size_t ReadBuffer (void *Buffer, size_t Count)
 Reads a block of bytes from the stream into Buffer. More...
 
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. More...
 
void WriteBuffer (const void *Buffer, size_t Count)
 Writes a block of bytes to the stream from Buffer. More...
 
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). More...
 
size_t CopyFrom (CStream *Source, size_t Count)
 Copies a specified number of bytes from one stream to another. More...
 
void WriteObject (const CSerializable *o)
 Writes an object to the stream. More...
 
CSerializablePtr ReadObject ()
 Reads an object from stream, its class determined at runtime, and returns a smart pointer to the object. More...
 
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. More...
 
CStreamoperator<< (const CSerializablePtr &pObj)
 Write an object to a stream in the binary MRPT format. More...
 
CStreamoperator<< (const CSerializable &obj)
 Write an object to a stream in the binary MRPT format. More...
 
CStreamoperator>> (CSerializablePtr &pObj)
 
CStreamoperator>> (CSerializable &obj)
 
virtual int printf (const char *fmt,...) MRPT_printf_format_check(2
 Writes a string to the stream in a textual form. More...
 
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. More...
 
void sendMessage (const utils::CMessage &msg)
 Send a message to the device. More...
 
bool receiveMessage (utils::CMessage &msg)
 Tries to receive a message from the device. More...
 
bool getline (std::string &out_str)
 Reads from the stream until a '
' character is found ('' characters are ignored). More...
 
virtual const mrpt::hwdrivers::TSensorClassIdGetRuntimeClass () const =0
 
TSensorState getState () const
 The current state of the sensor. More...
 
double getProcessRate () const
 
std::string getSensorLabel () const
 
void setSensorLabel (const std::string &sensorLabel)
 
void enableVerbose (bool enabled=true)
 Enable or disable extra debug info dumped to std::cout during sensor operation. More...
 
bool isVerboseEnabled () const
 
void loadConfig (const mrpt::utils::CConfigFileBase &configSource, const std::string &section)
 Loads the generic settings common to any sensor (See CGenericSensor), then call to "loadConfig_sensorSpecific". More...
 
void getObservations (TListObservations &lstObjects)
 Returns a list of enqueued objects, emptying it (thread-safe). More...
 
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). More...
 
void setExternalImageFormat (const std::string &ext)
 Set the extension ("jpg","gif","png",...) that determines the format of images saved externally The default is "jpg". More...
 
void setExternalImageJPEGQuality (const unsigned int quality)
 The quality of JPEG compression, when external images is enabled and the format is "jpg". More...
 
unsigned int getExternalImageJPEGQuality () const
 

Static Public Member Functions

static void registerClass (const TSensorClassId *pNewClass)
 Register a class into the internal list of "CGenericSensor" descendents. More...
 
static CGenericSensorcreateSensor (const std::string &className)
 Creates a sensor by a name of the class. More...
 
static CGenericSensorPtr createSensorPtr (const std::string &className)
 Just like createSensor, but returning a smart pointer to the newly created sensor object. More...
 

Protected Member Functions

bool checkConnectionAndConnect ()
 Tries to connect to the USB device (if disconnected). More...
 
bool checkCRC (const std::vector< unsigned char > &frame)
 
void loadConfig_sensorSpecific (const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
 See the class documentation at the top for expected parameters. More...
 
size_t Read (void *Buffer, size_t Count)
 Introduces a pure virtual method responsible for reading from the stream. More...
 
size_t Write (const void *Buffer, size_t Count)
 Introduces a pure virtual method responsible for writing to the stream. More...
 
uint64_t Seek (uint64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning)
 This virtual method does nothing in this class. More...
 
uint64_t getTotalBytesCount ()
 This virtual method does nothing in this class. More...
 
uint64_t getPosition ()
 This virtual method does nothing in this class. More...
 
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: More...
 
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. More...
 
void appendObservation (const mrpt::utils::CSerializablePtr &obj)
 Like appendObservations() but for just one observation. More...
 

Protected Attributes

std::string m_usbSerialNumber
 A copy of the device serial number (to open the USB FTDI chip) More...
 
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. More...
 
void * m_ftdi_context
 
size_t m_grab_decimation_counter
 Used when "m_grab_decimation" is enabled. More...
 
TSensorState m_state
 
bool m_verbose
 
std::string m_path_for_external_images
 The path where to save off-rawlog images: empty means save images embedded in the rawlog. More...
 
std::string m_external_images_format
 The extension ("jpg","gif","png",...) that determines the format of images saved externally. More...
 
unsigned int m_external_images_jpeg_quality
 For JPEG images, the quality (default=95%). More...
 
Common settings to any sensor, loaded in "loadConfig"
double m_process_rate
 See CGenericSensor. More...
 
size_t m_max_queue_len
 See CGenericSensor. More...
 
size_t m_grab_decimation
 If set to N>=2, only 1 out of N observations will be saved to m_objList. More...
 
std::string m_sensorLabel
 See CGenericSensor. More...
 

Member Typedef Documentation

◆ TListObservations

Definition at line 65 of file CGenericSensor.h.

◆ TListObsPair

Definition at line 66 of file CGenericSensor.h.

Member Enumeration Documentation

◆ TSeekOrigin

Used in CStream::Seek.

Enumerator
sFromBeginning 
sFromCurrent 
sFromEnd 

Definition at line 41 of file CStream.h.

◆ TSensorState

The current state of the sensor.

See also
CGenericSensor::getState
Enumerator
ssInitializing 
ssWorking 
ssError 

Definition at line 71 of file CGenericSensor.h.

Constructor & Destructor Documentation

◆ CBoardDLMS()

mrpt::hwdrivers::CBoardDLMS::CBoardDLMS ( )

Constructor.

Parameters
serialNumberUSBdeviceThe serial number (text) of the device to open. The constructor will try to open the device. You can check if it failed calling "isOpen()".

◆ ~CBoardDLMS()

virtual mrpt::hwdrivers::CBoardDLMS::~CBoardDLMS ( )
virtual

Destructor.

Member Function Documentation

◆ appendObservation()

void mrpt::hwdrivers::CGenericSensor::appendObservation ( const mrpt::utils::CSerializablePtr obj)
inlineprotectedinherited

Like appendObservations() but for just one observation.

Definition at line 143 of file CGenericSensor.h.

◆ appendObservations()

void mrpt::hwdrivers::CGenericSensor::appendObservations ( const std::vector< mrpt::utils::CSerializablePtr > &  obj)
protectedinherited

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

If several observations are passed at once in the vector, they'll be considered as a block regarding the grabbing decimation factor.

◆ checkConnectionAndConnect()

bool mrpt::hwdrivers::CBoardDLMS::checkConnectionAndConnect ( )
protected

Tries to connect to the USB device (if disconnected).

Returns
True on connection OK, false on error.

◆ checkCRC()

bool mrpt::hwdrivers::CBoardDLMS::checkCRC ( const std::vector< unsigned char > &  frame)
protected

◆ Close()

void mrpt::hwdrivers::CInterfaceFTDI::Close ( )
inherited

Close the USB device.

◆ CopyFrom()

size_t mrpt::utils::CStream::CopyFrom ( CStream Source,
size_t  Count 
)
inherited

Copies a specified number of bytes from one stream to another.

◆ createSensor()

static CGenericSensor* mrpt::hwdrivers::CGenericSensor::createSensor ( const std::string &  className)
staticinherited

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:

Returns
A pointer to a new class, or NULL if class name is unknown.

◆ createSensorPtr()

static CGenericSensorPtr mrpt::hwdrivers::CGenericSensor::createSensorPtr ( const std::string &  className)
inlinestaticinherited

Just like createSensor, but returning a smart pointer to the newly created sensor object.

Definition at line 176 of file CGenericSensor.h.

◆ doProcess()

void mrpt::hwdrivers::CBoardDLMS::doProcess ( )
virtual

This method will be invoked at a minimum rate of "process_rate" (Hz)

Exceptions
Thismethod must throw an exception with a descriptive message if some critical error is found.

Implements mrpt::hwdrivers::CGenericSensor.

◆ enableVerbose()

void mrpt::hwdrivers::CGenericSensor::enableVerbose ( bool  enabled = true)
inlineinherited

Enable or disable extra debug info dumped to std::cout during sensor operation.

Default: disabled unless the environment variable "MRPT_HWDRIVERS_VERBOSE" is set to "1" during object creation.

Definition at line 89 of file CGenericSensor.h.

◆ ftdi_read()

void mrpt::hwdrivers::CInterfaceFTDI::ftdi_read ( void *  lpvBuffer,
unsigned long  dwBuffSize,
unsigned long *  lpdwBytesRead 
)
protectedinherited

◆ ftdi_write()

void mrpt::hwdrivers::CInterfaceFTDI::ftdi_write ( const void *  lpvBuffer,
unsigned long  dwBuffSize,
unsigned long *  lpdwBytes 
)
protectedinherited

◆ getExternalImageJPEGQuality()

unsigned int mrpt::hwdrivers::CGenericSensor::getExternalImageJPEGQuality ( ) const
inlineinherited

Definition at line 229 of file CGenericSensor.h.

◆ getline()

bool mrpt::utils::CStream::getline ( std::string &  out_str)
inherited

Reads from the stream until a '
' character is found ('' characters are ignored).

Returns
false on EOF or any other read error.

◆ getObservations()

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.

◆ getPosition()

uint64_t mrpt::hwdrivers::CInterfaceFTDI::getPosition ( )
protectedvirtualinherited

This virtual method does nothing in this class.

Implements mrpt::utils::CStream.

◆ getProcessRate()

double mrpt::hwdrivers::CGenericSensor::getProcessRate ( ) const
inlineinherited

Definition at line 81 of file CGenericSensor.h.

◆ GetRuntimeClass()

virtual const mrpt::hwdrivers::TSensorClassId* mrpt::hwdrivers::CGenericSensor::GetRuntimeClass ( ) const
pure virtualinherited

◆ getSensorLabel()

std::string mrpt::hwdrivers::CGenericSensor::getSensorLabel ( ) const
inlineinherited

Definition at line 83 of file CGenericSensor.h.

◆ getState()

TSensorState mrpt::hwdrivers::CGenericSensor::getState ( ) const
inlineinherited

The current state of the sensor.

Definition at line 79 of file CGenericSensor.h.

◆ getTotalBytesCount()

uint64_t mrpt::hwdrivers::CInterfaceFTDI::getTotalBytesCount ( )
protectedvirtualinherited

This virtual method does nothing in this class.

Implements mrpt::utils::CStream.

◆ initialize()

virtual void mrpt::hwdrivers::CBoardDLMS::initialize ( )
virtual

This method can or cannot be implemented in the derived class, depending on the need for it.

Exceptions
Thismethod must throw an exception with a descriptive message if some critical error is found.

Reimplemented from mrpt::hwdrivers::CGenericSensor.

◆ isOpen()

bool mrpt::hwdrivers::CInterfaceFTDI::isOpen ( )
inherited

Checks whether the chip has been successfully open.

See also
OpenBySerialNumber, OpenByDescription

◆ isVerboseEnabled()

bool mrpt::hwdrivers::CGenericSensor::isVerboseEnabled ( ) const
inlineinherited

Definition at line 90 of file CGenericSensor.h.

◆ ListAllDevices()

void mrpt::hwdrivers::CInterfaceFTDI::ListAllDevices ( TFTDIDeviceList outList)
inherited

Generates a list with all FTDI devices connected right now.

◆ loadConfig()

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".

Exceptions
Thismethod throws an exception with a descriptive message if some critical parameter is missing or has an invalid value.

◆ loadConfig_sensorSpecific()

void mrpt::hwdrivers::CBoardDLMS::loadConfig_sensorSpecific ( const mrpt::utils::CConfigFileBase configSource,
const std::string &  iniSection 
)
protectedvirtual

See the class documentation at the top for expected parameters.

Implements mrpt::hwdrivers::CGenericSensor.

◆ OpenByDescription()

void mrpt::hwdrivers::CInterfaceFTDI::OpenByDescription ( const std::string &  description)
inherited

Open by device description.

◆ OpenBySerialNumber()

void mrpt::hwdrivers::CInterfaceFTDI::OpenBySerialNumber ( const std::string &  serialNumber)
inherited

Open by device serial number.

◆ operator<<() [1/2]

CStream& mrpt::utils::CStream::operator<< ( const CSerializablePtr pObj)
inherited

Write an object to a stream in the binary MRPT format.

◆ operator<<() [2/2]

CStream& mrpt::utils::CStream::operator<< ( const CSerializable obj)
inherited

Write an object to a stream in the binary MRPT format.

◆ operator>>() [1/2]

CStream& mrpt::utils::CStream::operator>> ( CSerializablePtr pObj)
inherited

◆ operator>>() [2/2]

CStream& mrpt::utils::CStream::operator>> ( CSerializable obj)
inherited

◆ printf()

virtual int mrpt::utils::CStream::printf ( const char *  fmt,
  ... 
)
virtualinherited

◆ printf_vector()

template<typename T >
virtual int void mrpt::utils::CStream::printf_vector ( const char *  fmt,
const std::vector< T > &  V 
)
inlineinherited

Prints a vector in the format [A,B,C,...] using CStream::printf, and the fmt string for each vector element.

Definition at line 200 of file CStream.h.

◆ Purge()

void mrpt::hwdrivers::CInterfaceFTDI::Purge ( )
inherited

Purge the I/O buffers.

◆ queryFirmwareVersion()

bool mrpt::hwdrivers::CBoardDLMS::queryFirmwareVersion ( std::string &  out_firmwareVersion)

Query the firmware version on the device (can be used to test communications).

Returns
true on success, false on communications errors or device not found.

◆ queryTimeStamp()

bool mrpt::hwdrivers::CBoardDLMS::queryTimeStamp ( mrpt::system::TTimeStamp tstamp)

◆ Read()

size_t mrpt::hwdrivers::CInterfaceFTDI::Read ( void *  Buffer,
size_t  Count 
)
protectedvirtualinherited

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.

◆ ReadBuffer()

size_t mrpt::utils::CStream::ReadBuffer ( void *  Buffer,
size_t  Count 
)
inherited

Reads a block of bytes from the stream into Buffer.

Exceptions
std::exceptionOn any error, or if ZERO bytes are read.
Returns
The amound of bytes actually read.
Note
This method is endianness-dependent.
See also
ReadBufferImmediate ; Important, see: ReadBufferFixEndianness,

◆ ReadBufferFixEndianness()

template<typename T >
size_t mrpt::utils::CStream::ReadBufferFixEndianness ( T *  ptr,
size_t  ElementCount 
)
inlineinherited

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.

Parameters
ElementCountThe number of elements (not bytes) to read.
ptrA pointer to the first output element in an array (or std::vector<>, etc...).
Returns
The amound of bytes (not elements) actually read (under error situations, the last element may be invalid if the data stream abruptly ends). Example of usage:
uint32_t N;
s >> N;
vector<float> vec(N);
if (N)
s.ReadBufferFixEndianness<float>(&vec[0],N);
Exceptions
std::exceptionOn any error, or if ZERO bytes are read.
See also
ReadBufferFixEndianness, ReadBuffer

Definition at line 90 of file CStream.h.

References mrpt::mrpt::utils::reverseBytesInPlace().

Referenced by mrpt::math::operator>>().

◆ ReadBufferImmediate()

virtual size_t mrpt::hwdrivers::CInterfaceFTDI::ReadBufferImmediate ( void *  Buffer,
size_t  Count 
)
virtualinherited

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().

Exceptions
std::exceptionOn any error, or if ZERO bytes are read.

Reimplemented from mrpt::utils::CStream.

◆ ReadObject() [1/2]

CSerializablePtr mrpt::utils::CStream::ReadObject ( )
inherited

Reads an object from stream, its class determined at runtime, and returns a smart pointer to the object.

Exceptions
std::exceptionOn I/O error or undefined class.
mrpt::utils::CExceptionEOFOn 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>>().

◆ ReadObject() [2/2]

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.

Exceptions
std::exceptionOn I/O error or different class found.
mrpt::utils::CExceptionEOFOn 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.

◆ ReadSync()

size_t mrpt::hwdrivers::CInterfaceFTDI::ReadSync ( void *  Buffer,
size_t  Count 
)
inlineinherited

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 125 of file CInterfaceFTDI.h.

◆ receiveMessage()

bool mrpt::utils::CStream::receiveMessage ( utils::CMessage msg)
inherited

Tries to receive a message from the device.

Exceptions
std::exceptionOn communication errors
Returns
True if successful, false if there is no new data from the device (but communications seem to work fine)
See also
The frame format is described in sendMessage()

◆ recursive_fill_list_devices()

void mrpt::hwdrivers::CInterfaceFTDI::recursive_fill_list_devices ( void *  usb_device_structure,
TFTDIDeviceList outList 
)
protectedinherited

Process recursively a USB device and its children:

◆ registerClass()

static void mrpt::hwdrivers::CGenericSensor::registerClass ( const TSensorClassId pNewClass)
staticinherited

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.

Referenced by mrpt::hwdrivers::CGenericSensor::CLASSINIT_GENERIC_SENSOR::CLASSINIT_GENERIC_SENSOR().

◆ ResetDevice()

void mrpt::hwdrivers::CInterfaceFTDI::ResetDevice ( )
inherited

Reset the USB device.

◆ Seek() [1/2]

virtual uint64_t mrpt::utils::CStream::Seek ( uint64_t  Offset,
CStream::TSeekOrigin  Origin = sFromBeginning 
)
pure virtualinherited

Introduces a pure virtual method for moving to a specified position in the streamed resource.

he Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values:

  • sFromBeginning (Default) Offset is from the beginning of the resource. Seek moves to the position Offset. Offset must be >= 0.
  • sFromCurrent Offset is from the current position in the resource. Seek moves to Position + Offset.
  • sFromEnd Offset is from the end of the resource. Offset must be <= 0 to indicate a number of bytes before the end of the file.
    Returns
    Seek returns the new value of the Position property.

Implemented in mrpt::utils::CClientTCPSocket, mrpt::utils::CFileStream, mrpt::utils::CFileGZInputStream, mrpt::utils::CMemoryStream, mrpt::utils::CFileOutputStream, mrpt::utils::CFileInputStream, and mrpt::utils::CStdOutStream.

◆ Seek() [2/2]

uint64_t mrpt::hwdrivers::CInterfaceFTDI::Seek ( uint64_t  Offset,
CStream::TSeekOrigin  Origin = sFromBeginning 
)
protectedinherited

This virtual method does nothing in this class.

◆ sendCommand()

bool mrpt::hwdrivers::CBoardDLMS::sendCommand ( uint8_t  command,
std::vector< unsigned char > &  response 
)

Send a command to the DLMS Board.

Returns
true on success, false on communications errors or device not found.

◆ sendMessage()

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
Exceptions
std::exceptionOn communication errors

◆ setExternalImageFormat()

void mrpt::hwdrivers::CGenericSensor::setExternalImageFormat ( const std::string &  ext)
inlineinherited

Set the extension ("jpg","gif","png",...) that determines the format of images saved externally The default is "jpg".

See also
setPathForExternalImages, setExternalImageJPEGQuality

Definition at line 221 of file CGenericSensor.h.

◆ setExternalImageJPEGQuality()

void mrpt::hwdrivers::CGenericSensor::setExternalImageJPEGQuality ( const unsigned int  quality)
inlineinherited

The quality of JPEG compression, when external images is enabled and the format is "jpg".

See also
setExternalImageFormat

Definition at line 226 of file CGenericSensor.h.

◆ SetLatencyTimer()

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.

◆ setPathForExternalImages()

virtual void mrpt::hwdrivers::CGenericSensor::setPathForExternalImages ( const std::string &  directory)
inlinevirtualinherited

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.

Exceptions
std::exceptionIf the directory doesn't exists and cannot be created.

Reimplemented in mrpt::hwdrivers::CKinect, mrpt::hwdrivers::CCameraSensor, and mrpt::hwdrivers::CSwissRanger3DCamera.

Definition at line 213 of file CGenericSensor.h.

◆ setSensorLabel()

void mrpt::hwdrivers::CGenericSensor::setSensorLabel ( const std::string &  sensorLabel)
inlineinherited

Definition at line 84 of file CGenericSensor.h.

◆ SetTimeouts()

void mrpt::hwdrivers::CInterfaceFTDI::SetTimeouts ( unsigned long  dwReadTimeout_ms,
unsigned long  dwWriteTimeout_ms 
)
inherited

Change read & write timeouts, in milliseconds.

◆ Write()

size_t mrpt::hwdrivers::CInterfaceFTDI::Write ( const void *  Buffer,
size_t  Count 
)
protectedvirtualinherited

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.

◆ WriteBuffer()

void mrpt::utils::CStream::WriteBuffer ( const void *  Buffer,
size_t  Count 
)
inherited

Writes a block of bytes to the stream from Buffer.

Exceptions
std::exceptionOn any error
See also
Important, see: WriteBufferFixEndianness
Note
This method is endianness-dependent.

◆ WriteBufferFixEndianness()

template<typename T >
void mrpt::utils::CStream::WriteBufferFixEndianness ( const T *  ptr,
size_t  ElementCount 
)
inlineinherited

Writes a sequence of elemental datatypes, taking care of reordering their bytes from the running architecture to MRPT stream standard (little endianness).

Parameters
ElementCountThe number of elements (not bytes) to write.
ptrA 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);
Exceptions
std::exceptionOn any error
See also
WriteBuffer

Definition at line 134 of file CStream.h.

◆ WriteObject()

void mrpt::utils::CStream::WriteObject ( const CSerializable o)
inherited

Writes an object to the stream.

◆ WriteSync()

size_t mrpt::hwdrivers::CInterfaceFTDI::WriteSync ( const void *  Buffer,
size_t  Count 
)
inlineinherited

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 132 of file CInterfaceFTDI.h.

Member Data Documentation

◆ m_external_images_format

std::string mrpt::hwdrivers::CGenericSensor::m_external_images_format
protectedinherited

The extension ("jpg","gif","png",...) that determines the format of images saved externally.

See also
setPathForExternalImages

Definition at line 127 of file CGenericSensor.h.

◆ m_external_images_jpeg_quality

unsigned int mrpt::hwdrivers::CGenericSensor::m_external_images_jpeg_quality
protectedinherited

For JPEG images, the quality (default=95%).

Definition at line 128 of file CGenericSensor.h.

◆ m_ftdi_context

void* mrpt::hwdrivers::CInterfaceFTDI::m_ftdi_context
protectedinherited

Definition at line 226 of file CInterfaceFTDI.h.

◆ m_grab_decimation

size_t mrpt::hwdrivers::CGenericSensor::m_grab_decimation
protectedinherited

If set to N>=2, only 1 out of N observations will be saved to m_objList.

Definition at line 114 of file CGenericSensor.h.

◆ m_grab_decimation_counter

size_t mrpt::hwdrivers::CGenericSensor::m_grab_decimation_counter
protectedinherited

Used when "m_grab_decimation" is enabled.

Definition at line 119 of file CGenericSensor.h.

◆ m_max_queue_len

size_t mrpt::hwdrivers::CGenericSensor::m_max_queue_len
protectedinherited

See CGenericSensor.

Definition at line 113 of file CGenericSensor.h.

◆ m_mSensorPose

mrpt::poses::CPose3D mrpt::hwdrivers::CBoardDLMS::m_mSensorPose
protected

Definition at line 60 of file CBoardDLMS.h.

◆ m_path_for_external_images

std::string mrpt::hwdrivers::CGenericSensor::m_path_for_external_images
protectedinherited

The path where to save off-rawlog images: empty means save images embedded in the rawlog.

Definition at line 126 of file CGenericSensor.h.

◆ m_process_rate

double mrpt::hwdrivers::CGenericSensor::m_process_rate
protectedinherited

See CGenericSensor.

Definition at line 112 of file CGenericSensor.h.

◆ m_readBuffer

mrpt::utils::circular_buffer<uint8_t> mrpt::hwdrivers::CInterfaceFTDI::m_readBuffer
protectedinherited

Used in Read.

Definition at line 149 of file CInterfaceFTDI.h.

◆ m_sensorLabel

std::string mrpt::hwdrivers::CGenericSensor::m_sensorLabel
protectedinherited

See CGenericSensor.

Definition at line 115 of file CGenericSensor.h.

◆ m_sSensorPose

mrpt::poses::CPose3D mrpt::hwdrivers::CBoardDLMS::m_sSensorPose
protected

Definition at line 60 of file CBoardDLMS.h.

◆ m_state

TSensorState mrpt::hwdrivers::CGenericSensor::m_state
protectedinherited

Definition at line 121 of file CGenericSensor.h.

◆ m_timeStartTT

mrpt::system::TTimeStamp mrpt::hwdrivers::CBoardDLMS::m_timeStartTT
protected

Definition at line 58 of file CBoardDLMS.h.

◆ m_timeStartUI

uint32_t mrpt::hwdrivers::CBoardDLMS::m_timeStartUI
protected

Definition at line 57 of file CBoardDLMS.h.

◆ m_usbSerialNumber

std::string mrpt::hwdrivers::CBoardDLMS::m_usbSerialNumber
protected

A copy of the device serial number (to open the USB FTDI chip)

Definition at line 56 of file CBoardDLMS.h.

◆ m_verbose

bool mrpt::hwdrivers::CGenericSensor::m_verbose
protectedinherited

Definition at line 122 of file CGenericSensor.h.




Page generated by Doxygen 1.8.14 for MRPT 1.1.0 SVN: at lun oct 28 00:54:49 CET 2019 Hosted on:
SourceForge.net Logo