Closed acf986 closed 5 months ago
@acf986 Hi, this is a known bug and has been fixed in release v0.10, which will be released soon.
I am sorry, in the mean while, can you suggest any quick fix that we can apply ourself to safely avoid this issue?
@acf986 A simple workaround is to get again if the ptStates contains corrupted element.
auto ptStates = robot.getPrimitiveStates();
for (const auto& v : ptStates) {
if (v.empty()) {
// ptStates contains corrupted data, try again
ptStates = robot.getPrimitiveStates();
break;
}
}
Version information
Describe the bug Calling the following line causes the program to crash:
flexiv::utility::parsePtStates(m_se->get_robot()->getPrimitiveStates(), "reachedTarget") == "1"
This is line I copied from the official execute_primitive example.Here the m_se->get_robot()->getPrimitiveStates() function call is a wrapper around the flexiv rdk's api:
Steps to reproduce
Expected behavior The code does not crash.
Screenshots I have valgrind my code and find the issue to be:
Which leads to the function
flexiv::utility::parsePtStates
and the line 173 in Utility.hppparsedState.front() == parseTarget
It seems in this case the parsedState is a empty vector.