Skip to content

Commit

Permalink
Merge pull request #73 from BenjaminNavarro/desc_gen
Browse files Browse the repository at this point in the history
[parsers] URDF and YAML generation from ParserResult
  • Loading branch information
gergondet authored May 12, 2020
2 parents 1b73e9c + 1d77f40 commit 5404765
Show file tree
Hide file tree
Showing 13 changed files with 1,566 additions and 494 deletions.
14 changes: 13 additions & 1 deletion src/parsers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ endif()
# CMake <= 3.5.0 needs at least one component to define Boost::boost
add_project_dependency(Boost REQUIRED COMPONENTS system)

set(SOURCES common.cpp urdf.cpp yaml.cpp)
set(SOURCES common.cpp urdf.cpp to_urdf.cpp yaml.cpp to_yaml.cpp)
set(HEADERS RBDyn/parsers/api.h RBDyn/parsers/common.h RBDyn/parsers/urdf.h RBDyn/parsers/yaml.h)

add_library(RBDynParsers SHARED ${SOURCES} ${HEADERS})
Expand All @@ -39,3 +39,15 @@ install(
RUNTIME DESTINATION "bin"
)
install(FILES ${HEADERS} DESTINATION ${INCLUDE_INSTALL_DESTINATION}/parsers)


add_executable(urdf_yaml_converter urdf_yaml_conv.cpp)
target_link_libraries(urdf_yaml_converter PUBLIC RBDyn::Parsers)
set_target_properties(urdf_yaml_converter PROPERTIES COMPILE_FLAGS "-DRBDYN_PARSERS_DLLIMPORT")

install(
TARGETS urdf_yaml_converter
LIBRARY DESTINATION "lib"
ARCHIVE DESTINATION "lib"
RUNTIME DESTINATION "bin"
)
2 changes: 2 additions & 0 deletions src/parsers/RBDyn/parsers/urdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ RBDYN_PARSERS_DLLAPI ParserResult from_urdf_file(const std::string & file_path,
bool withVirtualLinks = true,
const std::string & sphericalSuffix = "_spherical");

RBDYN_PARSERS_DLLAPI std::string to_urdf(const ParserResult & res);

} // namespace parsers

} // namespace rbd
2 changes: 2 additions & 0 deletions src/parsers/RBDyn/parsers/yaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ RBDYN_PARSERS_DLLAPI ParserResult from_yaml_file(const std::string & file_path,
bool withVirtualLinks = true,
const std::string & sphericalSuffix = "_spherical");

RBDYN_PARSERS_DLLAPI std::string to_yaml(const ParserResult & res);

} // namespace parsers

} // namespace rbd
Loading

0 comments on commit 5404765

Please sign in to comment.