You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My system configuration is Ubuntu 20.04. I am attaching the program 'state_sampling.cpp' and the CMakeLists.txt file. I am getting a segmentation fault error while trying to access the vertex state of the roadmap constructed by SPARS, while the same code works without errors on using Probabilistic RoadMap Planners (PRM)
Seems like this is an issue with SPARS, where the vertex at index 0 in the sparse roadmap is null. If you check the edges that exist in the roadmap, you'll see that index 0 is never used. I would just throw a check if state_map[index] is null before accessing state data, e.g.,
auto state_map = boost::get(og::SPARS::vertex_state_t(), graph);
auto vertices = boost::vertices(graph);
for (auto s = vertices.first; s != vertices.second; ++s)
{
if (not state_map[*s])
continue;
std::cout << *s << "=(" << state_map[*s]->as<ob::CompoundState>()->as<ob::DiscreteStateSpace::StateType>(0)->value
<< "," << state_map[*s]->as<ob::CompoundState>()->as<ob::DiscreteStateSpace::StateType>(1)->value
<< ")" << std::endl;
}
My system configuration is Ubuntu 20.04. I am attaching the program 'state_sampling.cpp' and the CMakeLists.txt file. I am getting a segmentation fault error while trying to access the vertex state of the roadmap constructed by SPARS, while the same code works without errors on using Probabilistic RoadMap Planners (PRM)
state_sampling.cpp
CMakeLists.txt
Is this an issue due to the library or am I accessing the vertex states in an incorrect fashion.
The text was updated successfully, but these errors were encountered: