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

Open
wants to merge 14 commits into
base: tier4/universe
Choose a base branch
from

Conversation

Owen-Liuyuxuan
Copy link
Contributor

@Owen-Liuyuxuan Owen-Liuyuxuan commented Dec 20, 2024

Updates (12/20)

Internal Document

Feature 1: Independent aip_urdf_compiler

This package contains the scripts, templates, tests, and cmake macro. Other packages only need to add

find_package(aip_urdf_compiler REQUIRED)
aip_cmake_urdf_compile()

in CMakeLists.txt to get the compilation done.

Feature 2: Optional frame ID annotation in config

  velodyne_right_base_link:
    x: 0.0
    y: -0.56362
    z: -0.30555
    roll: -0.01
    pitch: 0.71
    yaw: -1.580
    type: VLP-16.urdf
  gnss_link:
    x: -0.1
    y: 0.0
    z: -0.2
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
    type: imu
    frame_id: gnss  # optional frame_id, which will be the child frame name in urdf links that determine frame_id
  tamagawa/imu_link:
    x: 0.0
    y: 0.0
    z: 0.0
    roll: 3.14159265359
    pitch: 0.0
    yaw: 3.14159265359
    type: imu
    frame_id: tamagawa/imu # optional frame_id, which will be the child frame name in urdf links that determine frame_id

Original PR:
#274

Updates (12/13)

After accumulating experience in integration. Here is an updated/robust version that I would like to push forward.

Feature 1: Type Annotation in config

In the Xacro Compilation script, we defined URDF Links into the following types.

# Links mainly available from commen_sensor_description
class LinkType(enum.Enum):
    """Enum class for the type of the link."""

    CAMERA = "monocular_camera"
    IMU = "imu"
    LIVOX = "livox_horizon"
    PANDAR_40P = "pandar_40p"
    PANDAR_OT128 = "pandar_ot128"
    PANDAR_XT32 = "pandar_xt32"
    PANDAR_QT = "pandar_qt"
    PANDAR_QT128 = "pandar_qt128"
    VELODYNE16 = "VLP-16.urdf"
    VLS128 = "VLS-128.urdf"
    RADAR = "radar"
    JOINT_UNITS = "units" # units will be the base for other sensors on it, like a sensor kit

Then when sensor configurations are defined as

ars408_front_center:
    x: 3.8
    y: 0.0
    z: 0.5
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
    type: radar  # This needs to align with the string in LinkType
  sensor_kit_base_link:
    x: 0.9
    y: 0.0
    z: 2.0
    roll: -0.001
    pitch: 0.015
    yaw: -0.0364
    type: units # This needs to align with the string in LinkType
  livox_front_right_base_link:
    x: 3.290
    y: -0.65485
    z: 0.3216
    roll: 0.0
    pitch: 0.0
    yaw: -0.872664444
    type: livox_horizon # This needs to align with the string in LinkType

The compiler will reliably determine what kind of link each transform is.

Feature 2: Force Recompiling on Each Colcon Build

The former PR has the problem of needing to modify the CMakeLists.txt to trigger re-compilation. Now we improve the CMakeLists.txt so that we will create a brand-new urdf every time we rebuild, so that we can make tuning on the fly easily.

Description

Proposal of dynamically building xacro files during CMake from sensor calibration configs instead of hard-coding them in the repo.

#275

Methods

Using the jinja2 template mechanism, we can dynamically create as many joints as defined in the calibration Yaml file.

Tricky Problem

To determine the link types, we use the names of the links to infer the types, trying our best to be consistent with the common inputs and also readable. (determine_link_type)

Test

I have tried successfully launching PSim with the created xacro.

Owen-Liuyuxuan and others added 12 commits December 19, 2024 15:48
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
…itional script for comparing different xacro files for testing; add optional keywords for frame_id

Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
@Owen-Liuyuxuan
Copy link
Contributor Author

raw outputs from the xml_diff test script:

Analyse files for XX1 sensors

Key Differences

1. Include Files

Changes:

Added:

  • $(find radar_description)/urdf/radar.xacro
    Removed:
  • $(find aip_xx1_description)/urdf/radar.xacro

2. Sensor Configuration Changes

Lidars

Parameter Changes:

Modified parameters:

  • gpu: "false" → "$(arg gpu)"
  • topic: "velodyne_rear/velodyne_points" → "/points_raw"

Analyse files for XX1 sensor_kit

Key Differences

1. Include Files

Changes:

Added:

  • $(find livox_description)/urdf/livox_horizon.xacro
  • $(find radar_description)/urdf/radar.xacro
    Removed:
  • $(find velodyne_description)/urdf/HDL-32E.urdf.xacro

2. Sensor Configuration Changes

Cameras

Parameter Changes:

Lidars

Parameter Changes:

Imus

Parameter Changes:


Analyse files for XX1 Gen2 sensors

Key Differences

1. Include Files

2. Sensor Configuration Changes

Lidars

Parameter Changes:

Radars

Parameter Changes:


Analyse files for XX1 Gen2 sensor_kit

Key Differences

1. Include Files

Changes:

Added:

  • $(find radar_description)/urdf/radar.xacro
    Removed:
  • $(find velodyne_description)/urdf/VLP-16.urdf.xacro

2. Sensor Configuration Changes

Cameras

Parameter Changes:

Lidars

Parameter Changes:

Imus

Parameter Changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant