11 : sensorConfiguration_(sensorConfiguration), dataFormat_(dataFormat), baudRate_(baudRate)
23 ROS_ERROR(
"Failed to format communication setup command");
26 formattedString.clear();
27 formattedString.assign(buffer, bytes_count);
44 ROS_ERROR(
"Failed to format filters command");
47 formattedString.clear();
48 formattedString.assign(buffer, bytes_count);
53 : forceTorqueOffset_(forceTorqueOffset)
66 ROS_ERROR(
"Failed to format offset command");
69 formattedString.clear();
70 formattedString.assign(buffer, bytes_count);
75 const double& sensorCalibration1,
const double& sensorCalibration2,
const double& sensorCalibration3,
76 const double& sensorCalibration4,
const double& sensorCalibration5,
const double& sensorCalibration6,
78 : sensorCalibration1_(sensorCalibration1)
79 , sensorCalibration2_(sensorCalibration2)
80 , sensorCalibration3_(sensorCalibration3)
81 , sensorCalibration4_(sensorCalibration4)
82 , sensorCalibration5_(sensorCalibration5)
83 , sensorCalibration6_(sensorCalibration6)
96 ROS_ERROR(
"Failed to format offset command");
99 formattedString.clear();
100 formattedString.assign(buffer, bytes_count);
106 formattedString.clear();
113 formattedString.clear();
120 formattedString.clear();
127 formattedString.clear();
134 formattedString.clear();
141 formattedString.clear();
148 formattedString.clear();
155 bool success =
false;
158 if (matches.empty() || !matches.ready())
162 ROS_DEBUG(
"Match size is: %zu", matches.size());
163 for (
unsigned i = 0; i < matches.size(); ++i)
168 std::string
s = matches[0];
169 char temp_comp, calibration, data_format, baud_rate;
171 int bytes_count = sscanf(
s.c_str(),
format_.c_str(), &temp_comp, &calibration, &data_format, &baud_rate);
174 ROS_ERROR(
"Failed to format communication setup fields");
189 bool success =
false;
192 if (matches.empty() || !matches.ready())
196 ROS_DEBUG(
"Match size is: %zu", matches.size());
197 for (
unsigned i = 0; i < matches.size(); ++i)
202 std::string
s = matches[0];
203 char first_number, return_code;
205 int bytes_count = sscanf(
s.c_str(),
format_.c_str(), &first_number, &
command_, &return_code);
208 ROS_ERROR(
"Failed to format ACK fields");
220 bool success =
false;
223 if (matches.empty() || !matches.ready())
227 ROS_DEBUG(
"Match size is: %zu", matches.size());
228 for (
unsigned i = 0; i < matches.size(); ++i)
233 std::string
s = matches[0];
234 char product_name[20];
236 int ret = sscanf(
s.c_str(),
format_.c_str(), &product_name);
239 ROS_ERROR(
"Failed to format product name");
249 bool success =
false;
252 if (matches.empty() || !matches.ready())
256 ROS_DEBUG(
"Match size is: %zu", matches.size());
257 for (
unsigned i = 0; i < matches.size(); ++i)
262 std::string
s = matches[0];
267 ROS_ERROR(
"Failed to format serial number");
276 bool success =
false;
279 if (matches.empty() || !matches.ready())
283 ROS_DEBUG(
"Match size is: %zu", matches.size());
284 for (
unsigned i = 0; i < matches.size(); ++i)
289 std::string
s = matches[0];
290 char firmware_version[25];
292 int ret = sscanf(
s.c_str(),
format_.c_str(), &firmware_version);
295 ROS_ERROR(
"Failed to format firmware version");
305 bool success =
false;
308 if (matches.empty() || !matches.ready())
312 ROS_DEBUG(
"Match size is: %zu", matches.size());
313 for (
unsigned i = 0; i < matches.size(); ++i)
318 std::string
s = matches[0];