Skip to content

Commit

Permalink
Remove hack since fix is available now for all active distros
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Flynn <[email protected]>
  • Loading branch information
evan-flynn-apexai committed Sep 10, 2023
1 parent a327504 commit b464c73
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions reference_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,3 @@ rosidl_generate_interfaces(${PROJECT_NAME}
)

ament_auto_package()

# remove the below lines if fix to #143 is backported to older ROS distros
# fix rosidl_generator_py bug #143
# https://github.com/ros2/rosidl_python/issues/143
set(GENERATED_FILE "${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_py/${PROJECT_NAME}/msg/_transmission_stats.py")

set(DISTROS_WITH_FIX
"humble")
list(FIND DISTROS_WITH_FIX $ENV{ROS_DISTRO} DISTRO_ALREADY_FIXED)

if (${DISTRO_ALREADY_FIXED} MATCHES -1)
message(STATUS "checking generated file: ${GENERATED_FILE}")

set(DISTROS_WITH_RENAMED_TARGET "rolling")
list(FIND DISTROS_WITH_RENAMED_TARGET $ENV{ROS_DISTRO} TARGET_RENAMED)

if (${TARGET_RENAMED} MATCHES -1)
set(TARGET_NAME ${PROJECT_NAME}__python)
else()
set(TARGET_NAME ${PROJECT_NAME}__rosidl_generator_py)
endif()

add_custom_command(
TARGET ${TARGET_NAME}
POST_BUILD
COMMAND sed -i "s/all(val >= 0 and val) < 256/all(ord(val) >= 0 and ord(val) < 256/" ${GENERATED_FILE}
COMMENT "Check generated IDL files for extra parenthesis..."
VERBATIM)
endif()

0 comments on commit b464c73

Please sign in to comment.