Commit 4693e059 authored by jcarpent's avatar jcarpent
Browse files

[Multibody] Add check of data with respect to model

Call simply model.check(data)
parent a9150f14
//
// Copyright (c) 2015-2016 CNRS
// Copyright (c) 2015-2017 CNRS
// Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
//
// This file is part of Pinocchio
......@@ -24,6 +24,7 @@
#include <eigenpy/memory.hpp>
#include "pinocchio/multibody/model.hpp"
#include "pinocchio/algorithm/check.hpp"
#include "pinocchio/parsers/sample-models.hpp"
#include "pinocchio/bindings/python/utils/eigen_container.hpp"
#include "pinocchio/bindings/python/utils/printable.hpp"
......@@ -147,6 +148,8 @@ namespace se3
.staticmethod("BuildEmptyModel")
.def("BuildHumanoidSimple",&ModelPythonVisitor::maker_humanoidSimple)
.staticmethod("BuildHumanoidSimple")
.def("check",(bool (Model::*)(const Data &) const) &Model::check,bp::arg("data"),"Check consistency of data wrt model.")
;
}
......
//
// Copyright (c) 2016 CNRS
// Copyright (c) 2016-2017 CNRS
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
......@@ -132,6 +132,8 @@ namespace se3
#undef CHECK_DATA
return true;
}
inline bool Model::check(const Data & data) const { return checkData(*this,data); }
} // namespace se3
......
......@@ -336,6 +336,13 @@ namespace se3
/// Run check(fusion::list) with DEFAULT_CHECKERS as argument.
inline bool check() const;
/// Run checkData on data and current model.
///
/// \param[in] data to be checked wrt *this.
///
/// \return true if the data is valid, false otherwise.
inline bool check(const Data & data) const;
protected:
......
//
// Copyright (c) 2016-2017 CNRS
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// Pinocchio is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// Pinocchio If not, see
// <http://www.gnu.org/licenses/>.
#include <boost/fusion/container/generation/make_list.hpp>
#include <pinocchio/multibody/model.hpp>
......@@ -39,6 +55,8 @@ BOOST_AUTO_TEST_CASE ( test_check )
se3::Data data(model);
BOOST_CHECK(checkData(model,data));
BOOST_CHECK(model.check(data));
}
BOOST_AUTO_TEST_SUITE_END ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment