36 if(Serial.available())
54 while(Serial.available())
75 _control_command_type = temp_id;
87 _control_commands[i - 1] = val;
97 this->
tx_buffer[i] = ((
char *) joint_positions)[i];
103 for(
int i = 0; i < this->number_of_motors*8; i++)
105 this->
tx_buffer[i + offset] = ((
char *) joint_velocities)[i];
111 for(
int i = 0; i < this->number_of_motors*8; i++)
113 this->
tx_buffer[i + offset] = ((
char *) joint_torques)[i];
void receiveControlCommands(double &_control_command_type, double *_control_commands)
Reads control command data available on the serial command and stores it.
unsigned char * tx_buffer
Transmit buffer.
void sendStates(double *_joint_positions, double *_joint_velocities, double *_joint_torques)
Sends the joint states to the serial line.
int tx_buffer_size
Transmit buffer size.
bool areControlCommandsAvailable()
Checks if there is any available data on the serial port.
int rx_buffer_size
Receive buffer size.
int number_of_motors
Number of motors.
TeensySerial(int _number_of_motors)
unsigned char * rx_buffer
Receive buffer.