Skip to content
Snippets Groups Projects

Resolve "Revisit demos (formerly called examples) and update them"

3 files
+ 181
23
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -189,12 +189,11 @@ LandmarkBasePtr LandmarkBase::create(const YAML::Node& _node)
@@ -189,12 +189,11 @@ LandmarkBasePtr LandmarkBase::create(const YAML::Node& _node)
unsigned int id = _node["id"] .as< unsigned int >();
unsigned int id = _node["id"] .as< unsigned int >();
Eigen::VectorXs pos = _node["position"] .as< Eigen::VectorXs >();
Eigen::VectorXs pos = _node["position"] .as< Eigen::VectorXs >();
bool pos_fixed = _node["position fixed"] .as< bool >();
bool pos_fixed = _node["position fixed"] .as< bool >();
std::string type = _node["type"] .as< std::string >();
StateBlockPtr pos_sb = std::make_shared<StateBlock>(pos, pos_fixed);
StateBlockPtr pos_sb = std::make_shared<StateBlock>(pos, pos_fixed);
StateBlockPtr ori_sb = nullptr;
StateBlockPtr ori_sb = nullptr;
if (!_node["orientation"].as<std::string>().empty())
if (_node["orientation"])
{
{
Eigen::VectorXs ori = _node["orientation"].as< Eigen::VectorXs >();
Eigen::VectorXs ori = _node["orientation"].as< Eigen::VectorXs >();
bool ori_fixed = _node["orientation fixed"].as< bool >();
bool ori_fixed = _node["orientation fixed"].as< bool >();
@@ -205,7 +204,7 @@ LandmarkBasePtr LandmarkBase::create(const YAML::Node& _node)
@@ -205,7 +204,7 @@ LandmarkBasePtr LandmarkBase::create(const YAML::Node& _node)
ori_sb = std::make_shared<StateBlock>(ori, ori_fixed);
ori_sb = std::make_shared<StateBlock>(ori, ori_fixed);
}
}
LandmarkBasePtr lmk = std::make_shared<LandmarkBase>(type, pos_sb, ori_sb);
LandmarkBasePtr lmk = std::make_shared<LandmarkBase>("BASE", pos_sb, ori_sb);
lmk->setId(id);
lmk->setId(id);
return lmk;
return lmk;
Loading