From 9f7a377e91f45dcce84482e544d13a2426079de1 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Wed, 30 Aug 2023 17:15:07 +0200 Subject: [PATCH] Use relative path in an urdf include to avoid confusion between internal and system headers (#1259) Signed-off-by: Jose Luis Rivero --- src/urdf/urdf_parser/check_urdf.cpp | 2 +- src/urdf/urdf_parser/joint.cpp | 2 +- src/urdf/urdf_parser/link.cpp | 2 +- src/urdf/urdf_parser/model.cpp | 6 +++++- src/urdf/urdf_parser/pose.cpp | 2 +- src/urdf/urdf_parser/urdf_to_graphiz.cpp | 2 +- src/urdf/urdf_parser/world.cpp | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/urdf/urdf_parser/check_urdf.cpp b/src/urdf/urdf_parser/check_urdf.cpp index 1222f2c05..50624c71a 100644 --- a/src/urdf/urdf_parser/check_urdf.cpp +++ b/src/urdf/urdf_parser/check_urdf.cpp @@ -35,7 +35,7 @@ /* Author: Wim Meeussen */ #pragma warning(push, 0) -#include "urdf_parser/urdf_parser.h" +#include "../urdf_parser/urdf_parser.h" #include #include diff --git a/src/urdf/urdf_parser/joint.cpp b/src/urdf/urdf_parser/joint.cpp index 48765718d..c00958ff9 100644 --- a/src/urdf/urdf_parser/joint.cpp +++ b/src/urdf/urdf_parser/joint.cpp @@ -41,7 +41,7 @@ #include // #include #include -#include +#include "../urdf_parser/urdf_parser.h" namespace urdf{ diff --git a/src/urdf/urdf_parser/link.cpp b/src/urdf/urdf_parser/link.cpp index 415c4ee5d..8c7555cfe 100644 --- a/src/urdf/urdf_parser/link.cpp +++ b/src/urdf/urdf_parser/link.cpp @@ -35,7 +35,7 @@ /* Author: Wim Meeussen */ #pragma warning(push, 0) -#include +#include "../urdf_parser/urdf_parser.h" #include #include #include diff --git a/src/urdf/urdf_parser/model.cpp b/src/urdf/urdf_parser/model.cpp index 804c39435..9ff9b15e9 100644 --- a/src/urdf/urdf_parser/model.cpp +++ b/src/urdf/urdf_parser/model.cpp @@ -36,7 +36,11 @@ #pragma warning(push, 0) #include -#include "urdf_parser/urdf_parser.h" +// Use relative path to avoid confusion with urdf system headers (if present). +// The change to the relative path is only required to be present in this +// file given how MSVC include headers. See: +// https://github.com/gazebosim/sdformat/pull/1259/files#r1149821498 +#include "../urdf_parser/urdf_parser.h" // #include #include diff --git a/src/urdf/urdf_parser/pose.cpp b/src/urdf/urdf_parser/pose.cpp index 32207e1be..a47d5c11e 100644 --- a/src/urdf/urdf_parser/pose.cpp +++ b/src/urdf/urdf_parser/pose.cpp @@ -41,7 +41,7 @@ #include // #include #include -#include +#include "../urdf_parser/urdf_parser.h" namespace urdf_export_helpers { diff --git a/src/urdf/urdf_parser/urdf_to_graphiz.cpp b/src/urdf/urdf_parser/urdf_to_graphiz.cpp index eae2c8229..9f72efd12 100644 --- a/src/urdf/urdf_parser/urdf_to_graphiz.cpp +++ b/src/urdf/urdf_parser/urdf_to_graphiz.cpp @@ -35,7 +35,7 @@ /* Author: Wim Meeussen */ #pragma warning(push, 0) -#include "urdf_parser/urdf_parser.h" +#include "../urdf_parser/urdf_parser.h" #include #include diff --git a/src/urdf/urdf_parser/world.cpp b/src/urdf/urdf_parser/world.cpp index c1dcb7d37..0f27bdf18 100644 --- a/src/urdf/urdf_parser/world.cpp +++ b/src/urdf/urdf_parser/world.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include "../urdf_parser/urdf_parser.h" #include #include #include