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

[panda_eus] Skip generating dual_panda.l when franka_description or xacro is old to avoid build failure #1751

Merged
merged 2 commits into from
Dec 13, 2022
Merged
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
19 changes: 14 additions & 5 deletions jsk_panda_robot/panda_eus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@ catkin_package()
###
### dual_panda.l generation
###
if(franka_description_FOUND AND (NOT ("$ENV{ROS_DISTRO}" STRLESS "melodic")))
# xacro.load_yaml cannot be recognized under melodic, while it is recommended on melodic and upper.
# PR introducing xacro.load_yaml: https://github.com/ros/xacro/pull/283
# Related issue: https://github.com/ros/xacro/issues/298
set(_franka_description_min_ver "0.10.0")
set(_xacro_min_ver "1.13.14")
if(franka_description_FOUND
AND (NOT ("${franka_description_VERSION}" VERSION_LESS "${_franka_description_min_ver}"))
AND (NOT ("${xacro_VERSION}" VERSION_LESS "${_xacro_min_ver}")))
# Why franka_description >= 0.10.0:
# dual_panda.urdf.xacro assumes file structure of franka_description >= 0.10.0.
# See https://github.com/frankaemika/franka_ros/compare/0.9.1...0.10.0 for details.
# Why xacro >= 1.13.14:
# xacro.load_yaml cannot be recognized when xacro < 1.13.14, while it is recommended when xacro >= 1.13.14.
# PR introducing xacro.load_yaml: https://github.com/ros/xacro/pull/283
# Related issue: https://github.com/ros/xacro/issues/298
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/models/dual_panda.l
COMMAND rosrun euscollada collada2eus -I dual_panda.urdf -C dual_panda.yaml -O dual_panda.l
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/models
DEPENDS ${PROJECT_SOURCE_DIR}/models/dual_panda.urdf ${PROJECT_SOURCE_DIR}/models/dual_panda.yaml)

add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/models/dual_panda.urdf
COMMAND rosrun xacro xacro --inorder dual_panda.urdf.xacro > dual_panda.urdf
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/models
Expand All @@ -30,6 +37,8 @@ if(franka_description_FOUND AND (NOT ("$ENV{ROS_DISTRO}" STRLESS "melodic")))
add_custom_target(generate_panda_lisp ALL DEPENDS ${PROJECT_SOURCE_DIR}/models/dual_panda.l)
else()
message(WARNING "Dependency is not met, so skip generating dual_panda.l")
message(WARNING "franka_description version: ${franka_description_VERSION}, must be >= ${_franka_description_min_ver}")
message(WARNING "xacro version: ${xacro_VERSION}, must be >= ${_xacro_min_ver}")
endif()


Expand Down