Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support urdfdom_headers 1.0 for DART 5.1 (backport of #766) #799

Merged
merged 2 commits into from
Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ project(dart)

set(DART_MAJOR_VERSION "5")
set(DART_MINOR_VERSION "1")
set(DART_PATCH_VERSION "4")
set(DART_PATCH_VERSION "5")
set(DART_VERSION "${DART_MAJOR_VERSION}.${DART_MINOR_VERSION}.${DART_PATCH_VERSION}")
set(DART_PKG_DESC "Dynamic Animation and Robotics Toolkit.")
set(DART_PKG_EXTERNAL_DEPS "flann, ccd, fcl")
Expand Down Expand Up @@ -290,7 +290,7 @@ if(NOT BUILD_CORE_ONLY)
# urdfdom
find_package(urdfdom QUIET)
if(urdfdom_FOUND)
message(STATUS "Looking for urdfdom - found")
message(STATUS "Looking for urdfdom - ${urdfdom_headers_VERSION} found")
else()
message(SEND_ERROR "Looking for urdfdom - NOT found, please install liburdfdom-dev")
endif()
Expand Down
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### Version 5.1.5 (201X-XX-XX)

1. Added support of urdfdom_headers 1.0 for DART 5.1 (backport of [#766](https://github.com/dartsim/dart/pull/766))
* [Pull request #799](https://github.com/dartsim/dart/pull/799)

### Version 5.1.4 (2016-10-14)

1. Fixed inconsistent frame rate of GlutWindow
Expand Down
1 change: 1 addition & 0 deletions dart/collision/fcl/FCLTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
(FCL_MINOR_VERSION < y || (FCL_MINOR_VERSION <= y))))

#if FCL_VERSION_AT_LEAST(0,5,0)
#include <memory>
template <class T> using fcl_shared_ptr = std::shared_ptr<T>;
template <class T> using fcl_weak_ptr = std::weak_ptr<T>;
#else
Expand Down
4 changes: 2 additions & 2 deletions dart/common/Deprecated.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#include "dart/config.h"

#ifndef DART_COMMON_DEPRECATED_H_
#define DART_COMMON_DEPRECATED_H_

#include "dart/config.h"

//==============================================================================
// Deprecated is used for backward compatibility between different minor
// versions of DART. Every deprecated function should be removed for every major
Expand Down
12 changes: 12 additions & 0 deletions dart/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
(DART_MAJOR_VERSION < x || (DART_MAJOR_VERSION <= x && \
(DART_MINOR_VERSION < y || (DART_MINOR_VERSION <= y))))

/* urdfdom_headers Version number */
// We define the version numbers of urdfdom_headers here since it doesn't expose
// the version numbers itself in source level.
#define URDFDOM_HEADERS_MAJOR_VERSION @urdfdom_headers_VERSION_MAJOR@
#define URDFDOM_HEADERS_MINOR_VERSION @urdfdom_headers_VERSION_MINOR@
#define URDFDOM_HEADERS_PATCH_VERSION @urdfdom_headers_VERSION_PATCH@

#define URDFDOM_HEADERS_VERSION_AT_LEAST(x,y,z) \
(URDFDOM_HEADERS_MAJOR_VERSION > x || (URDFDOM_HEADERS_MAJOR_VERSION >= x && \
(URDFDOM_HEADERS_MINOR_VERSION > y || (URDFDOM_HEADERS_MINOR_VERSION >= y && \
URDFDOM_HEADERS_PATCH_VERSION >= z))))

// Detect the compiler
#if defined(__clang__)
#define DART_COMPILER_CLANG
Expand Down
5 changes: 3 additions & 2 deletions dart/utils/urdf/DartLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
#include "dart/dynamics/CylinderShape.h"
#include "dart/dynamics/MeshShape.h"
#include "dart/simulation/World.h"
#include "dart/utils/urdf/URDFTypes.h"
#include "dart/utils/urdf/urdf_world_parser.h"

using ModelInterfacePtr = boost::shared_ptr<urdf::ModelInterface>;

namespace dart {
namespace utils {

using ModelInterfacePtr = urdf_shared_ptr<urdf::ModelInterface>;

DartLoader::DartLoader()
: mLocalRetriever(new common::LocalResourceRetriever),
mPackageRetriever(new utils::PackageResourceRetriever(mLocalRetriever)),
Expand Down
58 changes: 58 additions & 0 deletions dart/utils/urdf/URDFTypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2016, Graphics Lab, Georgia Tech Research Corporation
* Copyright (c) 2016, Humanoid Lab, Georgia Tech Research Corporation
* Copyright (c) 2016, Personal Robotics Lab, Carnegie Mellon University
* All rights reserved.
*
* 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.
*/

#ifndef DART_UTILS_URDF_URDFTYPES_H_
#define DART_UTILS_URDF_URDFTYPES_H_

#include "dart/config.h"

#if URDFDOM_HEADERS_VERSION_AT_LEAST(1,0,0)
#include <memory>
#else
#include "boost/shared_ptr.hpp"
#include "boost/weak_ptr.hpp"
#endif

namespace dart {
namespace utils {

#if URDFDOM_HEADERS_VERSION_AT_LEAST(1,0,0)
template <class T> using urdf_shared_ptr = std::shared_ptr<T>;
template <class T> using urdf_weak_ptr = std::weak_ptr<T>;
#else
template <class T> using urdf_shared_ptr = boost::shared_ptr<T>;
template <class T> using urdf_weak_ptr = boost::weak_ptr<T>;
#endif

} // namespace utils
} // namespace dart

#endif // DART_UTILS_URDF_URDFTYPES_H_
7 changes: 6 additions & 1 deletion dart/utils/urdf/urdf_world_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
#include <urdf_model/model.h>
#include <urdf_model/pose.h>
#include <urdf_model/twist.h>
#include <urdf_world/world.h>

#include "dart/common/Uri.h"
#include "dart/common/ResourceRetriever.h"
#include "dart/utils/urdf/URDFTypes.h"

namespace dart {
namespace utils {
Expand All @@ -63,7 +68,7 @@ class Entity
/// Copy over a standard urdfEntity
Entity(const urdf::Entity& urdfEntity);

boost::shared_ptr<urdf::ModelInterface> model;
urdf_shared_ptr<urdf::ModelInterface> model;
urdf::Pose origin;
urdf::Twist twist;

Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
a Catkin workspace. Catkin is not required to build DART. For more
information, see: http://ros.org/reps/rep-0136.html -->
<name>dart</name>
<version>5.1.4</version>
<version>5.1.5</version>
<description>
DART (Dynamic Animation and Robotics Toolkit) is a collaborative,
cross-platform, open source library created by the Georgia Tech Graphics
Expand Down