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

Add Tutorial on Using Transport Parameters with Systems #175

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Gaurang-1402
Copy link

@Gaurang-1402 Gaurang-1402 commented Apr 1, 2024

This pull request introduces a tutorial that resolves issue #1845, as opened by @scpeters on Dec 21, 2022. The tutorial is aimed at demonstrating the use of the newly added parameter interface feature in multiple repos including gz-transport, gz-msgs repo, and gz-sim repo.

The tutorial covers:

  • An overview on configuring the environment to run the tutorial.
  • Guidance on how to list, get, and set parameters using the ign param command-line tool, with expected outputs provided for clarity.

Key Highlights:

  • Build instructions for Ignition Fortress, emphasizing the new parameter interface.
  • Execution steps for the trisphere_cycle_wheel_slip.sdf demo to showcase parameters in action.
  • Detailed usage of ign param CLI for parameter interaction, illustrated with the systems.wheel_slip.trisphere_cycle1.wheel_front parameter as an example.

I would also like to point out some strange behavior I noticed when following the instructions on issue #1845. I was unable to see the params as indicated when I try to list all and see no parameters.

Screenshot from 2024-04-01 15-33-30

I confirmed that I could successfully run the trisphere_cycle_wheel_slip.sdf demo as seen below
tricycle

Screenshot from 2024-04-01 15-42-47

When I run play, it behaves as expected by sliding. Because I cannot list all, I cannot even get a specific parameter or even set a parameter as described which means I'm unable to reproduce the results mentioned in the PRs merged.

On the positive side, I was able to see the services as expected and mentioned by the contributor. They can be seen below:

Screenshot from 2024-04-01 15-39-06

I have verified that I have all the updated changes from the merged PRs (compare my branches to the branches where the merges occur for all repos):

  1. gz-msgs repo
    Screenshot from 2024-04-01 15-23-35

  2. gz-transport repo

Screenshot from 2024-04-01 15-23-18

  1. gz-sim repo
    Screenshot from 2024-04-01 15-22-56

This tells me that I have the correct repos when I build from source, so that is not the issue.

I'm puzzled by why I can't view the parameters. I can still use the CLI tool and services interface which gave me the confidence to go ahead and create this tutorial. Some clarification here would be helpful.

Details:
OS: Ubuntu 22.04 (Dual boot)
Gazebo version: Fortress built from Source following instructions found here

A special acknowledgment to Ivan Pauno for spearheading the development and integration of the parameters interface into Ignition Gazebo, which has been instrumental in the realization of this tutorial.

Feedback and further contributions to refine and expand this tutorial are warmly welcomed.

Signed-off-by: Gaurang Ruparelia <gr2159@nyu.edu>
Signed-off-by: Gaurang Ruparelia <gr2159@nyu.edu>
Signed-off-by: Gaurang Ruparelia <gr2159@nyu.edu>
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not using Ignition anymore, the simulator was renamed to just Gazebo.

@@ -0,0 +1,117 @@
# Getting started with the Parameter interface in Ignition Gazebo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Getting started with the Parameter interface in Ignition Gazebo
# Getting started with the Parameter interface in Gazebo


## Introduction

The parameter declaration and manipulation interface to Ignition Gazebo enables more dynamic and configurable simulations. This tutorial explores the motivations behind this feature, outlines the setup process, showcases an example, and demonstrates why this functionality is helpful for simulation applications.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The parameter declaration and manipulation interface to Ignition Gazebo enables more dynamic and configurable simulations. This tutorial explores the motivations behind this feature, outlines the setup process, showcases an example, and demonstrates why this functionality is helpful for simulation applications.
The parameter declaration and manipulation interface to Gazebo enables more dynamic and configurable simulations. This tutorial explores the motivations behind this feature, outlines the setup process, showcases an example, and demonstrates why this functionality is helpful for simulation applications.


1. **Dynamic Configuration**: Parameters allow for the dynamic configuration of simulation entities without the need to alter the source code or the need to rerun. This is essential for testing various scenarios under different settings.

2. **Consistency with ROS**: Many users of Ignition Gazebo come from a ROS (Robot Operating System) background, where parameter servers are a fundamental feature for storing and manipulating parameters at runtime. This addition makes Ignition Gazebo more intuitive for ROS users.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. **Consistency with ROS**: Many users of Ignition Gazebo come from a ROS (Robot Operating System) background, where parameter servers are a fundamental feature for storing and manipulating parameters at runtime. This addition makes Ignition Gazebo more intuitive for ROS users.
2. **Consistency with ROS**: Many users of Gazebo come from a ROS (Robot Operating System) background, where parameter servers are a fundamental feature for storing and manipulating parameters at runtime. This addition makes Gazebo more intuitive for ROS users.


#### Prerequisites

1. Ignition Gazebo built from source (Fortress version or newer)- instructions can be found [here](https://gazebosim.org/docs/fortress/install_ubuntu_src).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Ignition Gazebo built from source (Fortress version or newer)- instructions can be found [here](https://gazebosim.org/docs/fortress/install_ubuntu_src).
1. Gazebo built from source (Fortress version or newer) - instructions can be found [here](https://gazebosim.org/docs/fortress/install_ubuntu_src).

Comment on lines +22 to +25



#### Steps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### Steps
#### Steps


Expected Output:

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```bash


### Summary of Features

- Systems can declare parameters using the ignition::gazebo::DeclareParameter() helper function.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Systems can declare parameters using the ignition::gazebo::DeclareParameter() helper function.
- Systems can declare parameters using the gz::gazebo::DeclareParameter() helper function.

- ```/world/<world_name>/get_parameter service```: Get the type and value of a parameter.
- ```/world/<world_name>/set_parameter service```: Set a parameter: parameter name, value, and type need to be provided.
- Parameter types are protobuf messages.
- A ign param command line tool is added. A simple CLI tool to interact with parameters. Though interacting with parameters using ign service is possible, it's not as easy as parameter values are serialized.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- A ign param command line tool is added. A simple CLI tool to interact with parameters. Though interacting with parameters using ign service is possible, it's not as easy as parameter values are serialized.
- A `gz param` command line tool is added. A simple CLI tool to interact with parameters. Though interacting with parameters using `gz service` is possible, it's not as easy as parameter values are serialized.

Comment on lines +113 to +115


### Acknowledgments
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Acknowledgments
### Acknowledgments


### Acknowledgments

This feature was made possible by contributions from the community, particularly Ivan Pauno, who spearheaded the development and integration of the parameters interface into Ignition Gazebo. Details on this change can be found on the [gz-sim repo](https://github.com/gazebosim/gz-sim/pull/1431), [gz-msgs repo](https://github.com/gazebosim/gz-msgs/pull/241), and [gz-transport repo](https://github.com/gazebosim/gz-transport/pull/305).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This feature was made possible by contributions from the community, particularly Ivan Pauno, who spearheaded the development and integration of the parameters interface into Ignition Gazebo. Details on this change can be found on the [gz-sim repo](https://github.com/gazebosim/gz-sim/pull/1431), [gz-msgs repo](https://github.com/gazebosim/gz-msgs/pull/241), and [gz-transport repo](https://github.com/gazebosim/gz-transport/pull/305).
This feature was made possible by contributions from the community, particularly Ivan Pauno, who spearheaded the development and integration of the parameters interface into Gazebo. Details on this change can be found on the [gz-sim repo](https://github.com/gazebosim/gz-sim/pull/1431), [gz-msgs repo](https://github.com/gazebosim/gz-msgs/pull/241), and [gz-transport repo](https://github.com/gazebosim/gz-transport/pull/305).

@azeey
Copy link
Member

azeey commented Aug 2, 2024

I missed your ping about this PR. Thanks for the contribution!!

However, this repo is for Gazebo-classic and the tutorial refers to things in modern Gazebo. Would you be able to move it to https://github.com/gazebosim/gz-sim?

cc @scpeters

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.

Write a tutorial about using transport parameters with systems
3 participants