Skip to content

Write a tutorial about using transport parameters with systems #1845

Open
osrf/gazebo_tutorials
#175
@scpeters

Description

@scpeters

Desired behavior

A new feature was added in gazebosim/gz-transport#305 to declare and use parameters. An interface to this functionality was added for gz-sim systems in #1431, with a demo in the parameters-component-wheel-slip-demo6 branch and gazebosim/gz-msgs@e19f8e5. This demo should be merged to a release branch along with a tutorial.

Alternatives considered

Implementation suggestion

Demo instructions from #305:

Steps to run the demo:

  • Build from source ignition fortress checking out the two branches specified above (I can provide PRs for another version if needed).
  • Launch the trisphere cycle world:
    ign gazebo trisphere_cycle_wheel_slip.sdf
    
  • In another terminal with the workspace sourced:
    • List available parameters:

      ign param -r /world/wheel_slip -l
      
      Expected output

      systems.wheel_slip.trisphere_cycle1.wheel_front [ignition.msgs.WheelSlipParameters]
      systems.wheel_slip.trisphere_cycle1.wheel_rear_right [ignition.msgs.WheelSlipParameters]
      systems.wheel_slip.trisphere_cycle0.wheel_rear_right [ignition.msgs.WheelSlipParameters]
      systems.wheel_slip.trisphere_cycle1.wheel_rear_left [ignition.msgs.WheelSlipParameters]
      systems.wheel_slip.trisphere_cycle0.wheel_rear_left [ignition.msgs.WheelSlipParameters]
      systems.wheel_slip.trisphere_cycle0.wheel_front [ignition.msgs.WheelSlipParameters]

    • Get the systems.wheel_slip.trisphere_cycle1.wheel_front parameter:

      ign param -r /world/wheel_slip -g -n systems.wheel_slip.trisphere_cycle1.wheel_front
      
      Expected output

      Getting parameter [systems.wheel_slip.trisphere_cycle1.wheel_front] for registry namespace [/world/wheel_slip]...
      Parameter type [ign_msgs.WheelSlipParameters]


      slip_compliance_lateral: 1
      slip_compliance_longitudinal: 1

    • Set the systems.wheel_slip.trisphere_cycle1.wheel_front parameter to a different value:

      ign param -r /world/wheel_slip -s -n systems.wheel_slip.trisphere_cycle1.wheel_front -t ign_msgs.WheelSlipParameters -m "
        slip_compliance_lateral: 1
        slip_compliance_longitudinal: 2"
      
      Expected output

      Setting parameter [systems.wheel_slip.trisphere_cycle1.wheel_front] for world [wheel_slip]...

      Parameter successfully set!

    • Get the systems.wheel_slip.trisphere_cycle1.wheel_front parameter again, its value should have changed:

      ign param -r /world/wheel_slip -g -n systems.wheel_slip.trisphere_cycle1.wheel_front
      
      Expected output

      Getting parameter [systems.wheel_slip.trisphere_cycle1.wheel_front] for registry namespace [/world/wheel_slip]...
      Parameter type [ign_msgs.WheelSlipParameters]


      slip_compliance_lateral: 1
      slip_compliance_longitudinal: 2

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions