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

[parsers] URDF and YAML generation from ParserResult #73

Merged
merged 1 commit into from
May 12, 2020
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
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