From ae73135d70eebfd42779bad51703f7319d109e51 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 14 Mar 2024 09:08:39 -0700 Subject: [PATCH] [urdf] Fix urdf header include on Windows --- dart/utils/urdf/DartLoader.cpp | 4 +-- dart/utils/urdf/IncludeUrdf.hpp | 45 +++++++++++++++++++++++++++ dart/utils/urdf/urdf_world_parser.cpp | 5 +-- dart/utils/urdf/urdf_world_parser.hpp | 6 +--- 4 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 dart/utils/urdf/IncludeUrdf.hpp diff --git a/dart/utils/urdf/DartLoader.cpp b/dart/utils/urdf/DartLoader.cpp index 51ee2c050bb80..3fcffb5a49935 100644 --- a/dart/utils/urdf/DartLoader.cpp +++ b/dart/utils/urdf/DartLoader.cpp @@ -36,9 +36,6 @@ #include #include -#include -#include - #include "dart/dynamics/BodyNode.hpp" #include "dart/dynamics/BoxShape.hpp" #include "dart/dynamics/CylinderShape.hpp" @@ -55,6 +52,7 @@ #include "dart/simulation/World.hpp" #include "dart/utils/DartResourceRetriever.hpp" #include "dart/utils/urdf/BackwardCompatibility.hpp" +#include "dart/utils/urdf/IncludeUrdf.hpp" #include "dart/utils/urdf/urdf_world_parser.hpp" namespace dart { diff --git a/dart/utils/urdf/IncludeUrdf.hpp b/dart/utils/urdf/IncludeUrdf.hpp new file mode 100644 index 0000000000000..8b298a9e8026b --- /dev/null +++ b/dart/utils/urdf/IncludeUrdf.hpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2011-2024, The DART development contributors + * All rights reserved. + * + * The list of contributors can be found at: + * https://github.com/dartsim/dart/blob/main/LICENSE + * + * This file is provided under the following "BSD-style" License: + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +// clang-format off + +#include + +#include +#include +#include +#include +#include + +// clang-format on diff --git a/dart/utils/urdf/urdf_world_parser.cpp b/dart/utils/urdf/urdf_world_parser.cpp index 0bc0aa350855a..41701859cfe9b 100644 --- a/dart/utils/urdf/urdf_world_parser.cpp +++ b/dart/utils/urdf/urdf_world_parser.cpp @@ -42,12 +42,9 @@ #include #include -#include -#include -#include -#include #include "dart/common/Console.hpp" +#include "dart/utils/urdf/IncludeUrdf.hpp" const bool debug = false; diff --git a/dart/utils/urdf/urdf_world_parser.hpp b/dart/utils/urdf/urdf_world_parser.hpp index 41acde5ddc09b..ff259df6efabb 100644 --- a/dart/utils/urdf/urdf_world_parser.hpp +++ b/dart/utils/urdf/urdf_world_parser.hpp @@ -39,14 +39,10 @@ #include -#include -#include -#include -#include - #include "dart/common/ResourceRetriever.hpp" #include "dart/common/Uri.hpp" #include "dart/utils/urdf/BackwardCompatibility.hpp" +#include "dart/utils/urdf/IncludeUrdf.hpp" namespace dart { namespace utils {