![]() |
Dynamixel
2.9.5
RoadNarrows Robotics Dynamixel Package
|
Public Member Functions | |
dxlhal () | |
Default constructor. | |
~dxlhal () | |
Destructor. | |
int | open (const char *deviceName, int baudrate) |
Open Dynamixel Bus USB serial device by name. More... | |
int | dxl_hal_open (int deviceIndex, float baudrate) |
Open Dynamixel Bus USB serial device by index. More... | |
void | close () |
Close Dynamixel Bus serial interface. | |
std::string | getDeviceName () |
Get the Dynamixel Bus serial device name. More... | |
int | getBaudRate () |
Get the Dynamixel Bus serial device baud rate. More... | |
int | getFd () |
Get the Dynamixel Bus serial device file descriptor. More... | |
int | setBaudRate (int baudrate) |
Set opened Dynamixel Bus serial interface baud rate. More... | |
void | clear () |
Discard any pending recieve data. | |
int | tx (unsigned char *pPacket, int numPacket) |
Transmit Dynamixel instruction packet. More... | |
int | rx (unsigned char *pPacket, int numPacket) |
Receive Dynamixel status packet. More... | |
void | setTimeout (int NumRcvByte) |
Set receive timeout. More... | |
bool | hasTimedOut () |
Test if receive timeout has expired. More... | |
Protected Member Functions | |
double | calcSecPerByte (int baudrate) |
Calculate seconds/byte transmit/recieve time in seconds. More... | |
double | now () |
Mark time. More... | |
Protected Attributes | |
std::string | m_strDeviceName |
device name | |
int | m_nBaudRate |
device baud rate | |
int | m_fd |
device file descriptor | |
double | m_fSecPerByte |
seconds per byte transfer time | |
double | m_fStartTime |
event start time | |
double | m_fRcvWaitTime |
receive max elapse wait time | |
|
protected |
Calculate seconds/byte transmit/recieve time in seconds.
baudrate | Serial baud rate. |
Definition at line 289 of file dxlhal.cxx.
int dxlhal::dxl_hal_open | ( | int | deviceIndex, |
float | baudrate | ||
) |
Open Dynamixel Bus USB serial device by index.
The serial device is opened and attributes set.
deviceIndex | Device number of /dev/ttyUSBn, n == deviceIndex. |
baudrate | Serial baud rate. |
Definition at line 86 of file dxlhal.cxx.
Referenced by libdxl::dxl::dxl_initialize().
int dxlhal::getBaudRate | ( | ) |
Get the Dynamixel Bus serial device baud rate.
Definition at line 163 of file dxlhal.cxx.
string dxlhal::getDeviceName | ( | ) |
int dxlhal::getFd | ( | ) |
Get the Dynamixel Bus serial device file descriptor.
Definition at line 168 of file dxlhal.cxx.
Referenced by libdxl::dxl::getFd().
bool dxlhal::hasTimedOut | ( | ) |
Test if receive timeout has expired.
Definition at line 260 of file dxlhal.cxx.
Referenced by libdxl::dxl::rxPacket().
|
protected |
int dxlhal::open | ( | const char * | deviceName, |
int | baudrate | ||
) |
Open Dynamixel Bus USB serial device by name.
The serial device is opened and attributes set.
deviceName | Name of serial device. |
baudrate | Serial baud rate. |
Definition at line 60 of file dxlhal.cxx.
Referenced by libdxl::dxl::open().
int dxlhal::rx | ( | unsigned char * | pPacket, |
int | numPacket | ||
) |
Receive Dynamixel status packet.
[out] | pPacket | Packed packet. |
numPacket | Number of bytes to read. |
Definition at line 229 of file dxlhal.cxx.
Referenced by libdxl::dxl::rxPacket().
int dxlhal::setBaudRate | ( | int | baudrate | ) |
Set opened Dynamixel Bus serial interface baud rate.
baudrate | Baud rate. |
Definition at line 173 of file dxlhal.cxx.
Referenced by libdxl::dxl::setBaudRate().
void dxlhal::setTimeout | ( | int | NumRcvByte | ) |
Set receive timeout.
NumRcvByte | Number of expected receive bytes |
Definition at line 248 of file dxlhal.cxx.
References MAX_T_RTD.
Referenced by libdxl::dxl::txPacket().
int dxlhal::tx | ( | unsigned char * | pPacket, |
int | numPacket | ||
) |
Transmit Dynamixel instruction packet.
[in] | pPacket | Packed packet. |
numPacket | Number of bytes to transmit. |
Definition at line 212 of file dxlhal.cxx.
Referenced by libdxl::dxl::txPacket().