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 compilation #361

Merged
merged 21 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2723baa
aip launch fix for XX1
Owen-Liuyuxuan Dec 19, 2024
17eb547
aip_xx1_gen2 example
Owen-Liuyuxuan Dec 19, 2024
0b2d64f
clean up
Owen-Liuyuxuan Dec 19, 2024
5a9e75a
feat(aip_urdf_compiler): significantly improve documentation; add add…
Owen-Liuyuxuan Dec 20, 2024
596d5b0
fix(xx1_des): add frame_id for certain sensors to restore the origina…
Owen-Liuyuxuan Dec 20, 2024
c6095b6
fix(xx1_gen2_des): add frame_id for certain sensors to restore the or…
Owen-Liuyuxuan Dec 20, 2024
bc97d66
create a cmake macro to simplify adaptation of other packages
Owen-Liuyuxuan Dec 20, 2024
c2fd487
xx1_des utilize the new macro
Owen-Liuyuxuan Dec 20, 2024
8634e74
xx1_gen2 utilize the new macro
Owen-Liuyuxuan Dec 20, 2024
3f54a6f
fixbug
Owen-Liuyuxuan Dec 20, 2024
b54e73b
fix debug
Owen-Liuyuxuan Dec 20, 2024
51ad4bd
ci(pre-commit): autofix
pre-commit-ci[bot] Dec 20, 2024
0203f72
add requirement on jinja2
Owen-Liuyuxuan Dec 20, 2024
fa928b0
Merge branch 'feat/xacro_compilation' of https://github.com/tier4/aip…
Owen-Liuyuxuan Dec 20, 2024
877c9f5
add GNSS type; improve error handling; fix velodyne sensor names
Owen-Liuyuxuan Dec 23, 2024
ddbc8f7
added read me documentation, improve the warning and debugging outputs
Owen-Liuyuxuan Dec 23, 2024
ef0bff6
improve documentation
Owen-Liuyuxuan Dec 23, 2024
415326c
fix grammar
Owen-Liuyuxuan Dec 23, 2024
1c21d10
fix cspell
Owen-Liuyuxuan Dec 23, 2024
91ff326
unify the name in aip_urdf_compiler to be URDF compile
Owen-Liuyuxuan Dec 26, 2024
13bb21f
fix bug
Owen-Liuyuxuan Dec 26, 2024
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: 19 additions & 0 deletions aip_urdf_compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.5)
project(aip_urdf_compiler)

find_package(ament_cmake_auto REQUIRED)

ament_auto_find_build_dependencies()

# Install cmake directory
install(
DIRECTORY cmake templates scripts
DESTINATION share/${PROJECT_NAME}
)

# Export the package's share directory path

# Add the config extras
ament_package(
CONFIG_EXTRAS "cmake/aip_cmake_urdf_compile.cmake"
)
33 changes: 33 additions & 0 deletions aip_urdf_compiler/cmake/aip_cmake_urdf_compile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@



macro(aip_cmake_urdf_compile)
# Set the correct paths
find_package(PythonInterp REQUIRED) # cspell: ignore Interp
set(aip_urdf_compiler_BASE_DIR "${aip_urdf_compiler_DIR}/../")
set(PYTHON_SCRIPT "${aip_urdf_compiler_BASE_DIR}/scripts/compile_xacro.py")
set(PYTHON_TEMPLATE_DIRECTORY "${aip_urdf_compiler_BASE_DIR}/templates")
set(PYTHON_CALIBRATION_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/config")
set(PYTHON_XACRO_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/urdf")

message(STATUS "PYTHON_SCRIPT path: ${PYTHON_SCRIPT}")
message(STATUS "PYTHON_TEMPLATE_DIRECTORY path: ${PYTHON_TEMPLATE_DIRECTORY}")

# Verify that the required files exist
if(NOT EXISTS "${PYTHON_SCRIPT}")
message(FATAL_ERROR "Could not find compile_xacro.py at ${PYTHON_SCRIPT}")
endif()

# Create a custom command to run the Python script
add_custom_target(xacro_compilation ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/python_script_run_flag
)

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python_script_run_flag
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_SCRIPT} ${PYTHON_TEMPLATE_DIRECTORY} ${PYTHON_CALIBRATION_DIRECTORY} ${PYTHON_XACRO_DIRECTORY} ${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${PYTHON_SCRIPT}
COMMENT "Running Python script for URDF creation"
)
endmacro()
17 changes: 17 additions & 0 deletions aip_urdf_compiler/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<package format="2">
<name>aip_urdf_compiler</name>
<version>0.1.0</version>
<description>The aip_urdf_compiler package</description>

<maintainer email="[email protected]">Yukihiro Saito</maintainer>
<maintainer email="[email protected]">Yuxuan Liu</maintainer>
<license>Apache 2</license>

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

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Loading
Loading