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

Do argument parsing outside of node constructor #492

Open
sloretz opened this issue Jun 5, 2018 · 2 comments
Open

Do argument parsing outside of node constructor #492

sloretz opened this issue Jun 5, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request in progress Actively being worked on (Kanban column)

Comments

@sloretz
Copy link
Contributor

sloretz commented Jun 5, 2018

Feature request

Things that come from command line arguments should be separately passed into the node's constructor rather than passing in arguments and asking the node to do the parsing.

Feature description

Currently command line arguments may be passed to a node via an argument to the node's constructor. This separates the responsibility of parsing arguments from actually using them. An entity like ros2 launch launch composable nodes would invoke parsing of any command line arguments, and then pass the results into the node.

Implementation considerations

The current arguments passed to the node are

Node(
const std::string & node_name,
const std::string & namespace_,
rclcpp::Context::SharedPtr context,
const std::vector<std::string> & arguments,
bool use_global_arguments = true,
bool use_intra_process_comms = false,
bool start_parameter_services = true);

The information that should be passed in if not through the arguments is:

Since new features may be added as command line arguments it may be an advantage to pass rclcpp::NodeArguments() so future features don't have to change all the places where arguments are passed to a node's constructor

requires ros2/rcl#254

@sloretz sloretz added the enhancement New feature or request label Jun 5, 2018
@mjcarroll mjcarroll self-assigned this Jan 22, 2019
@mjcarroll mjcarroll added the in progress Actively being worked on (Kanban column) label Jan 22, 2019
@mjcarroll mjcarroll added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Feb 5, 2019
@mjcarroll mjcarroll removed the in review Waiting for review (Kanban column) label Feb 21, 2019
@wjwwood
Copy link
Member

wjwwood commented Feb 21, 2019

@mjcarroll is this actually done?

@mjcarroll
Copy link
Member

Ah, sorry. With a quick glance I thought this was covered with NodeOptions, but the parsing is still happening inside the node, will re-open.

@mjcarroll mjcarroll reopened this Feb 22, 2019
@mjcarroll mjcarroll added the in progress Actively being worked on (Kanban column) label Feb 25, 2019
nnmm pushed a commit to ApexAI/rclcpp that referenced this issue Jul 9, 2022
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this issue Aug 5, 2022
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress Actively being worked on (Kanban column)
Projects
None yet
Development

No branches or pull requests

3 participants