Skip to content

Commit

Permalink
[parsers] URDF and YAML generation from ParserResult
Browse files Browse the repository at this point in the history
The generated URDF/YAML models must be read with transformInertia = false becausethere is no way to recover the original rotation from the available data
  • Loading branch information
BenjaminNavarro committed May 4, 2020
1 parent 1b73e9c commit 113c4f6
Show file tree
Hide file tree
Showing 11 changed files with 1,461 additions and 3 deletions.
15 changes: 14 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,16 @@ 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 RBDyn::Parsers)
set_target_properties(urdf_yaml_converter PROPERTIES COMPILE_FLAGS "-DRBDYN_PARSERS_EXPORTS")

install(
TARGETS urdf_yaml_converter
EXPORT "${TARGETS_EXPORT_NAME}"
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 113c4f6

Please sign in to comment.