Skip to content

Add 'repetition' example using ForLoop action#18

Open
christophebedard wants to merge 1 commit intoMetroRobots:mainfrom
christophebedard:christophebedard/replace-recursion-with-for-loop-action
Open

Add 'repetition' example using ForLoop action#18
christophebedard wants to merge 1 commit intoMetroRobots:mainfrom
christophebedard:christophebedard/replace-recursion-with-for-loop-action

Conversation

@christophebedard
Copy link
Copy Markdown

This adds an example that is similar to the recursion example but using the new launch ForLoop action. See:

  1. Add ForEach action to repeat entities using iteration-specific values ros2/launch#802
  2. https://discourse.ros.org/t/requesting-feedback-new-for-loop-action-for-ros-2-launch-files-to-repeat-entities/42021/5

Note that I tried to find the ForLoop/ForEach API docs (based on the Python class docstring I made sure to add in the original PR), but it's not there: https://docs.ros.org/en/rolling/p/launch/launch.actions.html#submodules. That is obviously bad and I hope to improve that. However, in parallel, I'm trying to update examples I see out in the wild to use ForLoop/ForEach, e.g., in Nav2: ros-navigation/navigation2#4990 / ros-navigation/navigation2#5000.


Open questions:

  1. Should I replace the recursion example with this and call it repetition? From my understanding, the goal is repetition; recursion was the method.
  2. The current recursion example uses [N, 1], but ForLoop does [0, N) by default. Do you want me to use str(10 - i) to reverse it and get [N, 1]?

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
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.

1 participant