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;
157 success = regex_search(str, matches, stringRegex_);
158 if (matches.empty() || !matches.ready())
163 ROS_INFO(
"Match size is: %lu", matches.size());
164 for (
unsigned i = 0; i < matches.size(); ++i)
169 std::string
s = matches[0];
170 char temp_comp, calibration, data_format, baud_rate;
172 int bytes_count = sscanf(s.c_str(), format_.c_str(), &temp_comp, &calibration, &data_format, &baud_rate);
175 ROS_ERROR(
"Failed to format communication setup fields");
179 tempComp_ = temp_comp -
'0';
180 calibration_ = calibration -
'0';
181 dataFormat_ = data_format -
'0';
182 baudRate_ = baud_rate -
'0';
183 ROS_INFO(
"Baud rate is: %u, data format is: %u, temp comp: %u, calibration: %u", getBaudRate(), getDataFormat(),
184 getTempComp(), getCalibration());
uint8_t getChopEnable() const
const std::string formatString_
configuration::ForceTorqueFilter filter_
bool formatCommand(std::string &formattedString) override
double sensorCalibration2_
bool formatCommand(std::string &formattedString) override
bool formatCommand(std::string &formattedString) override
bool matchInString(const std::string &str) override
double sensorCalibration6_
uint8_t getTemperatureCompensationActive() const
bool formatCommand(std::string &formattedString) override
RokubiminiSerialCommandOffset()=delete
bool formatCommand(std::string &formattedString) override
bool formatCommand(std::string &formattedString) override
double sensorCalibration5_
double sensorCalibration4_
bool formatCommand(std::string &formattedString) override
uint8_t getFastEnable() const
uint8_t getSkipEnable() const
const std::string formatString_
double sensorCalibration3_
const std::string formatString_
bool formatCommand(std::string &formattedString) override
#define ROS_DEBUG_STREAM(args)
uint16_t getSincFilterSize() const
#define ROS_INFO_STREAM(args)
const Eigen::Matrix< double, 6, 1 > forceTorqueOffset_
RokubiminiSerialCommandCommSetup()=delete
uint8_t getCalibrationMatrixActive() const
configuration::SensorConfiguration sensorConfiguration_
RokubiminiSerialCommandSensorCalibrationRow()=delete
bool formatCommand(std::string &formattedString) override
double sensorCalibration1_
bool formatCommand(std::string &formattedString) override
bool formatCommand(std::string &formattedString) override
const std::string formatString_
RokubiminiSerialCommandFilter()=delete