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

Conversation

Owen-Liuyuxuan
Copy link
Contributor

@Owen-Liuyuxuan Owen-Liuyuxuan commented Jul 30, 2024

Updates (12/20)

Merge with #361

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.

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

Up to this commit; the PR can work fine on XX1 PSim

@Owen-Liuyuxuan Owen-Liuyuxuan marked this pull request as ready for review December 13, 2024 09:19
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]>
pre-commit-ci bot and others added 6 commits December 20, 2024 14:01
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
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