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

Ability to configure domain ID in rclpy #484

Closed
fujitatomoya opened this issue Dec 17, 2019 · 18 comments
Closed

Ability to configure domain ID in rclpy #484

fujitatomoya opened this issue Dec 17, 2019 · 18 comments
Assignees
Labels
enhancement New feature or request

Comments

@fujitatomoya
Copy link
Collaborator

fujitatomoya commented Dec 17, 2019

Feature request

Feature description

ability to set the Domain ID on a per-node basis.

the same ability with ros2/rclcpp#910

Implementation considerations

  1. add domain id with rclpy Node Class option. (default RCL_NODE_OPTIONS_DEFAULT_DOMAIN_ID)
  2. if it is RCL_NODE_OPTIONS_DEFAULT_DOMAIN_ID, the rcl overrides domain id with ROS_DOMAIN_ID environmental variable.
@fujitatomoya
Copy link
Collaborator Author

related to ros2/rclcpp#910

@ivanpauno
Copy link
Member

Closing, as I think it has been clarified in ros2/rclcpp#910 (comment).
Please, reopen if not.

@fujitatomoya
Copy link
Collaborator Author

@ivanpauno

this is for the same ability with ros2/rclcpp#910 for rclpy. i believe that this is needed for rclpy also not only for rclcpp.

@ivanpauno
Copy link
Member

@ivanpauno

this is for the same ability with ros2/rclcpp#910 for rclpy. i believe that this is needed for rclpy also not only for rclcpp.

Sorry, I didn't understand that.
The title sounds like rclpy is not using ROS_DOMAIN_ID environment variable.
Can you update the description and reopen? Thanks!

@fujitatomoya
Copy link
Collaborator Author

@ivanpauno

The title sounds like rclpy is not using ROS_DOMAIN_ID environment variable.

my bad, that confuses you.

Can you update the description and reopen? Thanks!

will do it right now.

@ivanpauno ivanpauno changed the title Domain ID not changable via ROS_DOMAIN_ID Ability to configure domain ID in rclpy Dec 20, 2019
@ivanpauno ivanpauno reopened this Dec 20, 2019
@suab321321
Copy link
Contributor

@ivanpauno sir I would like to contribute to this.

@ivanpauno
Copy link
Member

For the same reason than here ros2/rclcpp#910 (comment), it's better to wait now. The other set of PRs will be done soon, after that, this will be unblocked.

@ivanpauno ivanpauno added the enhancement New feature or request label Jan 16, 2020
@ivanpauno ivanpauno self-assigned this Jan 16, 2020
@fujitatomoya
Copy link
Collaborator Author

@ivanpauno

this one too, you can leave it to us.

@Barry-Xu-2018
Copy link
Contributor

@ivanpauno @fujitatomoya

After checking current implementation of rclpy, it only supports use default rcl_opitions.

/// Initialize rcl with default options, ignoring parameters
/**
* Raises RuntimeError if rcl could not be initialized
*/
static PyObject *
rclpy_init(PyObject * Py_UNUSED(self), PyObject * args)

If want to support configuring domain ID, I have to expose InitOption to rclpy.
What do you think ?

@fujitatomoya
Copy link
Collaborator Author

@Barry-Xu-2018

i think we do need to expose InitOption to rclpy, i think that's the idea.

@Barry-Xu-2018
Copy link
Contributor

@Barry-Xu-2018

i think we do need to expose InitOption to rclpy, i think that's the idea.

Thank you.

@Barry-Xu-2018
Copy link
Contributor

@ivanpauno

Friendly ping.
If have time, please look at comment. #484 (comment)
I want to hear your opioin.

@ivanpauno
Copy link
Member

@ivanpauno @fujitatomoya

After checking current implementation of rclpy, it only supports use default rcl_opitions.

/// Initialize rcl with default options, ignoring parameters
/**
* Raises RuntimeError if rcl could not be initialized
*/
static PyObject *
rclpy_init(PyObject * Py_UNUSED(self), PyObject * args)

If want to support configuring domain ID, I have to expose InitOption to rclpy.
What do you think ?

Prefer adding an extra keyword argument to the functions with a default:

def init(*, args: Optional[List[str]] = None, context: Context = None) -> None:

def __init__(self):

Both should have a new , domain_id: int = get_default_domain_id() argument.

In _rclpy.c, you will need to write a new rclpy_get_default_domain_id function, and extend rclpy_init signature with an extra argument.

@Barry-Xu-2018
Copy link
Contributor

@ivanpauno @fujitatomoya
After checking current implementation of rclpy, it only supports use default rcl_opitions.

/// Initialize rcl with default options, ignoring parameters
/**
* Raises RuntimeError if rcl could not be initialized
*/
static PyObject *
rclpy_init(PyObject * Py_UNUSED(self), PyObject * args)

If want to support configuring domain ID, I have to expose InitOption to rclpy.
What do you think ?

Prefer adding an extra keyword argument to the functions with a default:

def init(*, args: Optional[List[str]] = None, context: Context = None) -> None:

def __init__(self):

Both should have a new , domain_id: int = get_default_domain_id() argument.

In _rclpy.c, you will need to write a new rclpy_get_default_domain_id function, and extend rclpy_init signature with an extra argument.

Thanks for your suggestion.

@ivanpauno
Copy link
Member

Both should have a new , domain_id: int = get_default_domain_id() argument.

You could also use the number here as a default value, and rcl will check the environment variable here.

@Barry-Xu-2018
Copy link
Contributor

Both should have a new , domain_id: int = get_default_domain_id() argument.

You could also use the number here as a default value, and rcl will check the environment variable here.

Thanks. Got it.

@Barry-Xu-2018
Copy link
Contributor

Barry-Xu-2018 commented Jul 2, 2020

@ivanpauno @fujitatomoya

Please review codes.
#596

@fujitatomoya
Copy link
Collaborator Author

CC: @ivanpauno

i am closing this since #596 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants