Skip to content

Allow public access to robot_description from the MoveItConfigsBuilder class #3582

Open

Description

@lukestroh

Is your feature request related to a problem? Please describe.

Using ros2 Humble.

I am trying to dynamically construct robots with various custom parts (i.e. different arms, end-effectors, etc.) using common names such as <robot_part>__base and <robot_part>__tool0 using a recursive Xacro loop:

<xacro:macro name="main_loop" params="stack_qty">
        <xacro:if value="${stack_qty}">
               <!-- call a robot part macro here -->

               <!-- call macro recursively -->
            <xacro:main_loop stack_qty="${stack_qty - 1}" />
</xacro:macro>

Passing mappings to the MoveItConfigsBuilder makes this really easy. I am subsequently trying to dynamically disable collisions in my SRDF. I have written a script that scrapes together adjacent joints from a URDF (with one or more joint jumps), but currently, I do not have access to the URDF string. I can get the string if I call mcb.to_moveit_configs(), but this method requires me to have passed it an SRDF file already.

Currently, I am passing it a fake file, running to_moveit_configs(), scraping the joint data, and then re-running mcb.robot_description_semantic(). However, this solution is decidedly inelegant:

    mcb = MoveItConfigsBuilder(robot_name="ag_robot", package_name="ag_robot_moveit_config")
    mcb.robot_description(
        file_path=os.path.join(get_package_share_directory("ag_robot_description"), "urdf/ag_robot.urdf.xacro"),
        mappings=xacro_mappings,
    )
    mcb.robot_description_semantic(
        file_path=os.path.join(get_package_share_directory("ag_robot_description"), "srdf/ag_robot.srdf"),
        # mappings=xacro_mappings,
    )
    moveit_configs = mcb.to_moveit_configs() # this is bad, find way to disable automatic srdf search? save srdf publicly?
    data = srdf_generator.parse_urdf_relationships(moveit_configs.robot_description['robot_description'])
    pairs = srdf_generator.collision_disable_pairs(data["adjacency"], max_distance=1)
    xacro_mappings.update(pairs)
    mcb.robot_description_semantic(
        file_path=os.path.join(get_package_share_directory("ag_robot_description"), "srdf/ag_robot.srdf.xacro"),
        mappings=xacro_mappings,
    )

Describe the solution you'd like

I want to have either one of two solutions:

  1. robot_description() saves a publicly accessible class attribute.
  2. to_moveit_configs() is able to run without requiring anything more than the robot_description. This seems harder to implement however, given that you call ParameterValue and Xacro from within the robot_description_semantic method.

Describe alternatives you've considered

Please see my inelegant solution above.

Additional context

No response

Activity

  1. added
    enhancement
    on Sep 25, 2025
  2. github-actions commented on Nov 18, 2025

    @github-actions

    This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions