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

Add way to check if init has been called (i.e. isInitialized) #518

Closed
chapulina opened this issue Jul 19, 2018 · 5 comments
Closed

Add way to check if init has been called (i.e. isInitialized) #518

chapulina opened this issue Jul 19, 2018 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@chapulina
Copy link
Contributor

Feature request

Feature description

It would be convenient to have a way to check if rclcpp::init has been called, similar to ros::isInitialized.

Implementation considerations

If this has been left out due to some design decision, I suppose users can live without it, and instead try to catch specific errors resulting from not calling init. I searched a bit and couldn't find an explanation, so I imagine it may just be in the backlog?

Thanks!

@sloretz
Copy link
Contributor

sloretz commented Jul 19, 2018

I was going to say rclcpp::ok(), but it looks like it returns true if rclcpp hasn't been initialized. Maybe it should return false instead?

@sloretz sloretz added enhancement New feature or request good first issue Good for newcomers labels Jul 19, 2018
@mikaelarguedas
Copy link
Member

would rclcpp::ok() work for your use case? (though there may be some subtle differences as it's using a global that I think would default to returning true). We could make rclcpp::init assign a value to the global and flip the default

There is indeed a related issue in the backlog: #3

@chapulina
Copy link
Contributor Author

Yeah if g_signal_status is initialized to something other than 0 and set to 0 later, then maybe rclcpp::ok could be enough.

@sloretz
Copy link
Contributor

sloretz commented Jul 19, 2018

It seems like the discussion in the waffle meeting today leaned towards having separate APIs for tracking whether a signal has been received versus whether rclcpp is currently initialized.

@wjwwood
Copy link
Member

wjwwood commented Jul 26, 2018

Closed by #522.

@wjwwood wjwwood closed this as completed Jul 26, 2018
nnmm pushed a commit to ApexAI/rclcpp that referenced this issue Jul 9, 2022
ros2#518)

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants