export collada parser as plugin
This commit is contained in:
parent
65a0c5082f
commit
84b96c265f
|
@ -1,4 +1,4 @@
|
||||||
= 1.9.0 (Forthcoming) =
|
= 1.9.0 =
|
||||||
* Branch from 1.8.0
|
* Branch from 1.8.0
|
||||||
|
|
||||||
* [[collada_parser]]
|
* [[collada_parser]]
|
||||||
|
|
|
@ -3,7 +3,7 @@ project(collada_parser)
|
||||||
|
|
||||||
find_package(Boost REQUIRED system)
|
find_package(Boost REQUIRED system)
|
||||||
|
|
||||||
find_package(catkin REQUIRED COMPONENTS urdfdom_headers urdf_parser_plugin roscpp)
|
find_package(catkin REQUIRED COMPONENTS urdfdom_headers urdf_parser_plugin roscpp class_loader)
|
||||||
|
|
||||||
catkin_package(
|
catkin_package(
|
||||||
LIBRARIES ${PROJECT_NAME}
|
LIBRARIES ${PROJECT_NAME}
|
||||||
|
@ -31,12 +31,18 @@ if(HAVE_MKSTEMPS)
|
||||||
add_definitions("-DHAVE_MKSTEMPS")
|
add_definitions("-DHAVE_MKSTEMPS")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#common commands for building c++ executables and libraries
|
# build the parser lib
|
||||||
add_library(${PROJECT_NAME} src/collada_parser.cpp)
|
add_library(${PROJECT_NAME} src/collada_parser.cpp)
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
${COLLADA_DOM_LIBRARIES} ${Boost_LIBRARIES} ${catkin_LIBRARIES}
|
${COLLADA_DOM_LIBRARIES} ${Boost_LIBRARIES} ${catkin_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# build the plugin for the parser
|
||||||
|
add_library(${PROJECT_NAME}_plugin src/collada_parser_plugin.cpp)
|
||||||
|
target_link_libraries(${PROJECT_NAME}_plugin
|
||||||
|
${PROJECT_NAME} ${Boost_LIBRARIES} ${catkin_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
set_target_properties(${PROJECT_NAME}
|
set_target_properties(${PROJECT_NAME}
|
||||||
PROPERTIES COMPILER_FLAGS "${COLLADA_DOM_CFLAGS_OTHER}"
|
PROPERTIES COMPILER_FLAGS "${COLLADA_DOM_CFLAGS_OTHER}"
|
||||||
)
|
)
|
||||||
|
@ -51,8 +57,11 @@ else()
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS ${PROJECT_NAME}
|
install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_plugin
|
||||||
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
|
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
|
||||||
|
|
||||||
install(DIRECTORY include/${PROJECT_NAME}/
|
install(DIRECTORY include/${PROJECT_NAME}/
|
||||||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
|
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
|
||||||
|
|
||||||
|
install(FILES collada_parser_plugin_description.xml
|
||||||
|
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<library path="lib/libcollada_parser_plugin">
|
||||||
|
<class name="urdf/ColladaURDFParser" type="urdf::ColladaURDFParser" base_class_type="urdf::URDFParser">
|
||||||
|
<description>
|
||||||
|
Parse models as URDF from Collada files.
|
||||||
|
</description>
|
||||||
|
</class>
|
||||||
|
</library>
|
|
@ -0,0 +1,54 @@
|
||||||
|
/*********************************************************************
|
||||||
|
* 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 */
|
||||||
|
|
||||||
|
#ifndef COLLADA_PARSER_COLLADA_PARSER_PLUGIN_H
|
||||||
|
#define COLLADA_PARSER_COLLADA_PARSER_PLUGIN_H
|
||||||
|
|
||||||
|
#include <urdf_parser_plugin/parser.h>
|
||||||
|
|
||||||
|
namespace urdf
|
||||||
|
{
|
||||||
|
|
||||||
|
class ColladaURDFParser : public URDFParser
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual boost::shared_ptr<ModelInterface> parse(const std::string &xml_string);
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -23,11 +23,13 @@
|
||||||
<build_depend>roscpp</build_depend>
|
<build_depend>roscpp</build_depend>
|
||||||
<build_depend>urdfdom_headers</build_depend>
|
<build_depend>urdfdom_headers</build_depend>
|
||||||
<build_depend>urdf_parser_plugin</build_depend>
|
<build_depend>urdf_parser_plugin</build_depend>
|
||||||
|
<build_depend>class_loader</build_depend>
|
||||||
|
|
||||||
<run_depend>collada-dom</run_depend>
|
<run_depend>collada-dom</run_depend>
|
||||||
<run_depend>roscpp</run_depend>
|
<run_depend>roscpp</run_depend>
|
||||||
<run_depend>urdfdom_headers</run_depend>
|
<run_depend>urdfdom_headers</run_depend>
|
||||||
<run_depend>urdf_parser_plugin</run_depend>
|
<run_depend>urdf_parser_plugin</run_depend>
|
||||||
|
<run_depend>class_loader</run_depend>
|
||||||
|
|
||||||
</package>
|
</package>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
/*********************************************************************
|
||||||
|
* 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 "collada_parser/collada_parser_plugin.h"
|
||||||
|
#include "collada_parser/collada_parser.h"
|
||||||
|
#include <class_loader/class_loader.h>
|
||||||
|
|
||||||
|
boost::shared_ptr<urdf::ModelInterface> urdf::ColladaURDFParser::parse(const std::string &xml_string)
|
||||||
|
{
|
||||||
|
return urdf::parseCollada(xml_string);
|
||||||
|
}
|
||||||
|
|
||||||
|
CLASS_LOADER_REGISTER_CLASS(urdf::ColladaURDFParser, urdf::URDFParser)
|
|
@ -38,7 +38,7 @@
|
||||||
<run_depend>ros_comm</run_depend>
|
<run_depend>ros_comm</run_depend>
|
||||||
<run_depend>rosconsole_bridge</run_depend>
|
<run_depend>rosconsole_bridge</run_depend>
|
||||||
<run_depend>urdf</run_depend>
|
<run_depend>urdf</run_depend>
|
||||||
<run_depend>urdf_parser</run_depend>
|
<run_depend>urdf_parser_plugin</run_depend>
|
||||||
<run_depend>urdfdom</run_depend>
|
<run_depend>urdfdom</run_depend>
|
||||||
<run_depend>urdfdom_headers</run_depend>
|
<run_depend>urdfdom_headers</run_depend>
|
||||||
<run_depend>joint_state_publisher</run_depend>
|
<run_depend>joint_state_publisher</run_depend>
|
||||||
|
|
|
@ -34,6 +34,9 @@
|
||||||
|
|
||||||
/* Author: Ioan Sucan */
|
/* Author: Ioan Sucan */
|
||||||
|
|
||||||
|
#ifndef URDF_PARSER_PLUGIN_H
|
||||||
|
#define URDF_PARSER_PLUGIN_H
|
||||||
|
|
||||||
#include <urdf_model/model.h>
|
#include <urdf_model/model.h>
|
||||||
|
|
||||||
namespace urdf
|
namespace urdf
|
||||||
|
@ -55,3 +58,5 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue