diff --git a/include/gz/sim/Model.hh b/include/gz/sim/Model.hh index c3b668ac02..9de49ea0a1 100644 --- a/include/gz/sim/Model.hh +++ b/include/gz/sim/Model.hh @@ -126,18 +126,16 @@ namespace gz /// \param[in] _ecm Entity-component manager. /// \param[in] _name Joint name. /// \return Joint entity. - /// \todo(anyone) Make const public: sim::Entity JointByName(const EntityComponentManager &_ecm, - const std::string &_name); + const std::string &_name) const; /// \brief Get the ID of a link entity which is an immediate child of /// this model. /// \param[in] _ecm Entity-component manager. /// \param[in] _name Link name. /// \return Link entity. - /// \todo(anyone) Make const public: sim::Entity LinkByName(const EntityComponentManager &_ecm, - const std::string &_name); + const std::string &_name) const; /// \brief Get all joints which are immediate children of this model. /// \param[in] _ecm Entity-component manager. diff --git a/src/Model.cc b/src/Model.cc index c27ea760ec..a23779981f 100644 --- a/src/Model.cc +++ b/src/Model.cc @@ -130,7 +130,7 @@ std::string Model::SourceFilePath(const EntityComponentManager &_ecm) const ////////////////////////////////////////////////// Entity Model::JointByName(const EntityComponentManager &_ecm, - const std::string &_name) + const std::string &_name) const { return _ecm.EntityByComponents( components::ParentEntity(this->dataPtr->id), @@ -140,7 +140,7 @@ Entity Model::JointByName(const EntityComponentManager &_ecm, ////////////////////////////////////////////////// Entity Model::LinkByName(const EntityComponentManager &_ecm, - const std::string &_name) + const std::string &_name) const { return _ecm.EntityByComponents( components::ParentEntity(this->dataPtr->id),