Skip to content

Commit

Permalink
coal: Don't include hpp/fcl/config.hpp if collision is not enable
Browse files Browse the repository at this point in the history
Split forward declaration in a standalone header to avoid code
duplication in sdf/geometry.hxx.
  • Loading branch information
jorisv authored and jcarpent committed Jul 16, 2024
1 parent ed5e91c commit 7dd9c3e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 31 deletions.
31 changes: 31 additions & 0 deletions include/pinocchio/parsers/meshloader-fwd.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// Copyright (c) 2024 INRIA
//

#ifndef __pinocchio_parsers_meshloader_fwd_hpp__
#define __pinocchio_parsers_meshloader_fwd_hpp__

#include <memory>

#ifdef PINOCCHIO_WITH_HPP_FCL
#include <hpp/fcl/config.hh>
#endif // PINOCCHIO_WITH_HPP_FCL

#ifdef COAL_VERSION
namespace coal
{
class MeshLoader;
typedef std::shared_ptr<MeshLoader> MeshLoaderPtr;
} // namespace coal
#else
namespace hpp
{
namespace fcl
{
class MeshLoader;
typedef std::shared_ptr<MeshLoader> MeshLoaderPtr;
} // namespace fcl
} // namespace hpp
#endif // COAL_VERSION

#endif // __pinocchio_parsers_meshloader_fwd_hpp__
10 changes: 1 addition & 9 deletions include/pinocchio/parsers/sdf/geometry.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@
#include "pinocchio/parsers/config.hpp"
#include "pinocchio/parsers/sdf.hpp"
#include "pinocchio/parsers/utils.hpp"
#include "pinocchio/parsers/meshloader-fwd.hpp"

#include <string>
#include <vector>

namespace hpp
{
namespace fcl
{
class MeshLoader;
typedef std::shared_ptr<MeshLoader> MeshLoaderPtr;
} // namespace fcl
} // namespace hpp

namespace pinocchio
{
namespace sdf
Expand Down
24 changes: 2 additions & 22 deletions include/pinocchio/parsers/urdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,18 @@
#ifndef __pinocchio_parsers_urdf_hpp__
#define __pinocchio_parsers_urdf_hpp__

#include <hpp/fcl/config.hh>
#include "pinocchio/multibody/model.hpp"
#include "pinocchio/multibody/geometry.hpp"
#include "pinocchio/parsers/meshloader-fwd.hpp"

#ifdef PINOCCHIO_WITH_CXX11_SUPPORT
#include <memory>
#endif
#include <memory>

/// \cond
// forward declaration of the unique type from urdfdom which is expose.
namespace urdf
{
class ModelInterface;
}

#ifdef COAL_VERSION
namespace coal
{
class MeshLoader;
typedef std::shared_ptr<MeshLoader> MeshLoaderPtr;
} // namespace coal
/// \endcond
#else
namespace hpp
{
namespace fcl
{
class MeshLoader;
typedef std::shared_ptr<MeshLoader> MeshLoaderPtr;
} // namespace fcl
} // namespace hpp
#endif
/// \endcond

namespace pinocchio
Expand Down
1 change: 1 addition & 0 deletions sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ set(${PROJECT_NAME}_PARSERS_SOURCES
${PROJECT_SOURCE_DIR}/src/parsers/mjcf/mjcf-graph-geom.cpp)

set(${PROJECT_NAME}_PARSERS_PUBLIC_HEADERS
${PROJECT_SOURCE_DIR}/include/pinocchio/parsers/meshloader-fwd.hpp
${PROJECT_SOURCE_DIR}/include/pinocchio/parsers/srdf.hpp
${PROJECT_SOURCE_DIR}/include/pinocchio/parsers/srdf.hxx
${PROJECT_SOURCE_DIR}/include/pinocchio/parsers/utils.hpp
Expand Down

0 comments on commit 7dd9c3e

Please sign in to comment.