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

Find packages for meshes / extras urdf #45

Merged
merged 3 commits into from
Jan 4, 2024
Merged

Find packages for meshes / extras urdf #45

merged 3 commits into from
Jan 4, 2024

Conversation

hilary-luo
Copy link
Contributor

@hilary-luo hilary-luo commented Jan 2, 2024

Non Breaking change - changes discussed in comments below

This adds the feature to allow users to link mesh files and urdf extra files using the package name and relative link (without breaking the option to give the absolute link only).

Example robot.yaml excerpts:

platform:
  extras:
    urdf_package: custom_package
    urdf: urdf/custom_urdf.urdf.xacro
links:
  mesh:
    - name: custom_component
      parent: default_mount
      xyz: [0.0, 0.0, 0.0]
      rpy: [0.0, 0.0, 0.0]
      package: custom_package
      visual: meshes/custom_mesh.STL

Example of the resulting urdf sections:

  <xacro:include filename="$(find clearpath_platform_description)/urdf/links/mesh.urdf.xacro"/>
  <xacro:mesh name="custom_component" parent_link="default_mount" visual="$(find custom_package)/meshes/custom_mesh.STL">
    <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
  </xacro:mesh>

  <!-- Extras -->

  <xacro:include filename="$(find custom_package)/urdf/custom_urdf.urdf.xacro"/>

Documentation to come

@hilary-luo hilary-luo requested a review from a team as a code owner January 2, 2024 23:02
@luis-camero
Copy link
Collaborator

I like this change, I was meaning to get around to doing this. The only thing is that for the Generic robot I have set it up such that it looks like this:

platform:
  description:
    package: irobot_create_description
    path: urdf/create3.urdf.xacro
  control:
    package: irobot_create_control
    path: config/control.yaml

Therefore, maybe we can have the following (keeping the urdf tag such that its easier to differentiate from the description tag):

platform:
  description:
    package: irobot_create_description
    path: urdf/create3.urdf.xacro
  control:
    package: irobot_create_control
    path: config/control.yaml
  extras:
    urdf:
      package: custom_package
      path: urdf/custom_urdf.urdf.xacro

And,

links:
  mesh:
    - name: custom_component
      parent: default_mount
      xyz: [0.0, 0.0, 0.0]
      rpy: [0.0, 0.0, 0.0]
      visual:
        package: custom_package
        path:  meshes/custom_mesh.STL

@hilary-luo
Copy link
Contributor Author

Updated to have the consistency discussed. Now requires clearpathrobotics/clearpath_common#53

@luis-camero
Copy link
Collaborator

LGTM

@hilary-luo hilary-luo merged commit 2f28331 into main Jan 4, 2024
5 checks passed
@hilary-luo hilary-luo deleted the find-package branch January 4, 2024 16:24
tonybaltovski pushed a commit that referenced this pull request Jan 23, 2024
* Allow meshes visual and extras urdf to be linked using find package functionality
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.

2 participants