Skip to content
Snippets Groups Projects
Commit 9bacc7fd authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

hotfix state block vector size assert fail

parent f99bebac
No related branches found
No related tags found
No related merge requests found
Pipeline #4249 passed
...@@ -168,8 +168,11 @@ inline std::vector<StateBlockPtr>& LandmarkBase::getStateBlockVec() ...@@ -168,8 +168,11 @@ inline std::vector<StateBlockPtr>& LandmarkBase::getStateBlockVec()
inline StateBlockPtr LandmarkBase::getStateBlock(unsigned int _i) const inline StateBlockPtr LandmarkBase::getStateBlock(unsigned int _i) const
{ {
assert (_i < state_block_vec_.size() && "Requested a state block pointer out of the vector range!"); // assert (_i < state_block_vec_.size() && "Requested a state block pointer out of the vector range!");
return state_block_vec_[_i]; if (_i < state_block_vec_.size())
return state_block_vec_[_i];
else
return nullptr;
} }
inline void LandmarkBase::setStateBlock(unsigned int _i, StateBlockPtr _sb_ptr) inline void LandmarkBase::setStateBlock(unsigned int _i, StateBlockPtr _sb_ptr)
......
...@@ -156,7 +156,7 @@ YAML::Node LandmarkBase::saveToYaml() const ...@@ -156,7 +156,7 @@ YAML::Node LandmarkBase::saveToYaml() const
node["position"] = getP()->getState(); node["position"] = getP()->getState();
node["position fixed"] = getP()->isFixed(); node["position fixed"] = getP()->isFixed();
} }
if (getO() != nullptr) if (state_block_vec_.size() > 1 && getO() != nullptr)
{ {
node["orientation"] = getO()->getState(); node["orientation"] = getO()->getState();
node["orientation fixed"] = getO()->isFixed(); node["orientation fixed"] = getO()->isFixed();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment