From 4f73b461fe5b42b16bce9cadcfd6daa6e0c2f916 Mon Sep 17 00:00:00 2001 From: Ioan Sucan Date: Mon, 20 May 2013 14:19:35 +0300 Subject: [PATCH] create base class for parsers --- collada_parser/package.xml | 2 + urdf/src/model.cpp | 3 + urdf_parser_plugin/CMakeLists.txt | 14 +++++ .../include/urdf_parser_plugin/parser.h | 57 +++++++++++++++++++ urdf_parser_plugin/package.xml | 21 +++++++ 5 files changed, 97 insertions(+) create mode 100644 urdf_parser_plugin/CMakeLists.txt create mode 100644 urdf_parser_plugin/include/urdf_parser_plugin/parser.h create mode 100644 urdf_parser_plugin/package.xml diff --git a/collada_parser/package.xml b/collada_parser/package.xml index b6c7b80..c72e073 100644 --- a/collada_parser/package.xml +++ b/collada_parser/package.xml @@ -22,10 +22,12 @@ collada-dom roscpp urdfdom_headers + urdf collada-dom roscpp urdfdom_headers + urdf diff --git a/urdf/src/model.cpp b/urdf/src/model.cpp index aee833f..eda704a 100644 --- a/urdf/src/model.cpp +++ b/urdf/src/model.cpp @@ -41,6 +41,9 @@ /* we include the default parser for plain URDF files; other parsers are loaded via plugins (if available) */ #include +#include +#include + #include #include diff --git a/urdf_parser_plugin/CMakeLists.txt b/urdf_parser_plugin/CMakeLists.txt new file mode 100644 index 0000000..d193fe6 --- /dev/null +++ b/urdf_parser_plugin/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 2.8.3) +project(urdf_parser_plugin) + +find_package(catkin REQUIRED urdfdom_headers) + +catkin_package( + INCLUDE_DIRS include + DEPENDS urdfdom_headers +) + +include_directories(include) + +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) diff --git a/urdf_parser_plugin/include/urdf_parser_plugin/parser.h b/urdf_parser_plugin/include/urdf_parser_plugin/parser.h new file mode 100644 index 0000000..dd04dbf --- /dev/null +++ b/urdf_parser_plugin/include/urdf_parser_plugin/parser.h @@ -0,0 +1,57 @@ +/********************************************************************* +* Software License Agreement (BSD License) +* +* Copyright (c) 2013, Willow Garage, Inc. +* All rights reserved. +* +* 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. +* * Neither the name of the Willow Garage nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* 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 OWNER 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. +*********************************************************************/ + +/* Author: Ioan Sucan */ + +#include + +namespace urdf +{ + +/** \brief Base class for URDF parsers */ +class URDFParser +{ +public: + URDFParser() + { + } + virtual ~URDFParser() + { + } + + /// \brief Load Model from string + virtual boost::shared_ptr parse(const std::string &xml_string) = 0; +}; + +} diff --git a/urdf_parser_plugin/package.xml b/urdf_parser_plugin/package.xml new file mode 100644 index 0000000..3fb5acc --- /dev/null +++ b/urdf_parser_plugin/package.xml @@ -0,0 +1,21 @@ + + urdf_parser_plugin + 1.10.9 + + This package contains a C++ base class for URDF parsers. + + + Ioan Sucan + Ioan Sucan + + BSD + + http://ros.org/wiki/urdf + https://github.com/ros/robot_model + https://github.com/ros/robot_model/issues + + catkin + urdfdom_headers + urdfdom_headers + +