Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
mrpt::hwdrivers::CServoeNeck Class Referenceabstract

Detailed Description

A USB-interface for a custom "robotic neck" designed at MAPIR lab.

Definition at line 22 of file CServoeNeck.h.

#include <mrpt/hwdrivers/CServoeNeck.h>

Inheritance diagram for mrpt::hwdrivers::CServoeNeck:
Inheritance graph

Public Types

enum  TSeekOrigin { sFromBeginning = 0, sFromCurrent = 1, sFromEnd = 2 }
 Used in CStream::Seek. More...
 

Public Member Functions

 CServoeNeck ()
 
 ~CServoeNeck ()
 
bool queryFirmwareVersion (std::string &out_firmwareVersion)
 Gets the firmware version of the eNeck board. More...
 
bool getCurrentAngle (double &angle, const uint8_t servo=0)
 Gets the current angle of the servo (in radians within (-pi,pi)) More...
 
bool setAngle (double angle, const uint8_t servo=0, bool fast=false)
 Turns the servo up to the specified angle (in radians in the range -pi,pi, other values will be saturated to the maximum or the mininum) More...
 
bool setAngleAndSpeed (double angle, const uint8_t servo, const uint8_t speed)
 Turns the servo up to the specified angle (in radians in the range -pi,pi, other values will be saturated to the maximum or the mininum) More...
 
bool setAngleWithFilter (double angle, const uint8_t servo=0, bool fast=false)
 Turns the servo up to the specified angle (in radians in the range -pi,pi) filtered by average with the last N specified angles. More...
 
bool disableServo (const uint8_t servo=0)
 Disables the servo so the neck will be loose. More...
 
bool enableServo (const uint8_t servo=0)
 Enables the servo so the neck will be tight. More...
 
bool center (const uint8_t servo=0)
 Centers the servo at zero position. More...
 
double getTruncateFactor ()
 Gets the truncate factor of the turn. More...
 
void setTruncateFactor (const double factor)
 Gets the truncate factor of the turn. More...
 
void setNumberOfPreviousAngles (const unsigned int number)
 Gets the truncate factor of the turn. More...
 
unsigned int getNumberOfPreviousAngles ()
 Gets the truncate factor of the turn. More...
 
void setOffsets (float offset0, float offset1, float offset2)
 Load the Offset values for each servo. More...
 
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...
 
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 (int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning)
 This virtual method does nothing in this class. More...
 
virtual uint64_t Seek (int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning)=0
 Introduces a pure virtual method for moving to a specified position in the streamed resource. More...
 
uint64_t getTotalBytesCount () const
 This virtual method does nothing in this class. More...
 
uint64_t getPosition () const
 This virtual method does nothing in this class. More...
 
virtual int printf (const char *fmt,...) MRPT_printf_format_check(2
 Writes a string to the stream in a textual form. More...
 
template<typename CONTAINER_TYPE >
virtual int void printf_vector (const char *fmt, const CONTAINER_TYPE &V, char separator=',')
 Prints a vector in the format [A,B,C,...] using CStream::printf, and the fmt string for each vector element T. More...
 
bool getline (std::string &out_str)
 Reads from the stream until a '
' character is found ('\r' characters are ignored). More...
 

Protected Member Functions

bool setRegisterValue (const uint16_t value, const uint8_t servo=0, bool fast=false)
 
bool setRegisterValueAndSpeed (const uint16_t value, const uint8_t servo, const uint16_t speed)
 
bool getRegisterValue (uint16_t &value, const uint8_t servo=0)
 
void ftdi_read (void *lpvBuffer, unsigned long dwBuffSize, unsigned long *lpdwBytesRead)
 
void ftdi_write (const void *lpvBuffer, unsigned long dwBuffSize, unsigned long *lpdwBytes)
 

Protected Attributes

std::string m_usbSerialNumber
 A copy of the device serial number (to open the USB FTDI chip). More...
 
double m_MaxValue
 The value set in the ICR register within the ATMEGA16 controller. More...
 
double m_TruncateFactor
 The range of turn of the servo will be truncated to "+-m_truncate_factor*(pi/2)". More...
 
std::deque< double > m_PrevAngles
 A vector containing the last N angles which where passed to the servo (for averaging) More...
 
unsigned int m_NumPrevAngles
 Number of previous angles to store for averaging. More...
 
std::vector< float > m_offsets
 The offset used for each servo. More...
 
mrpt::containers::circular_buffer< uint8_tm_readBuffer
 Used in Read. More...
 

Private Types

enum  FT_STATUS { dummy }
 
typedef FT_STATUS(__stdcall * PtrToOpen) (void *, unsigned long *)
 
typedef FT_STATUS(__stdcall * PtrToOpenEx) (void *, unsigned long, unsigned long *)
 
typedef FT_STATUS(__stdcall * PtrToListDevices) (void *, void *, unsigned long)
 
typedef FT_STATUS(__stdcall * PtrToClose) (unsigned long)
 
typedef FT_STATUS(__stdcall * PtrToRead) (unsigned long, void *, unsigned long, unsigned long *)
 
typedef FT_STATUS(__stdcall * PtrToWrite) (unsigned long, const void *, unsigned long, unsigned long *)
 
typedef FT_STATUS(__stdcall * PtrToResetDevice) (unsigned long)
 
typedef FT_STATUS(__stdcall * PtrToPurge) (unsigned long, unsigned long)
 
typedef FT_STATUS(__stdcall * PtrToSetTimeouts) (unsigned long, unsigned long, unsigned long)
 
typedef FT_STATUS(__stdcall * PtrToGetQueueStatus) (unsigned long, unsigned long *)
 
typedef FT_STATUS(__stdcall * PtrToSetLatencyTimer) (unsigned long, unsigned char)
 

Private Member Functions

unsigned int angle2RegValue (const double angle)
 Converts from a decimal angle (in radians) to the corresponding register value for the ATMEGA16 controller (for inner use only). More...
 
double regValue2angle (const uint16_t value)
 Converts from a certain value of the ATMEGA16 PWM register to the corresponding decimal angle (for inner use only). More...
 
bool checkConnectionAndConnect ()
 Tries to connect to the USB device (if disconnected). More...
 
void checkErrorAndRaise (int errorCode)
 
void ftdi_open (void *pvDevice)
 
void ftdi_openEx (void *pArg1, unsigned long dwFlags)
 
void ftdi_listDevices (void *pArg1, void *pArg2, unsigned long dwFlags)
 
void ftdi_getQueueStatus (unsigned long *lpdwAmountInRxQueue)
 
void loadDriver ()
 

Private Attributes

voidm_hmodule
 
unsigned long m_ftHandle
 
PtrToOpen m_pOpen
 
PtrToOpenEx m_pOpenEx
 
PtrToListDevices m_pListDevices
 
PtrToClose m_pClose
 
PtrToRead m_pRead
 
PtrToWrite m_pWrite
 
PtrToResetDevice m_pResetDevice
 
PtrToPurge m_pPurge
 
PtrToSetTimeouts m_pSetTimeouts
 
PtrToGetQueueStatus m_pGetQueueStatus
 
PtrToSetLatencyTimer m_pSetLatencyTimer
 

Member Typedef Documentation

◆ PtrToClose

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToClose) (unsigned long)
privateinherited

Definition at line 211 of file CInterfaceFTDI.h.

◆ PtrToGetQueueStatus

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToGetQueueStatus) (unsigned long, unsigned long *)
privateinherited

Definition at line 232 of file CInterfaceFTDI.h.

◆ PtrToListDevices

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToListDevices) (void *, void *, unsigned long)
privateinherited

Definition at line 208 of file CInterfaceFTDI.h.

◆ PtrToOpen

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToOpen) (void *, unsigned long *)
privateinherited

Definition at line 201 of file CInterfaceFTDI.h.

◆ PtrToOpenEx

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToOpenEx) (void *, unsigned long, unsigned long *)
privateinherited

Definition at line 204 of file CInterfaceFTDI.h.

◆ PtrToPurge

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToPurge) (unsigned long, unsigned long)
privateinherited

Definition at line 225 of file CInterfaceFTDI.h.

◆ PtrToRead

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToRead) (unsigned long, void *, unsigned long, unsigned long *)
privateinherited

Definition at line 214 of file CInterfaceFTDI.h.

◆ PtrToResetDevice

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToResetDevice) (unsigned long)
privateinherited

Definition at line 222 of file CInterfaceFTDI.h.

◆ PtrToSetLatencyTimer

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToSetLatencyTimer) (unsigned long, unsigned char)
privateinherited

Definition at line 236 of file CInterfaceFTDI.h.

◆ PtrToSetTimeouts

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToSetTimeouts) (unsigned long, unsigned long, unsigned long)
privateinherited

Definition at line 228 of file CInterfaceFTDI.h.

◆ PtrToWrite

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToWrite) (unsigned long, const void *, unsigned long, unsigned long *)
privateinherited

Definition at line 218 of file CInterfaceFTDI.h.

Member Enumeration Documentation

◆ FT_STATUS

Enumerator
dummy 

Definition at line 199 of file CInterfaceFTDI.h.

◆ TSeekOrigin

Used in CStream::Seek.

Enumerator
sFromBeginning 
sFromCurrent 
sFromEnd 

Definition at line 34 of file io/CStream.h.

Constructor & Destructor Documentation

◆ CServoeNeck()

CServoeNeck::CServoeNeck ( )

Definition at line 30 of file CServoeNeck.cpp.

References m_offsets.

◆ ~CServoeNeck()

CServoeNeck::~CServoeNeck ( )

Definition at line 42 of file CServoeNeck.cpp.

Member Function Documentation

◆ angle2RegValue()

unsigned int CServoeNeck::angle2RegValue ( const double  angle)
private

Converts from a decimal angle (in radians) to the corresponding register value for the ATMEGA16 controller (for inner use only).

Parameters
Theangle to convert.
Returns
The value of the register to send.

Definition at line 77 of file CServoeNeck.cpp.

References M_PI.

Referenced by center(), setAngle(), and setAngleAndSpeed().

◆ center()

bool CServoeNeck::center ( const uint8_t  servo = 0)

Centers the servo at zero position.

Definition at line 393 of file CServoeNeck.cpp.

References angle2RegValue(), m_offsets, and setRegisterValue().

◆ checkConnectionAndConnect()

bool CServoeNeck::checkConnectionAndConnect ( )
private

◆ checkErrorAndRaise()

void CInterfaceFTDI::checkErrorAndRaise ( int  errorCode)
privateinherited

◆ Close()

void CInterfaceFTDI::Close ( )
inherited

◆ disableServo()

bool CServoeNeck::disableServo ( const uint8_t  servo = 0)

Disables the servo so the neck will be loose.

Parameters
Servothe id of the servo to move (in our ATMEGA16, from 0 to 2).
Returns
Whether or not the procedure succeded.

Definition at line 331 of file CServoeNeck.cpp.

References mrpt::serialization::archiveFrom(), mrpt::comms::CInterfaceFTDI::Close(), mrpt::serialization::CMessage::content, mrpt::comms::CInterfaceFTDI::isOpen(), and mrpt::serialization::CMessage::type.

◆ enableServo()

bool CServoeNeck::enableServo ( const uint8_t  servo = 0)

Enables the servo so the neck will be tight.

Parameters
Servothe id of the servo to move (in our ATMEGA16, from 0 to 2).
Returns
Whether or not the procedure succeded.

Definition at line 362 of file CServoeNeck.cpp.

References mrpt::serialization::archiveFrom(), mrpt::comms::CInterfaceFTDI::Close(), mrpt::serialization::CMessage::content, mrpt::comms::CInterfaceFTDI::isOpen(), and mrpt::serialization::CMessage::type.

◆ ftdi_getQueueStatus()

void CInterfaceFTDI::ftdi_getQueueStatus ( unsigned long *  lpdwAmountInRxQueue)
privateinherited

◆ ftdi_listDevices()

void CInterfaceFTDI::ftdi_listDevices ( void pArg1,
void pArg2,
unsigned long  dwFlags 
)
privateinherited

◆ ftdi_open()

void CInterfaceFTDI::ftdi_open ( void pvDevice)
privateinherited

◆ ftdi_openEx()

void CInterfaceFTDI::ftdi_openEx ( void pArg1,
unsigned long  dwFlags 
)
privateinherited

◆ ftdi_read()

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

◆ ftdi_write()

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

◆ getCurrentAngle()

bool CServoeNeck::getCurrentAngle ( double &  angle,
const uint8_t  servo = 0 
)

Gets the current angle of the servo (in radians within (-pi,pi))

Parameters
Angle[OUT] The current angle.
Servo[IN] The id of the servo (in our ATMEGA16, from 0 to 2).
Returns
Whether or not the procedure succeded.

Definition at line 240 of file CServoeNeck.cpp.

References getRegisterValue(), and regValue2angle().

◆ getline()

bool CStream::getline ( std::string out_str)
inherited

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

Returns
false on EOF or any other read error.

Definition at line 69 of file CStream.cpp.

◆ getNumberOfPreviousAngles()

unsigned int mrpt::hwdrivers::CServoeNeck::getNumberOfPreviousAngles ( )
inline

Gets the truncate factor of the turn.

Definition at line 114 of file CServoeNeck.h.

References m_NumPrevAngles.

◆ getPosition()

uint64_t CInterfaceFTDI::getPosition ( ) const
virtualinherited

This virtual method does nothing in this class.

Implements mrpt::io::CStream.

Definition at line 67 of file CInterfaceFTDI_common.cpp.

◆ getRegisterValue()

bool CServoeNeck::getRegisterValue ( uint16_t value,
const uint8_t  servo = 0 
)
protected

◆ getTotalBytesCount()

uint64_t CInterfaceFTDI::getTotalBytesCount ( ) const
virtualinherited

This virtual method does nothing in this class.

Implements mrpt::io::CStream.

Definition at line 66 of file CInterfaceFTDI_common.cpp.

◆ getTruncateFactor()

double mrpt::hwdrivers::CServoeNeck::getTruncateFactor ( )
inline

Gets the truncate factor of the turn.

Definition at line 96 of file CServoeNeck.h.

References m_TruncateFactor.

◆ isOpen()

bool CInterfaceFTDI::isOpen ( )
inherited

◆ ListAllDevices()

void CInterfaceFTDI::ListAllDevices ( TFTDIDeviceList outList)
inherited

Generates a list with all FTDI devices connected right now.

Definition at line 242 of file CInterfaceFTDI_WIN.cpp.

References mrpt::comms::TFTDIDevice::ftdi_description, mrpt::comms::CInterfaceFTDI::ftdi_listDevices(), mrpt::comms::TFTDIDevice::ftdi_serial, MRPT_END, and MRPT_START.

◆ loadDriver()

void CInterfaceFTDI::loadDriver ( )
privateinherited

◆ OpenByDescription()

void CInterfaceFTDI::OpenByDescription ( const std::string description)
inherited

◆ OpenBySerialNumber()

void CInterfaceFTDI::OpenBySerialNumber ( const std::string serialNumber)
inherited

◆ printf()

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

Writes a string to the stream in a textual form.

See also
CStdOutStream

Definition at line 30 of file CStream.cpp.

References MRPT_END, MRPT_START, and vsnprintf.

Referenced by mrpt::hmtslam::CTopLCDetector_GridMatching::computeTopologicalObservationModel(), and mrpt::io::CStream::printf_vector().

◆ printf_vector()

template<typename CONTAINER_TYPE >
virtual int void mrpt::io::CStream::printf_vector ( const char *  fmt,
const CONTAINER_TYPE &  V,
char  separator = ',' 
)
inlineinherited

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

Template Parameters
CONTAINER_TYPEcan be any vector<T>, deque<T> or alike.

Definition at line 104 of file io/CStream.h.

References mrpt::io::CStream::printf().

Referenced by mrpt::hmtslam::CTopLCDetector_GridMatching::computeTopologicalObservationModel().

◆ Purge()

void CInterfaceFTDI::Purge ( )
inherited

◆ queryFirmwareVersion()

bool CServoeNeck::queryFirmwareVersion ( std::string out_firmwareVersion)

Gets the firmware version of the eNeck board.

Parameters
out_firmwareVersion[OUTPUT] A string containing the firmware version.
Returns
Whether or not the procedure succeded.

Definition at line 46 of file CServoeNeck.cpp.

References mrpt::serialization::archiveFrom(), checkConnectionAndConnect(), mrpt::comms::CInterfaceFTDI::Close(), mrpt::serialization::CMessage::getContentAsString(), and mrpt::serialization::CMessage::type.

◆ Read()

size_t CInterfaceFTDI::Read ( void Buffer,
size_t  Count 
)
virtualinherited

◆ ReadBufferImmediate()

size_t 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::io::CStream.

Definition at line 68 of file CInterfaceFTDI_common.cpp.

References mrpt::comms::CInterfaceFTDI::ftdi_read().

◆ ReadSync()

size_t mrpt::comms::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 131 of file CInterfaceFTDI.h.

References mrpt::comms::CInterfaceFTDI::Read().

Referenced by mrpt::hwdrivers::CSickLaserUSB::waitContinuousSampleFrame().

◆ regValue2angle()

double CServoeNeck::regValue2angle ( const uint16_t  value)
private

Converts from a certain value of the ATMEGA16 PWM register to the corresponding decimal angle (for inner use only).

Parameters
Thevalue to convert.
Returns
The corresponding angle.

Definition at line 99 of file CServoeNeck.cpp.

References M_PI.

Referenced by getCurrentAngle().

◆ ResetDevice()

void CInterfaceFTDI::ResetDevice ( )
inherited

◆ Seek() [1/2]

uint64_t CInterfaceFTDI::Seek ( int64_t  Offset,
CStream::TSeekOrigin  Origin = sFromBeginning 
)
inherited

This virtual method does nothing in this class.

Definition at line 61 of file CInterfaceFTDI_common.cpp.

◆ Seek() [2/2]

virtual uint64_t mrpt::io::CStream::Seek ( int64_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::io::CFileGZInputStream, mrpt::io::CFileGZOutputStream, mrpt::io::CMemoryStream, mrpt::io::CFileOutputStream, mrpt::io::CFileInputStream, mrpt::io::CFileStream, and mrpt::io::CPipeBaseEndPoint.

◆ setAngle()

bool CServoeNeck::setAngle ( double  angle,
const uint8_t  servo = 0,
bool  fast = false 
)

Turns the servo up to the specified angle (in radians in the range -pi,pi, other values will be saturated to the maximum or the mininum)

Parameters
Anglethe desired angle to turn.
Servothe id of the servo to move (in our ATMEGA16, from 0 to 2).
Fastindicates if the servo must reach the angle at maximum speed
Returns
Whether or not the procedure succeded.

Definition at line 255 of file CServoeNeck.cpp.

References angle2RegValue(), m_offsets, M_PI, m_TruncateFactor, mrpt::RAD2DEG(), and setRegisterValue().

Referenced by setAngleWithFilter().

◆ setAngleAndSpeed()

bool CServoeNeck::setAngleAndSpeed ( double  angle,
const uint8_t  servo,
const uint8_t  speed 
)

Turns the servo up to the specified angle (in radians in the range -pi,pi, other values will be saturated to the maximum or the mininum)

Parameters
Anglethe desired angle to turn.
Servothe id of the servo to move (in our ATMEGA16, from 0 to 2).
Speedindicates the speed of the servo
Returns
Whether or not the procedure succeded.

Definition at line 285 of file CServoeNeck.cpp.

References angle2RegValue(), m_offsets, M_PI, m_TruncateFactor, and setRegisterValueAndSpeed().

◆ setAngleWithFilter()

bool CServoeNeck::setAngleWithFilter ( double  angle,
const uint8_t  servo = 0,
bool  fast = false 
)

Turns the servo up to the specified angle (in radians in the range -pi,pi) filtered by average with the last N specified angles.

Parameters
Anglethe new desired angle to turn.
Servothe id of the servo to move (in our ATMEGA16, from 0 to 2).
Fastindicates if the servo must reach the angle at maximum speed
Returns
Whether or not the procedure succeded.

Definition at line 308 of file CServoeNeck.cpp.

References m_NumPrevAngles, m_PrevAngles, and setAngle().

◆ SetLatencyTimer()

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

Definition at line 371 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, mrpt::comms::CInterfaceFTDI::checkErrorAndRaise(), mrpt::comms::CInterfaceFTDI::m_ftHandle, mrpt::comms::CInterfaceFTDI::m_pSetLatencyTimer, MRPT_END, and MRPT_START.

Referenced by checkConnectionAndConnect(), and mrpt::hwdrivers::CSickLaserUSB::checkControllerIsConnected().

◆ setNumberOfPreviousAngles()

void mrpt::hwdrivers::CServoeNeck::setNumberOfPreviousAngles ( const unsigned int  number)
inline

Gets the truncate factor of the turn.

Definition at line 107 of file CServoeNeck.h.

References m_NumPrevAngles.

◆ setOffsets()

void CServoeNeck::setOffsets ( float  offset0,
float  offset1,
float  offset2 
)

Load the Offset values for each servo.

Definition at line 427 of file CServoeNeck.cpp.

References m_offsets.

◆ setRegisterValue()

bool CServoeNeck::setRegisterValue ( const uint16_t  value,
const uint8_t  servo = 0,
bool  fast = false 
)
protected

◆ setRegisterValueAndSpeed()

bool CServoeNeck::setRegisterValueAndSpeed ( const uint16_t  value,
const uint8_t  servo,
const uint16_t  speed 
)
protected

◆ SetTimeouts()

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

◆ setTruncateFactor()

void mrpt::hwdrivers::CServoeNeck::setTruncateFactor ( const double  factor)
inline

Gets the truncate factor of the turn.

Definition at line 99 of file CServoeNeck.h.

References ASSERT_, and m_TruncateFactor.

◆ Write()

size_t CInterfaceFTDI::Write ( const void Buffer,
size_t  Count 
)
virtualinherited

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::io::CStream.

Definition at line 54 of file CInterfaceFTDI_common.cpp.

References mrpt::comms::CInterfaceFTDI::ftdi_write().

Referenced by mrpt::comms::CInterfaceFTDI::WriteSync().

◆ WriteSync()

size_t mrpt::comms::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 135 of file CInterfaceFTDI.h.

References mrpt::comms::CInterfaceFTDI::Write().

Member Data Documentation

◆ m_ftHandle

unsigned long mrpt::comms::CInterfaceFTDI::m_ftHandle
privateinherited

◆ m_hmodule

void* mrpt::comms::CInterfaceFTDI::m_hmodule
privateinherited

◆ m_MaxValue

double mrpt::hwdrivers::CServoeNeck::m_MaxValue
protected

The value set in the ICR register within the ATMEGA16 controller.

Definition at line 123 of file CServoeNeck.h.

◆ m_NumPrevAngles

unsigned int mrpt::hwdrivers::CServoeNeck::m_NumPrevAngles
protected

Number of previous angles to store for averaging.

Definition at line 131 of file CServoeNeck.h.

Referenced by getNumberOfPreviousAngles(), setAngleWithFilter(), and setNumberOfPreviousAngles().

◆ m_offsets

std::vector<float> mrpt::hwdrivers::CServoeNeck::m_offsets
protected

The offset used for each servo.

Definition at line 133 of file CServoeNeck.h.

Referenced by center(), CServoeNeck(), setAngle(), setAngleAndSpeed(), and setOffsets().

◆ m_pClose

PtrToClose mrpt::comms::CInterfaceFTDI::m_pClose
privateinherited

◆ m_pGetQueueStatus

PtrToGetQueueStatus mrpt::comms::CInterfaceFTDI::m_pGetQueueStatus
privateinherited

◆ m_pListDevices

PtrToListDevices mrpt::comms::CInterfaceFTDI::m_pListDevices
privateinherited

◆ m_pOpen

PtrToOpen mrpt::comms::CInterfaceFTDI::m_pOpen
privateinherited

◆ m_pOpenEx

PtrToOpenEx mrpt::comms::CInterfaceFTDI::m_pOpenEx
privateinherited

◆ m_pPurge

PtrToPurge mrpt::comms::CInterfaceFTDI::m_pPurge
privateinherited

◆ m_pRead

PtrToRead mrpt::comms::CInterfaceFTDI::m_pRead
privateinherited

◆ m_pResetDevice

PtrToResetDevice mrpt::comms::CInterfaceFTDI::m_pResetDevice
privateinherited

◆ m_PrevAngles

std::deque<double> mrpt::hwdrivers::CServoeNeck::m_PrevAngles
protected

A vector containing the last N angles which where passed to the servo (for averaging)

Definition at line 129 of file CServoeNeck.h.

Referenced by setAngleWithFilter().

◆ m_pSetLatencyTimer

PtrToSetLatencyTimer mrpt::comms::CInterfaceFTDI::m_pSetLatencyTimer
privateinherited

◆ m_pSetTimeouts

PtrToSetTimeouts mrpt::comms::CInterfaceFTDI::m_pSetTimeouts
privateinherited

◆ m_pWrite

PtrToWrite mrpt::comms::CInterfaceFTDI::m_pWrite
privateinherited

◆ m_readBuffer

mrpt::containers::circular_buffer<uint8_t> mrpt::comms::CInterfaceFTDI::m_readBuffer
protectedinherited

◆ m_TruncateFactor

double mrpt::hwdrivers::CServoeNeck::m_TruncateFactor
protected

The range of turn of the servo will be truncated to "+-m_truncate_factor*(pi/2)".

Definition at line 126 of file CServoeNeck.h.

Referenced by getTruncateFactor(), setAngle(), setAngleAndSpeed(), and setTruncateFactor().

◆ m_usbSerialNumber

std::string mrpt::hwdrivers::CServoeNeck::m_usbSerialNumber
protected

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

Definition at line 121 of file CServoeNeck.h.

Referenced by checkConnectionAndConnect().




Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST