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

feat(xacro): building xacro from sensor calibation #274

Draft
wants to merge 12 commits into
base: beta/v0.29.0
Choose a base branch
from
25 changes: 25 additions & 0 deletions aip_xx1_description/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
cmake_minimum_required(VERSION 3.5)
project(aip_xx1_description)


find_package(ament_cmake_auto REQUIRED)

ament_auto_find_build_dependencies()

find_package(PythonInterp REQUIRED) # cspell: ignore Interp
# Specify the path to your Python script
set(PYTHON_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/compile_xacro.py")
set(PYTHON_TEMPLATE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/templates")
set(PYTHON_CALIBRATION_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/config")
set(PYTHON_XACRO_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/urdf")

# Run the Python script
execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_SCRIPT} ${PYTHON_TEMPLATE_DIRECTORY} ${PYTHON_CALIBRATION_DIRECTORY} ${PYTHON_XACRO_DIRECTORY} ${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error
)
# message(WARNING "Python script output: ${output}")

if(NOT result EQUAL 0)
message(FATAL_ERROR "Python script failed with error: ${error}")
else()
message(WARNING "Xacro Compiling Success")
endif()


ament_auto_package(INSTALL_TO_SHARE
urdf
config
Expand Down
1 change: 1 addition & 0 deletions aip_xx1_description/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<license>Apache 2</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>python3-jinja2</buildtool_depend>

<depend>velodyne_description</depend>

Expand Down
Loading
Loading