1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-04-12 11:00:47 +02:00

Parse unknown states to default RobotStates

This commit is contained in:
Felix Mauch
2019-04-10 10:01:17 +02:00
parent 4dc4cc0fb0
commit fcc1e62ab5
5 changed files with 37 additions and 12 deletions

View File

@@ -33,13 +33,21 @@ namespace primary_interface
{
bool PrimaryPackage::parseWith(comm::BinParser& bp)
{
bp.parseRemainder(buffer_);
bp.rawData(buffer_, buffer_length_);
return true;
}
std::string PrimaryPackage::toString() const
{
return buffer_;
std::stringstream ss;
ss << "Raw byte stream: ";
for (size_t i = 0; i < buffer_length_; ++i)
{
uint8_t* buf = buffer_.get();
ss << std::hex << static_cast<int>(buf[i]) << " ";
}
ss << std::endl;
return ss.str();
}
} // namespace primary_interface