-
Notifications
You must be signed in to change notification settings - Fork 914
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
Adds stdio Support to rosparam (supercedes #684) #686
Conversation
If no filename is passed to rosparam load or if '-' is passed as the filename, rosparam will attempt to read yaml from stdin. This allows piping yaml into rosparam.
If no filename is specified to rosparam dump or if the filename is "-", dumps the rosparam yaml to stdout, allowing it to be piped into other programs.
Can one of the admins verify this patch? |
Ok, I know what's going wrong here, and fix will be up soon. |
* Changes test for rosparam dump to no longer require a file arg * No longer allow "-" as shorthand for rosparam dump to stdout, as this doesn't make much sense. Just use `rosparam dump` with no file arg * No long allow rosparam load with no file argument, as invoking it with no piped stdin causes the program to hang until EOF is sent, which would likely confuse the user. Instead, require the user to explicitly specify "-" as the file for stdin.
Test failed. |
I'll work on fixing these tests (and adding tests for the new functionality) as soon as I get a chance. |
Still need to add tests for new functionality.
Test failed. |
Test passed. |
@dirk-thomas This is ready for review. |
@ros-pull-request-builder retest this please |
@ros-pull-request-builder retest this please (this time with a rebase) |
Can you please resolve the merge conflicts. |
I merged it. I can rebase if you'd prefer. |
Thank you. I squashed the changes and cherry-picked them in 5dcfc8e. |
I am recreating this PR because the previous one (#684) seems to have broken when I rebased the branch.
rosparam dump
to stdout is useful for piping the rosparam yaml output to other programs. This PR changes the behavior ofrosparam dump
such that if a user does not specify a filename to the command,rosparam
will dump to stdout.rosparam load
from stdin is useful for piping yaml into rosparam. This PR changes the behavior ofrosparam load
such that if the user specifies "-" as the filename,rosparam
will load from stdin.My particular usecase for
rosparam load
from stdin is being able to only load parameters from a launch file: