iCub-main
Public Types | Public Member Functions | Public Attributes | List of all members
CanBusResources Class Reference

Public Types

enum  {
  CAN_TIMEOUT = 20 ,
  CAN_POLLING_INTERVAL = 10
}
 

Public Member Functions

 CanBusResources ()
 
 ~CanBusResources ()
 
bool initialize (const CanBusMotionControlParameters &parms)
 
bool initialize (yarp::os::Searchable &config)
 
bool uninitialize ()
 
bool read ()
 
bool startPacket ()
 
bool addMessage (int msg_id, int joint)
 
bool addMessage (int id, int joint, int msg_id)
 
bool writePacket ()
 
bool printMessage (const CanMessage &m)
 
bool dumpBuffers (void)
 
int getJoints (void) const
 
bool getErrorStatus (void) const
 
void printMessage (const char *fmt,...)
 

Public Attributes

ICanBus * iCanBus
 
ICanBufferFactory * iBufferFactory
 
ICanBusErrors * iCanErrors
 
char buffer [DEBUG_PRINTF_BUFFER_LENGTH]
 
bool _initialized
 
unsigned int _timeout
 
int _polling_interval
 this is my thread timeout. More...
 
int _speed
 thread polling interval. More...
 
int _networkN
 speed of the bus. More...
 
int _txQueueSize
 network number. More...
 
int _rxQueueSize
 
int _txTimeout
 
int _rxTimeout
 
unsigned int _readMessages
 
unsigned int _writeMessages
 size of the last read buffer. More...
 
unsigned int _echoMessages
 size of the write packet. More...
 
CanBuffer _readBuffer
 size of the last read buffer. More...
 
CanBuffer _writeBuffer
 read buffer. More...
 
CanBuffer _replyBuffer
 write buffer. More...
 
CanBuffer _echoBuffer
 reply buffer. More...
 
BCastBufferElement_bcastRecvBuffer
 echo buffer. More...
 
unsigned char _my_address
 local storage for bcast messages. More...
 
unsigned char _destinations [CAN_MAX_CARDS]
 
int _velShifts [CAN_MAX_CARDS]
 list of connected cards (and their addresses). More...
 
unsigned char * _destInv
 list of velocity shift More...
 
std::string * _jointNames
 
int _njoints
 
bool _error_status
 number of joints (ncards * 2). More...
 
int _filter
 error status of the last packet. More...
 
char _printBuffer [16384]
 don't print filtered messages. More...
 
RequestsQueuerequestsQueue
 might be better with dynamic allocation. More...
 

Detailed Description

Definition at line 353 of file CanBusMotionControl.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
CAN_TIMEOUT 
CAN_POLLING_INTERVAL 

Definition at line 400 of file CanBusMotionControl.cpp.

Constructor & Destructor Documentation

◆ CanBusResources()

CanBusResources::CanBusResources ( )

default 1Mbit/s

Definition at line 2030 of file CanBusMotionControl.cpp.

◆ ~CanBusResources()

CanBusResources::~CanBusResources ( )

Definition at line 2059 of file CanBusMotionControl.cpp.

Member Function Documentation

◆ addMessage() [1/2]

bool CanBusResources::addMessage ( int  id,
int  joint,
int  msg_id 
)

Definition at line 2286 of file CanBusMotionControl.cpp.

◆ addMessage() [2/2]

bool CanBusResources::addMessage ( int  msg_id,
int  joint 
)

Definition at line 2270 of file CanBusMotionControl.cpp.

◆ dumpBuffers()

bool CanBusResources::dumpBuffers ( void  )

dump the error.

Definition at line 2365 of file CanBusMotionControl.cpp.

◆ getErrorStatus()

bool CanBusResources::getErrorStatus ( void  ) const
inline

Definition at line 383 of file CanBusMotionControl.cpp.

◆ getJoints()

int CanBusResources::getJoints ( void  ) const
inline

Definition at line 382 of file CanBusMotionControl.cpp.

◆ initialize() [1/2]

bool CanBusResources::initialize ( const CanBusMotionControlParameters parms)

default 1Mbit/s

Definition at line 2093 of file CanBusMotionControl.cpp.

◆ initialize() [2/2]

bool CanBusResources::initialize ( yarp::os::Searchable &  config)

Definition at line 2064 of file CanBusMotionControl.cpp.

◆ printMessage() [1/2]

bool CanBusResources::printMessage ( const CanMessage &  m)

Definition at line 2331 of file CanBusMotionControl.cpp.

◆ printMessage() [2/2]

void CanBusResources::printMessage ( const char *  fmt,
  ... 
)
inline

Definition at line 385 of file CanBusMotionControl.cpp.

◆ read()

bool CanBusResources::read ( )

Definition at line 2254 of file CanBusMotionControl.cpp.

◆ startPacket()

bool CanBusResources::startPacket ( )

Definition at line 2264 of file CanBusMotionControl.cpp.

◆ uninitialize()

bool CanBusResources::uninitialize ( )

Definition at line 2212 of file CanBusMotionControl.cpp.

◆ writePacket()

bool CanBusResources::writePacket ( )

Definition at line 2308 of file CanBusMotionControl.cpp.

Member Data Documentation

◆ _bcastRecvBuffer

BCastBufferElement* CanBusResources::_bcastRecvBuffer

echo buffer.

Definition at line 424 of file CanBusMotionControl.cpp.

◆ _destinations

unsigned char CanBusResources::_destinations[CAN_MAX_CARDS]

Definition at line 427 of file CanBusMotionControl.cpp.

◆ _destInv

unsigned char* CanBusResources::_destInv

list of velocity shift

Definition at line 429 of file CanBusMotionControl.cpp.

◆ _echoBuffer

CanBuffer CanBusResources::_echoBuffer

reply buffer.

Definition at line 422 of file CanBusMotionControl.cpp.

◆ _echoMessages

unsigned int CanBusResources::_echoMessages

size of the write packet.

Definition at line 417 of file CanBusMotionControl.cpp.

◆ _error_status

bool CanBusResources::_error_status

number of joints (ncards * 2).

Definition at line 434 of file CanBusMotionControl.cpp.

◆ _filter

int CanBusResources::_filter

error status of the last packet.

used to spy on can messages.

Definition at line 437 of file CanBusMotionControl.cpp.

◆ _initialized

bool CanBusResources::_initialized

Definition at line 403 of file CanBusMotionControl.cpp.

◆ _jointNames

std::string* CanBusResources::_jointNames

Definition at line 430 of file CanBusMotionControl.cpp.

◆ _my_address

unsigned char CanBusResources::_my_address

local storage for bcast messages.

Definition at line 426 of file CanBusMotionControl.cpp.

◆ _networkN

int CanBusResources::_networkN

speed of the bus.

Definition at line 408 of file CanBusMotionControl.cpp.

◆ _njoints

int CanBusResources::_njoints

Definition at line 432 of file CanBusMotionControl.cpp.

◆ _polling_interval

int CanBusResources::_polling_interval

this is my thread timeout.

Definition at line 406 of file CanBusMotionControl.cpp.

◆ _printBuffer

char CanBusResources::_printBuffer[16384]

don't print filtered messages.

Definition at line 439 of file CanBusMotionControl.cpp.

◆ _readBuffer

CanBuffer CanBusResources::_readBuffer

size of the last read buffer.

Definition at line 419 of file CanBusMotionControl.cpp.

◆ _readMessages

unsigned int CanBusResources::_readMessages

Definition at line 415 of file CanBusMotionControl.cpp.

◆ _replyBuffer

CanBuffer CanBusResources::_replyBuffer

write buffer.

Definition at line 421 of file CanBusMotionControl.cpp.

◆ _rxQueueSize

int CanBusResources::_rxQueueSize

Definition at line 411 of file CanBusMotionControl.cpp.

◆ _rxTimeout

int CanBusResources::_rxTimeout

Definition at line 413 of file CanBusMotionControl.cpp.

◆ _speed

int CanBusResources::_speed

thread polling interval.

Definition at line 407 of file CanBusMotionControl.cpp.

◆ _timeout

unsigned int CanBusResources::_timeout

Definition at line 404 of file CanBusMotionControl.cpp.

◆ _txQueueSize

int CanBusResources::_txQueueSize

network number.

Definition at line 410 of file CanBusMotionControl.cpp.

◆ _txTimeout

int CanBusResources::_txTimeout

Definition at line 412 of file CanBusMotionControl.cpp.

◆ _velShifts

int CanBusResources::_velShifts[CAN_MAX_CARDS]

list of connected cards (and their addresses).

Definition at line 428 of file CanBusMotionControl.cpp.

◆ _writeBuffer

CanBuffer CanBusResources::_writeBuffer

read buffer.

Definition at line 420 of file CanBusMotionControl.cpp.

◆ _writeMessages

unsigned int CanBusResources::_writeMessages

size of the last read buffer.

Definition at line 416 of file CanBusMotionControl.cpp.

◆ buffer

char CanBusResources::buffer[DEBUG_PRINTF_BUFFER_LENGTH]

Definition at line 398 of file CanBusMotionControl.cpp.

◆ iBufferFactory

ICanBufferFactory* CanBusResources::iBufferFactory

Definition at line 362 of file CanBusMotionControl.cpp.

◆ iCanBus

ICanBus* CanBusResources::iCanBus

Definition at line 361 of file CanBusMotionControl.cpp.

◆ iCanErrors

ICanBusErrors* CanBusResources::iCanErrors

Definition at line 363 of file CanBusMotionControl.cpp.

◆ requestsQueue

RequestsQueue* CanBusResources::requestsQueue

might be better with dynamic allocation.

Definition at line 440 of file CanBusMotionControl.cpp.


The documentation for this class was generated from the following file: