Giter VIP home page Giter VIP logo

ros2_resource_publisher's Introduction

Resource Publisher

The primary purpose of this ros2 module is to publish your URDF and SRDF to a topic for use by Rviz2, gazebo, robot dynamics and other nodes.

Multiple URDF Variants

In some cases you may need to publish slightly different versions of a URDF file. I found this, for example, with Rviz2 and Gazebo requiring a few tweaks. It's easy to use xacro if(...) then...else to conditionally generate the differences but both versions must still be published. If you supply the targets argument then Resource Publisher will rerun xacro for each target and publish the variant with the target ID appended to the topic name.

Arguments

Argument parameter Description
--package <PKG_NAME> The package containing the document resource to publish
--xacro <FILE_NAME> The xacro file to substitute with parameters (found within the given package)
--topic <TOPIC_NAME> topic to publish on. Target name will also be appended if set.
--targets Comma-seperated list of targets. Each value will be passed to the xacro file as a "target" parameter and published on a new topic. Use * for target.

Example Launch Description

The following example publishes two variants of the lss_humanoid.xacro.urdf file. The first variant has the target xacro parameter unset (null) and published on the topic /robot_description. The second variant has the target parameter set to 'gazebo' and is published on the topic /robot_description/gazebo.

     urdf_publisher = Node(
        package='resource_publisher',
        executable='resource_publisher',
        output='screen',
        arguments=[
            '-package', 'lss_humanoid',
            '-xacro', 'urdf/lss_humanoid.xacro.urdf',
            '-topic', 'robot_description',
            '-targets', '*,gazebo']
    )

An example publishing the SRDF document, this time without xacro:

    srdf_publisher = Node(
        package='resource_publisher',
        executable='resource_publisher',
        output='screen',
        arguments=[
            '-package', 'lss_hexapod',
            '-xacro', 'urdf/lss_hexapod.srdf',
            '-topic', 'robot_description/srdf']
    )

Echo Published Documents

The documents will be published with latched QOS reliable reliability and transient_local durability which requires matching QOS parameters to retrieve the document with ros2 topic echo. The following example command will echo the full document:

ros2 topic echo --qos-reliability reliable --qos-durability transient_local --full-length /robot_description

ros2_resource_publisher's People

Contributors

guru-florida avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.