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 TriggeredPublisher system #139

Merged
merged 25 commits into from
May 29, 2020
Merged

Conversation

azeey
Copy link
Contributor

@azeey azeey commented May 14, 2020

The triggered publisher system publishes a user specified message on an output topic in response to an input message that matches user specified criteria.

For example, if we want to send a msgs.Twist command to a topic in response to a msgs.Boolean input with a value of true, we'd use the following configuration

<plugin filename="libignition-gazebo-triggered_publisher-system.so" name="ignition::gazebo::systems::triggered_publisher">
  <input type="ignition.msgs.Boolean" topic="move">
    <match>
        data: "true"
    </match>
  </input>
  <output type="ignition.msgs.Twist" topic="/cmd_vel">
      linear: {x: 1.5}
  </output>
</plugin>

The system can be used to match the full input message, as shown in the previous example, or specific fields inside the message:

<plugin filename="libignition-gazebo-triggered_publisher-system.so" name="ignition::gazebo::systems::triggered_publisher">
  <input type="ignition.msgs.Vector2d" topic="/input_topic">
    <match field="x">1.0</match>
    <match field="y">2.0</match>
  </input>
  <output type="ignition.msgs.Empty" topic="/output_topic"/>
</plugin>

TODO:

  • Document usage with repeated fields
  • Document logic_type
  • Add tutorial

@azeey azeey requested a review from chapulina as a code owner May 14, 2020 15:43
@azeey azeey self-assigned this May 14, 2020
@chapulina chapulina added the 📜 blueprint Ignition Blueprint label May 14, 2020
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

There are some failing tests 😉

examples/worlds/triggered_publisher.sdf Show resolved Hide resolved
src/systems/triggered_publisher/TriggeredPublisher.cc Outdated Show resolved Hide resolved
src/systems/triggered_publisher/TriggeredPublisher.cc Outdated Show resolved Hide resolved
src/systems/triggered_publisher/TriggeredPublisher.hh Outdated Show resolved Hide resolved
test/integration/triggered_publisher.cc Outdated Show resolved Hide resolved
test/integration/triggered_publisher.cc Show resolved Hide resolved
test/integration/triggered_publisher.cc Show resolved Hide resolved
@azeey azeey requested review from iche033 and maryaB-osr as code owners May 20, 2020 00:49
@azeey
Copy link
Contributor Author

azeey commented May 20, 2020

I have refactored some of the code and added a new tol option to matchers. Mind taking another look @chapulina?

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

I did another pass. Some unrelated changes sneaked into the PR, and the example is not working for me.

Changelog.md Outdated Show resolved Hide resolved
examples/worlds/triggered_publisher.sdf Outdated Show resolved Hide resolved
include/ignition/gazebo/gui/GuiEvents.hh Outdated Show resolved Hide resolved
src/systems/triggered_publisher/TriggeredPublisher.cc Outdated Show resolved Hide resolved
tutorials.md.in Outdated Show resolved Hide resolved
tutorials/triggered_publisher.md Outdated Show resolved Hide resolved
tutorials/triggered_publisher.md Outdated Show resolved Hide resolved
tutorials/triggered_publisher.md Outdated Show resolved Hide resolved
tutorials/triggered_publisher.md Outdated Show resolved Hide resolved
tutorials/triggered_publisher.md Outdated Show resolved Hide resolved
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Works great! 👍

azeey and others added 16 commits May 28, 2020 16:01
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: John Shepherd <john@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
* Support multi entity spawn

Signed-off-by: Nate Koenig <nate@openrobotics.org>

* Added more documentation

Signed-off-by: Nate Koenig <nate@openrobotics.org>

Co-authored-by: Nate Koenig <nate@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
chapulina and others added 7 commits May 28, 2020 16:01
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Co-authored-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Co-authored-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey force-pushed the triggered_publisher branch from 22d8666 to f2fbb5e Compare May 28, 2020 21:03
azeey added 2 commits May 28, 2020 16:09
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey merged commit a36dafa into gazebosim:ign-gazebo2 May 29, 2020
@azeey azeey deleted the triggered_publisher branch May 29, 2020 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📜 blueprint Ignition Blueprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants