-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
New tutorial for ROS 2 launch files #353
Conversation
Signed-off-by: maryaB-osr <[email protected]>
Signed-off-by: maryaB-osr <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass done!
|
||
Note the only difference between the two nodes is their ``node_namespace`` values. | ||
Unique namespaces allow the system to start two simulators without having name conflicts. | ||
Without unique namespaces, the nodes would clash when trying to publish on the same topic with the same name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maryaB-osr thinking this over, instead of talking about clashes we could state that there'd be no way to address each turtle separately i.e. both receive commands over the same topic, both publish pose over the same topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hidmic So I changed the last line to this:
Both turtles in this system receive commands over the same topic and publish their pose over the same topic.
Without unique namespaces, there would be no way to distinguish between messages meant for one turtle or the other.
But now I think it's repetitive because it just seems like a long way of say of saying the previous sentence:
Unique namespaces allow the system to start two simulators without node name nor topic name conflicts.
Thoughts?
package='turtlesim', node_executable='mimic', node_name='mimic', | ||
remappings=[ | ||
('/input/pose', '/turtlesim1/turtle1/pose'), | ||
('/output/cmd_vel', '/turtlesim2/turtle1/cmd_vel'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sloretz @wjwwood this is something I wanted to talk to you about.
The original roslaunch XML file would remap parent namespaces as in /input:=/turtlesim1
but that doesn't seem to work on Dashing nor Eloquent. Globbing as in /input/**:=/turtlesim1/\1
didn't work either. That's why I had to be super specific. Is that expected behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if/when this should be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original roslaunch XML file would remap parent namespaces as in
/input:=/turtlesim1
but that doesn't seem to work on Dashing nor Eloquent.
Can you link that? Maybe it's a use case we overlooked, but I think our remapping in ROS 2 has to be an exact match normally (no partial matches) on a topic/service/etc... name (namespaces are not remapped as far as I know).
Globbing as in
/input/**:=/turtlesim1/\1
didn't work either. That's why I had to be super specific. Is that expected behavior?
I think that should have worked, @sloretz?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, missed this.
The original roslaunch XML file would remap parent namespaces as in /input:=/turtlesim1 but that doesn't seem to work on Dashing nor Eloquent.
[...] I think our remapping in ROS 2 has to be an exact match normally (no partial matches) on a topic/service/etc... name (namespaces are not remapped as far as I know).
Yeah, it has to be an exact match. That case is supposed to be covered by **
, but ...
Globbing as in /input/**:=/turtlesim1/\1 didn't work either. That's why I had to be super specific. Is that expected behavior?
I think that should have worked, @sloretz?
**
*
, and \1
- \9
were never implemented: ros2/rcl#233 ros2/rcl#232
|
||
Let’s put together a ROS 2 launch file using the ``turtlesim`` package and its executables. | ||
|
||
At the top of your new ``turtlesim_mimic_launch.py`` file, add the lines: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the first PR I'm reviewing with actual code, instead of just commands. So I don't know what we want our convention for code examples to be. But I think that people will appreciate all of the code up-front so that they can cut-n-paste the entire example. The text that follows can then break down individual sections of code, explaining what they do. See https://clalancette.github.io/pycdlib/example-creating-new-basic-iso.html where I for an example where put this idea into practice.
Also, line numbers in the code block are useful so you can refer to specific lines of code from the text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code up-front: ✔
line numbers: for some reason the linter's not been accepting the :linenos:
directive for code-block
. I'll try again though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D000 Error in "code-block" directive: unknown option: "linenos".
For some reason it works in the next tutorial when its nested under .. tabs:: > .. group-tab:: > .. code-block::
though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, make sure you're using spaces and not tabs and that you're using the right number of indented spaces?
Maybe you need to indent the following Python code a second time:
The other place you use :linenos:
is like that:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you need to indent the following Python code a second time:
The other place you use :linenos: is like that:
But both of those lines are throwing errors, extra indentation or not.
I tried adjusting the spaces before :linenos:
(in the sphinx docs it seems like 3 spaces?) but now the linter complaints are even more bizarre
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think D000 warnings can come up for a few different things, right? If we suppress those for all the tutorials, won't it be possible that some actual errors will get through? Because I need line numbers on a handful, not just this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I don't know what we should do, but I was just pointing out that they've been ignored in the past. Sorry I don't have time right now to investigate the technical reason for the warning right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjwwood That's fine, it's not necessary right now. Thanks for your input so far!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, I'd added exceptions to the CI script for the tutorials under Tutorials/Actions as they make heavy use of :linenos:
.
It's not the best solution, but I think it's okay if you want to add another exception for this specific tutorial file (not necessarily all of the tutorials).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maryaB-osr I think the follow change to the .travis.yml file should do it:
- - doc8 --ignore D001 --ignore-path build --ignore-path source/Tutorials/Actions
- # ignore D000 in action tutorials to allow for :linenos:
- - doc8 --ignore D000 --ignore D001 --ignore-path build source/Tutorials/Actions
+ - doc8 --ignore D001 --ignore-path build --ignore-path source/Tutorials/Actions --ignore-path source/Tutorials/LaunchFiles/CreatingLaunchFiles.rst
+ # ignore D000 in files that use :linenos:
+ - doc8 --ignore D000 --ignore D001 --ignore-path build source/Tutorials/Actions source/Tutorials/LaunchFiles/CreatingLaunchFiles.rst
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple more nits that I noticed.
Signed-off-by: maryaB-osr <[email protected]>
…into tutorial9 Signed-off-by: maryaB-osr <[email protected]>
Co-Authored-By: Chris Lalancette <[email protected]>
Co-Authored-By: Michel Hidalgo <[email protected]>
Co-Authored-By: Michel Hidalgo <[email protected]>
Signed-off-by: maryaB-osr <[email protected]>
Signed-off-by: maryaB-osr <[email protected]>
Signed-off-by: maryaB-osr <[email protected]>
Signed-off-by: maryaB-osr <[email protected]>
Signed-off-by: maryaB-osr <[email protected]>
Signed-off-by: maryaB-osr <[email protected]>
Signed-off-by: maryaB-osr <[email protected]>
Signed-off-by: maryaB-osr <[email protected]>
Signed-off-by: maryaB-osr <[email protected]>
def generate_launch_description(): | ||
return LaunchDescription([ | ||
Node( | ||
package='turtlesim', | ||
node_namespace='turtlesim1', | ||
node_executable='turtlesim_node', | ||
node_name='sim' | ||
), | ||
Node( | ||
package='turtlesim', | ||
node_namespace='turtlesim2', | ||
node_executable='turtlesim_node', | ||
node_name='sim' | ||
), | ||
Node( | ||
package='turtlesim', | ||
node_executable='mimic', | ||
node_name='mimic', | ||
remappings=[ | ||
('/input/pose', '/turtlesim1/turtle1/pose'), | ||
('/output/cmd_vel', '/turtlesim2/turtle1/cmd_vel'), | ||
] | ||
) | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For those who cut-n-paste this block of code, the extra indentation needs to be removed. Causes python interpreter to complain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackpien can you try it now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks for quick fix.
Signed-off-by: maryaB-osr <[email protected]>
Is there a design page, or specification page for launch files in general? Can we link a statement that says "if you want to learn about other launch options, configurations, go to http://xxx" to that spec page? |
@jackpien I'm going to merge this now, and hopefully have everything live by the end of the day, but will definitely find out and add it to the |
* Environment config tutorial (#334) * Environment config tutorial Signed-off-by: maryaB-osr <[email protected]> * Added pages to some empty links for CI check Signed-off-by: maryaB-osr <[email protected]> * Add requirements.txt and app.json for Heroku build (#336) This enables heroku "review apps" Signed-off-by: Michael Carroll <[email protected]> * Addressed reviews and implemented tabs Signed-off-by: maryaB-osr <[email protected]> * Added tabs install instructions for travis Signed-off-by: maryaB-osr <[email protected]> * Fixed Travis warnings Signed-off-by: maryaB-osr <[email protected]> * Prereqs note about using debs. for linux Signed-off-by: maryaB-osr <[email protected]> * Added reference for linking Signed-off-by: maryaB-osr <[email protected]> * Update Goal statement Co-Authored-By: Jacob Perron <[email protected]> * Remove leading arrowhead from Windows command Co-Authored-By: Jacob Perron <[email protected]> * Empty line before .. todo: Co-Authored-By: Jacob Perron <[email protected]> * "value" to "integer" for ROS_DOMAIN_ID Co-Authored-By: Jacob Perron <[email protected]> * Added ROS_DOMAIN_ID explanation Signed-off-by: maryaB-osr <[email protected]> * Link to ROS Answers Also left a note to test Windows domain ID command Signed-off-by: maryaB-osr <[email protected]> * Syntax error on ROS answers link Signed-off-by: maryaB-osr <[email protected]> * Changed domainID tabs to include script command Signed-off-by: maryaB-osr <[email protected]> * Fixed too much indentation Signed-off-by: maryaB-osr <[email protected]> * Update Windows ROS_DOMAIN_ID config section (#341) * Update Windows ROS_DOMAIN_ID config section Signed-off-by: Jacob Perron <[email protected]> * Update source/Tutorials/ConfiguringROS2Environment.rst Co-Authored-By: Chris Lalancette <[email protected]> * New tutorial for introducing turtlesim for ROS 2 (#342) * New tutorial for introducing turtlesim for ROS 2 Signed-off-by: maryaB-osr <[email protected]> * Trying one image Signed-off-by: maryaB-osr <[email protected]> * New file not included in toctree Signed-off-by: maryaB-osr <[email protected]> * All images and fix toctree (?) Signed-off-by: maryaB-osr <[email protected]> * More concise goal statement Co-Authored-By: Chris Lalancette <[email protected]> * Update Windows ROS_DOMAIN_ID config section (#341) * Update Windows ROS_DOMAIN_ID config section Signed-off-by: Jacob Perron <[email protected]> * Update source/Tutorials/ConfiguringROS2Environment.rst Co-Authored-By: Chris Lalancette <[email protected]> * Removed ros2 run explanation (for next tutorial) Signed-off-by: maryaB-osr <[email protected]> * "turtled" to "turtle" Co-Authored-By: Chris Lalancette <[email protected]> * clalancette's requested changes Signed-off-by: maryaB-osr <[email protected]> * dirk-thomas's requested changes Signed-off-by: maryaB-osr <[email protected]> * forgot to remove "2" from file name Signed-off-by: maryaB-osr <[email protected]> * fixed backticks and added sentence about pen Signed-off-by: maryaB-osr <[email protected]> * corrections from dirk-thomas Signed-off-by: maryaB-osr <[email protected]> * New tutorial on ROS 2 topics (#344) * New tutorial on ROS 2 topics Signed-off-by: maryaB-osr <[email protected]> * removed random ? Signed-off-by: maryaB-osr <[email protected]> * comment out empty reference Signed-off-by: maryaB-osr <[email protected]> * remove "on" Co-Authored-By: Chris Lalancette <[email protected]> * clarify topics definition Co-Authored-By: Chris Lalancette <[email protected]> * "process" > "topic" Co-Authored-By: Chris Lalancette <[email protected]> * reword "command line introspection" Co-Authored-By: William Woodall <[email protected]> * properly name topics and nodes Co-Authored-By: William Woodall <[email protected]> * clarify not all robots need a data stream Co-Authored-By: William Woodall <[email protected]> * typo "you" > "your" Co-Authored-By: William Woodall <[email protected]> * address comments on definition of topics Signed-off-by: maryaB-osr <[email protected]> * Rearrange background info Signed-off-by: maryaB-osr <[email protected]> * typo Co-Authored-By: Chris Lalancette <[email protected]> * minor edits Signed-off-by: maryaB-osr <[email protected]> * New tutorial on ROS 2 services (#346) * New tutorial on ROS 2 services Signed-off-by: maryaB-osr <[email protected]> * adding links on turtlesim, config, topics Signed-off-by: maryaB-osr <[email protected]> * removed cluttered parameter services Signed-off-by: maryaB-osr <[email protected]> * YAML syntax only on cmd line Co-Authored-By: Chris Lalancette <[email protected]> * specified synchronous services will wait Signed-off-by: maryaB-osr <[email protected]> * single quotes inside double quotes Co-Authored-By: Scott K Logan <[email protected]> * addressed cottsay's reviews Signed-off-by: maryaB-osr <[email protected]> * more intuitive topics/services description Signed-off-by: maryaB-osr <[email protected]> * more concise wording Co-Authored-By: Chris Lalancette <[email protected]> * missing comma Co-Authored-By: Chris Lalancette <[email protected]> * typo Signed-off-by: maryaB-osr <[email protected]> * New tutorial for ROS 2 parameters (#347) * New tutorial for ROS 2 parameters Signed-off-by: maryaB-osr <[email protected]> * Forgot toctree and goal statement Signed-off-by: maryaB-osr <[email protected]> * italics > bold Signed-off-by: maryaB-osr <[email protected]> * small edits based on reviews Signed-off-by: maryaB-osr <[email protected]> * Change the main README to say to use pip for sphinx and required sphinx-tab installation. (#363) Add sphinx and sphinx-tab into requirements.txt Clarify to use pip3 so people implicitly know that python3 is required Further clarify sphinx requirements * New tutorial for ROS 2 nodes (#343) * New tutorial for ROS 2 nodes Signed-off-by: maryaB-osr <[email protected]> * commented out empty reference (for now) Also added link target to concept overview page Signed-off-by: maryaB-osr <[email protected]> * removed pic link, added code blocks Signed-off-by: maryaB-osr <[email protected]> * "Hopefully" sounds silly Co-Authored-By: Chris Lalancette <[email protected]> * "multiple nodes" to "one or more" Co-Authored-By: Chris Lalancette <[email protected]> * added node info with actions Signed-off-by: maryaB-osr <[email protected]> * added links for prereqs and next steps Signed-off-by: maryaB-osr <[email protected]> * fixed node def & added design doc link Signed-off-by: maryaB-osr <[email protected]> * New tutorial for ROS 2 actions (#350) * New tutorial for ROS 2 actions Signed-off-by: maryaB-osr <[email protected]> * travis warning Signed-off-by: maryaB-osr <[email protected]> * explicitly describe action goal process Co-Authored-By: Jacob Perron <[email protected]> * correct services definition Co-Authored-By: Jacob Perron <[email protected]> * correct implemenation details Co-Authored-By: Jacob Perron <[email protected]> * cancel > preempt Co-Authored-By: Jacob Perron <[email protected]> * minor updates Signed-off-by: maryaB-osr <[email protected]> * jacobperron's review Signed-off-by: maryaB-osr <[email protected]> * Changed `action show` to `interface show` Signed-off-by: maryaB-osr <[email protected]> * updated hidden actions in node info & removed bash Signed-off-by: maryaB-osr <[email protected]> * New tutorial for ROS 2 rqt_console (#351) * New tutorial for ROS 2 rqt_console Signed-off-by: maryaB-osr <[email protected]> * missing spaces in topic pub yaml Co-Authored-By: Michel Hidalgo <[email protected]> * change tense Co-Authored-By: Michel Hidalgo <[email protected]> * first > top Co-Authored-By: Chris Lalancette <[email protected]> * specify new terminal Co-Authored-By: Chris Lalancette <[email protected]> * change file names and add links to prereqs Signed-off-by: maryaB-osr <[email protected]> * minor changes from reviews Signed-off-by: maryaB-osr <[email protected]> * addressed reviews Signed-off-by: maryaB-osr <[email protected]> * typo + updated remapping syntax Signed-off-by: maryaB-osr <[email protected]> * Updated remapping syntax (#354) * Updated remapping syntax Signed-off-by: maryaB-osr <[email protected]> * tabs for eloquent/dashing remap syntax Signed-off-by: maryaB-osr <[email protected]> * New tutorial for ROS 2 bag files (#355) * New tutorial for ROS 2 bag files Signed-off-by: maryaB-osr <[email protected]> * trying to make alt-text for internal links work Signed-off-by: maryaB-osr <[email protected]> * added available links Signed-off-by: maryaB-osr <[email protected]> * addressed reviews Signed-off-by: maryaB-osr <[email protected]> * New tutorial for creating a workspace (#359) * New tutorial for creating a workspace Signed-off-by: maryaB-osr <[email protected]> * typo Signed-off-by: maryaB-osr <[email protected]> * typo Co-Authored-By: Chris Lalancette <[email protected]> * addressed reviews (dirk-thomas & clalancette) Signed-off-by: maryaB-osr <[email protected]> * revert source paths until PR 380 merges Signed-off-by: maryaB-osr <[email protected]> * underlay != main installation Co-Authored-By: Tully Foote <[email protected]> * main source not mandatory Co-Authored-By: Tully Foote <[email protected]> * underlay != main installation (again) Co-Authored-By: Tully Foote <[email protected]> * tfoote and clalancette suggestions Signed-off-by: maryaB-osr <[email protected]> * trailing whitespace Signed-off-by: maryaB-osr <[email protected]> * New tutorial for creating a package in ROS 2 (#362) * New tutorial for creating a package in ROS 2 Signed-off-by: maryaB-osr <[email protected]> * addressed review from ivanpauno & sloretz Signed-off-by: maryaB-osr <[email protected]> * ivan's final review Signed-off-by: maryaB-osr <[email protected]> * New tutorial for ros2doctor (#378) * New tutorial for ros2doctor Signed-off-by: maryaB-osr <[email protected]> * linter Signed-off-by: maryaB-osr <[email protected]> * claireyywang's review Signed-off-by: maryaB-osr <[email protected]> * New tutorial for service and client using C++ (#370) * new tutorial for service and client using C++ Signed-off-by: maryaB-osr <[email protected]> * linter fix Signed-off-by: maryaB-osr <[email protected]> * linter Signed-off-by: maryaB-osr <[email protected]> * forgot package name in pkg create Signed-off-by: maryaB-osr <[email protected]> * improve sentence structure Co-Authored-By: Michel Hidalgo <[email protected]> * minor changes Signed-off-by: maryaB-osr <[email protected]> * target > targets * Update parameters tutorial (#384) * Update parameters tutorial Signed-off-by: maryaB-osr <[email protected]> * linter Signed-off-by: maryaB-osr <[email protected]> * New tutorial for Python pub/sub (#364) * New tutorial for Python pub/sub Signed-off-by: maryaB-osr <[email protected]> * fix linter issue Signed-off-by: maryaB-osr <[email protected]> * removed mentions of line numbers, plus other reviews Signed-off-by: maryaB-osr <[email protected]> * removed comments from long code blocks Signed-off-by: maryaB-osr <[email protected]> * removed parenthesis from file names Signed-off-by: maryaB-osr <[email protected]> * final nits Signed-off-by: maryaB-osr <[email protected]> * macOS users already have dependencies installed Signed-off-by: maryaB-osr <[email protected]> * Consistent indentation in code blocks Signed-off-by: Shane Loretz <[email protected]> * unneeded codeblock line Signed-off-by: maryaB-osr <[email protected]> * New tutorial for service/client with Python (#372) * New tutorial for service/client with Python Signed-off-by: maryaB-osr <[email protected]> * title underline too short Signed-off-by: maryaB-osr <[email protected]> * trailing whitespace Signed-off-by: maryaB-osr <[email protected]> * fix indentation and other nits Signed-off-by: maryaB-osr <[email protected]> * Consistent indentation in code blocks Signed-off-by: Shane Loretz <[email protected]> * wrong section Signed-off-by: maryaB-osr <[email protected]> * New tutorial for ROS 2 launch files (#353) * New tutorial for ROS 2 launch files Signed-off-by: maryaB-osr <[email protected]> * Forgot to include in toctree Signed-off-by: maryaB-osr <[email protected]> * trailing white space Signed-off-by: maryaB-osr <[email protected]> * missing period Co-Authored-By: Chris Lalancette <[email protected]> * inside pkg > provided by pkg Co-Authored-By: Michel Hidalgo <[email protected]> * python modules explanation Co-Authored-By: Michel Hidalgo <[email protected]> * handful of reviews Signed-off-by: maryaB-osr <[email protected]> * linter & added next steps to rqt_console Signed-off-by: maryaB-osr <[email protected]> * more trailing whitespaces... Signed-off-by: maryaB-osr <[email protected]> * trying linenos Signed-off-by: maryaB-osr <[email protected]> * adjust indented space on linenos Signed-off-by: maryaB-osr <[email protected]> * another attempt at linenos indentation Signed-off-by: maryaB-osr <[email protected]> * change indentation Signed-off-by: maryaB-osr <[email protected]> * fix indentation on python block Signed-off-by: maryaB-osr <[email protected]> * give up on linenos for now Signed-off-by: maryaB-osr <[email protected]> * fixed indentation...? Signed-off-by: maryaB-osr <[email protected]> * New tutorial for C++ pub/sub (#366) * New tutorial for C++ pub/sub Signed-off-by: maryaB-osr <[email protected]> * try C++ code highlighting Signed-off-by: maryaB-osr <[email protected]> * one incorrect directive Signed-off-by: maryaB-osr <[email protected]> * fixed some indentation Signed-off-by: maryaB-osr <[email protected]> * changed entry points to executables Signed-off-by: maryaB-osr <[email protected]> * removed parenthesis from file name Signed-off-by: maryaB-osr <[email protected]> * New branch for cleaning up staging This commit organizes the order of the tutorials, adds an introduction to the beginner tutorials, and hyphenates all the page names Signed-off-by: maryaB-osr <[email protected]> * added next steps sections and other internal links Signed-off-by: maryaB-osr <[email protected]> * change msg show to interface show Signed-off-by: maryaB-osr <[email protected]> * linter Signed-off-by: maryaB-osr <[email protected]>
Signed-off-by: maryaB-osr [email protected]