27 #include <sys/types.h> 35 #define SEC_PER_RTD (0.000002)
36 #define MAX_T_RTD ((double)MAX_RTD * SEC_PER_RTD)
62 int open(
const char *deviceName,
int baudrate);
126 int tx(
unsigned char *pPacket,
int numPacket);
136 int rx(
unsigned char *pPacket,
int numPacket);
int rx(unsigned char *pPacket, int numPacket)
Receive Dynamixel status packet.
void close()
Close Dynamixel Bus serial interface.
int m_fd
device file descriptor
double m_fSecPerByte
seconds per byte transfer time
dxlhal()
Default constructor.
int m_nBaudRate
device baud rate
double m_fRcvWaitTime
receive max elapse wait time
int dxl_hal_open(int deviceIndex, float baudrate)
Open Dynamixel Bus USB serial device by index.
double calcSecPerByte(int baudrate)
Calculate seconds/byte transmit/recieve time in seconds.
void setTimeout(int NumRcvByte)
Set receive timeout.
bool hasTimedOut()
Test if receive timeout has expired.
int open(const char *deviceName, int baudrate)
Open Dynamixel Bus USB serial device by name.
std::string getDeviceName()
Get the Dynamixel Bus serial device name.
std::string m_strDeviceName
device name
int setBaudRate(int baudrate)
Set opened Dynamixel Bus serial interface baud rate.
double m_fStartTime
event start time
void clear()
Discard any pending recieve data.
int tx(unsigned char *pPacket, int numPacket)
Transmit Dynamixel instruction packet.
int getFd()
Get the Dynamixel Bus serial device file descriptor.
int getBaudRate()
Get the Dynamixel Bus serial device baud rate.