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

Open
wants to merge 28 commits into
base: beta/v0.29.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
95a0b4c
use template rendering for more flexible sensor configuration
Owen-Liuyuxuan Jul 30, 2024
eb474d9
fix temporary grammar
Owen-Liuyuxuan Jul 30, 2024
44d8c80
fix pre-commit
Owen-Liuyuxuan Jul 30, 2024
62c88f9
Merge branch 'beta/v0.29.0' into feat/build_xacro
Owen-Liuyuxuan Jul 30, 2024
80a68ef
ci(pre-commit): autofix
pre-commit-ci[bot] Jul 30, 2024
d46655d
fix pre-commit
Owen-Liuyuxuan Jul 30, 2024
7a96528
add python3-jinja2 dependency
Owen-Liuyuxuan Jul 30, 2024
629066e
add python3-fire dependency
Owen-Liuyuxuan Jul 30, 2024
356de99
ci(pre-commit): autofix
pre-commit-ci[bot] Jul 30, 2024
1b86e83
use argparse instead of fire for launch
Owen-Liuyuxuan Jul 30, 2024
2600a5f
ci(pre-commit): autofix
pre-commit-ci[bot] Jul 30, 2024
5e772bc
Merge branch 'beta/v0.29.0' into feat/build_xacro
Owen-Liuyuxuan Aug 28, 2024
bdd2539
Merge branch 'beta/v0.29.0' into feat/build_xacro
Owen-Liuyuxuan Dec 13, 2024
0712865
update explicit type support and force rebuild at every colcon build
Owen-Liuyuxuan Dec 13, 2024
fd602ab
aip launch fix for XX1
Owen-Liuyuxuan Dec 19, 2024
91cbf90
clean up
Owen-Liuyuxuan Dec 19, 2024
466b9d1
feat(aip_urdf_compiler): significantly improve documentation; add add…
Owen-Liuyuxuan Dec 20, 2024
dce8591
fix(xx1_des): add frame_id for certain sensors to restore the origina…
Owen-Liuyuxuan Dec 20, 2024
f852d8b
create a cmake macro to simplify adaptation of other packages
Owen-Liuyuxuan Dec 20, 2024
9eb7d91
xx1_des utilize the new macro
Owen-Liuyuxuan Dec 20, 2024
c3bda05
fixbug
Owen-Liuyuxuan Dec 20, 2024
289b220
fix debug
Owen-Liuyuxuan Dec 20, 2024
654fa6a
ci(pre-commit): autofix
pre-commit-ci[bot] Dec 20, 2024
72f01ec
add requirement on jinja2
Owen-Liuyuxuan Dec 20, 2024
54545a3
aip_xx1_gen2 example
Owen-Liuyuxuan Dec 19, 2024
ac0c101
fix(xx1_gen2_des): add frame_id for certain sensors to restore the or…
Owen-Liuyuxuan Dec 20, 2024
50a35aa
fix merge
Owen-Liuyuxuan Dec 20, 2024
4cce460
ci(pre-commit): autofix
pre-commit-ci[bot] Dec 20, 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