36 : motors(port, baud_rate,
serial::Timeout::simpleTimeout(100)),
37 serial_errors(0), error_threshold(20) {
49 ROS_DEBUG(
"out %02x %02x %02x %02x %02x %02x %02x %02x", out[0], out[1],
50 out[2], out[3], out[4], out[5], out[6], out[7]);
56 for (
auto&
command : commands) {
58 ROS_DEBUG(
"out %02x %02x %02x %02x %02x %02x %02x %02x", out[0], out[1],
59 out[2], out[3], out[4], out[5], out[6], out[7]);
61 boost::this_thread::sleep(boost::posix_time::milliseconds(2));
95 }
catch (
const std::invalid_argument) {
96 ROS_ERROR(
"MotorSerial::openPort Invalid argument");
112 boost::this_thread::interruption_point();
130 ROS_DEBUG(
"Got message %x %x %x %x %x %x %x %x", innew[0],
131 innew[1], innew[2], innew[3], innew[4], innew[5],
136 if (error_code == 0) {
145 ROS_WARN_ONCE(
"Message deserialize found an unrecognized firmware register");
147 ROS_ERROR(
"DESERIALIZATION ERROR! - %d", error_code);
154 }
catch (
const boost::thread_interrupted& e) {