-
Notifications
You must be signed in to change notification settings - Fork 912
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
filterROSArgs function in init.cpp #694
Conversation
Can one of the admins verify this patch? |
I guess you'll be using this for some other ROS parameter or in some other way? The reason I ask is that this code is equivalent to your snippet above: // hello_world.cpp
int main( int argc, char** argv )
{
ros::init(argc, argv, "bar");
return 0;
} If you run it without a |
Can you please describe your use case? Beside that I am not sure if |
@wjwwood I might be wrong here, but Initial motivation comes from this PR ros-naoqi/naoqi_driver#44. In general I was wondering how you'd access the @dirk-thomas Sure, there is no problem in renaming this. You guys might find better names according to the context. |
@Karsten1987 Can you please update the function according to my previous comment. |
a598688
to
6c37765
Compare
6c37765
to
5db2088
Compare
Test passed. |
Thanks for iterating on this. Next time please also comment on the ticket since there is no notification for pushing to a PR. |
filterROSArgs function in init.cpp
filterROSArgs function in init.cpp
Allows a pre-filtering of ROS keywords before calling
ros::init()
.This is an alternative to
ros::this_node::getName()
[0], since this requires to callros::init(argc, argv, "node_name")
beforehand and forcing to specify a node name.ros::filterROSArgs can be called wo/ init for filter various keywords such as
__name
or__ns
.In case the desired argument is not found, an empty string is returned.