diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fc70ec5802bcf45eb0bfedac6fe23cd84510967..7fc95211eb4843979f101a2260a87bee0627efbc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -257,7 +257,8 @@ IF(HPP_FCL_FOUND) multibody/geometry.hxx ) LIST(APPEND ${PROJECT_NAME}_ALGORITHM_HEADERS - algorithm/collisions.hpp + algorithm/geometry.hpp + algorithm/geometry.hxx ) ENDIF(HPP_FCL_FOUND) diff --git a/src/algorithm/geometry.hpp b/src/algorithm/geometry.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f4747025e9643b3527e24859cd490e54b9fc2413 --- /dev/null +++ b/src/algorithm/geometry.hpp @@ -0,0 +1,90 @@ +// +// Copyright (c) 2015-2016 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/>. + +#ifndef __se3_geometry_hpp__ +#define __se3_geometry_hpp__ + +#include "pinocchio/multibody/visitor.hpp" +#include "pinocchio/multibody/model.hpp" + +#include "pinocchio/algorithm/kinematics.hpp" +#include "pinocchio/multibody/geometry.hpp" + +namespace se3 +{ + + + /// + /// \brief Apply a forward kinematics and update the placement of the geometry objects. + /// + /// \param[in] model The model structure of the rigid body system. + /// \param[in] data The data structure of the rigid body system. + /// \param[in] geom The geometry model containing the collision objects. + /// \param[out] geom_data The geometry data containing the placements of the collision objects. See oMg field in GeometryData. + /// \param[in] q The joint configuration vector (dim model.nq). + /// + inline void updateGeometryPlacements(const Model & model, + Data & data, + const GeometryModel & geom, + GeometryData & geom_data, + const Eigen::VectorXd & q + ); + + /// + /// \brief Update the placement of the geometry objects according to the current joint placements contained in data. + /// + /// \param[in] model The model structure of the rigid body system. + /// \param[in] data The data structure of the rigid body system. + /// \param[in] geom The geometry model containing the collision objects. + /// \param[out] geom_data The geometry data containing the placements of the collision objects. See oMg field in GeometryData. + /// + inline void updateGeometryPlacements(const Model & model, + const Data & data, + const GeometryModel & geom, + GeometryData & geom_data + ); + + inline bool computeCollisions(const Model & model, + Data & data, + const GeometryModel & model_geom, + GeometryData & data_geom, + const Eigen::VectorXd & q, + const bool stopAtFirstCollision = false + ); + + inline bool computeCollisions(GeometryData & data_geom, + const bool stopAtFirstCollision = false + ); + + inline void computeDistances(GeometryData & data_geom); + + inline void computeDistances(const Model & model, + Data & data, + const GeometryModel & model_geom, + GeometryData & data_geom, + const Eigen::VectorXd & q + ); + + inline void computeBodyRadius(const GeometryModel & geomModel, + GeometryData & geomData); + +} // namespace se3 + +/* --- Details -------------------------------------------------------------------- */ +#include "pinocchio/algorithm/geometry.hxx" + +#endif // ifndef __se3_geometry_hpp__ diff --git a/src/algorithm/collisions.hpp b/src/algorithm/geometry.hxx similarity index 56% rename from src/algorithm/collisions.hpp rename to src/algorithm/geometry.hxx index 28a6979e895f1d8ed825a4ffaf6542e223ea430c..5fbaa70dc77d0a2fb09b1965f4ea58cb51b3bab0 100644 --- a/src/algorithm/collisions.hpp +++ b/src/algorithm/geometry.hxx @@ -15,73 +15,9 @@ // Pinocchio If not, see // <http://www.gnu.org/licenses/>. -#ifndef __se3_collisions_hpp__ -#define __se3_collisions_hpp__ +#ifndef __se3_geometry_hxx__ +#define __se3_geometry_hxx__ -#include "pinocchio/multibody/visitor.hpp" -#include "pinocchio/multibody/model.hpp" - -#include "pinocchio/algorithm/kinematics.hpp" -#include "pinocchio/multibody/geometry.hpp" - -namespace se3 -{ - - - /// - /// \brief Apply a forward kinematics and update the placement of the geometry objects. - /// - /// \param[in] model The model structure of the rigid body system. - /// \param[in] data The data structure of the rigid body system. - /// \param[in] geom The geometry model containing the collision objects. - /// \param[out] geom_data The geometry data containing the placements of the collision objects. See oMg field in GeometryData. - /// \param[in] q The joint configuration vector (dim model.nq). - /// - inline void updateGeometryPlacements(const Model & model, - Data & data, - const GeometryModel & geom, - GeometryData & geom_data, - const Eigen::VectorXd & q - ); - - /// - /// \brief Update the placement of the geometry objects according to the current joint placements contained in data. - /// - /// \param[in] model The model structure of the rigid body system. - /// \param[in] data The data structure of the rigid body system. - /// \param[in] geom The geometry model containing the collision objects. - /// \param[out] geom_data The geometry data containing the placements of the collision objects. See oMg field in GeometryData. - /// - inline void updateGeometryPlacements(const Model & model, - const Data & data, - const GeometryModel & geom, - GeometryData & geom_data - ); - - inline bool computeCollisions(const Model & model, - Data & data, - const GeometryModel & model_geom, - GeometryData & data_geom, - const Eigen::VectorXd & q, - const bool stopAtFirstCollision = false - ); - - inline bool computeCollisions(GeometryData & data_geom, - const bool stopAtFirstCollision = false - ); - - inline void computeDistances(GeometryData & data_geom); - - inline void computeDistances(const Model & model, - Data & data, - const GeometryModel & model_geom, - GeometryData & data_geom, - const Eigen::VectorXd & q - ); - -} // namespace se3 - -/* --- Details -------------------------------------------------------------------- */ namespace se3 { @@ -162,4 +98,4 @@ namespace se3 } // namespace se3 -#endif // ifndef __se3_collisions_hpp__ +#endif __se3_geometry_hxx__ diff --git a/src/python/algorithms.hpp b/src/python/algorithms.hpp index 33d3ac88fe7c1ebd6a7b2696263c47a8fc050a18..f4a3be720d0e8ffb9938a92ed140e62bbf7f1bb4 100644 --- a/src/python/algorithms.hpp +++ b/src/python/algorithms.hpp @@ -40,7 +40,7 @@ #include "pinocchio/multibody/geometry.hpp" #include "pinocchio/python/geometry-model.hpp" #include "pinocchio/python/geometry-data.hpp" - #include "pinocchio/algorithm/collisions.hpp" + #include "pinocchio/algorithm/geometry.hpp" #endif namespace se3 diff --git a/unittest/geom.cpp b/unittest/geom.cpp index 55cf86d7a855af3b599c45dd7aa01a7e04654177..4e822f7b5d95b723c3a9ad099ef22606e1ad35e3 100644 --- a/unittest/geom.cpp +++ b/unittest/geom.cpp @@ -34,7 +34,7 @@ #include "pinocchio/multibody/model.hpp" #include "pinocchio/parsers/sample-models.hpp" #include "pinocchio/algorithm/kinematics.hpp" -#include "pinocchio/algorithm/collisions.hpp" +#include "pinocchio/algorithm/geometry.hpp" #include "pinocchio/parsers/urdf.hpp" #include "pinocchio/spatial/explog.hpp"