-
Notifications
You must be signed in to change notification settings - Fork 431
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
Setting certain extra-arguments to components has no effect #978
Comments
If I'm not mistaken, it's supposed only to work with |
Correct. But I don't see any fundamental reason why these other options should not be available. @wjwwood @mjcarroll thoughts? If everyone agrees, @fabmene a PR adding support for those options would be much appreciated. |
I don't think that allowing configuration through the command line of |
What command line @ivanpauno? Extra arguments only appear in component loading service calls. Having said, I do have a hard time thinking of a use case for dynamically changing |
Ups, sorry. But the same comment applies to launch files. |
Thank you for providing inside on this matter. To clarify, I do not have a use case for the aforementioned arguments either, but was merely experimenting with components and their limitations. |
@hidmic Does any tutorial mentions |
Thinking about this more, it's like we have three categories of settings for nodes:
For the second case, options that affect the behavior of the node and therefore the original developer should be aware of them, I'd normally say "use a parameter if you want to make it configurable", but in these cases like Maybe the components interface in rclcpp should only accept a subset of rclcpp/rclcpp_components/include/rclcpp_components/node_factory.hpp Lines 40 to 42 in f30329f
This limited set of node options would dictate what can be part of the "extra options" for each client library: |
Yes, I agree with that. That method could still take Other arguments that I believe enter in the first category: The three of them can usually be configured by the user without the need to change how the node was implemented (in some corner cases, maybe not, but I think they should still be exposed). We could add them to be configurable when loading a component, like here:
We could also add some ros arguments to make them configurable in manually composed executables. |
Hmm but then that'd apply to dynamic loading only -- statically constructing a node would still allow full access to all options. I think that if we establish that some options are not to be modified by client code, then maybe those should not be accessible in I'm inclined to think that putting restrictions doesn't do us any good, even more so if restrictions are partial. All options that @ivanpauno mentioned make sense to be exposed, same for |
I wasn't suggesting that we change rclcpp/rclcpp_components/include/rclcpp_components/node_factory.hpp Lines 40 to 42 in f30329f
Something like this: class NodeOptions;
class ComposableNodeOptions
{
public:
NodeOptions to_node_options() const;
};
class NodeFactory
{
public:
virtual
NodeInstanceWrapper
create_node_instance(const ComposableNodeOptions & options) = 0;
};
class Node
{
public:
Node(..., const NodeOptions &, ...);
};
// ...
class MyNode : public Node
{
public:
explicit MyNode(const NodeOptions & no) : Node("my_node", ..., no, ...) {...};
};
class MyNodeFactory : public NodeFactory
{
public:
virtual
NodeInstanceWrapper
create_node_instance(const ComposableNodeOptions & cno)
{
return NodeInstanceWrapper(std::make_shared<MyNode>(cno.to_node_options()));
}
}; In this way your custom node ( EDIT: I changed it so that |
Oh yeah, I got that. I still stand by what I said above. We're restricting options because we think they are not meant to be changed by a user, but we only do so for the dynamic composition case. Code composing So instead of introducing an asymmetry, I'd be fine with proper documentation. People will always find ways of shooting themselves in the foot if they are willing to. You can make a mess in |
Ok, well I don't feel strongly about it. Documentation is fine with me too. |
Circling back! It seems we were discussing whether to restrict options for composable nodes only OR just allow everything and document potential side-effects. I was and still am inclined towards the latter. Patch is small if you guys @wjwwood @ivanpauno agree. |
Documentation is ok for me. |
Hi, what's the status of this issue right now? i'm trying to implement dynamically composed bringup for Nav2, and Nav2 has a large param file for multiple nodes (also contain some internal node's parameters), when
|
I agree (somewhat) with The For composition nodes that have internally another node object, we need to be able to pass in the parameters to that secondary internal node. The example in Nav2 we're trying to work around, where each server has a single node, but the servers that contain costmaps have another independent node for the costmaps. This is because a costmap is a sufficiently complex unique entity in its own right that needs control over its flow of sensor data and parameters separately from the server that uses it. However, it is not appropriate to compose the costmap as a separate node since it needs to be statically tied to the task servers for ultra-fast access by the planning and control algorithms regardless of composition strategies employed. Further, if a node is an organizational unit of interfaces, it would be nonsensical to tie the costmap into the server's implementation since they are really serving different purposes that is important to be able to debug independently. I'm only concerned by being able to set it for the container or by a particular component (I don't really care which) so that it can be used on the odd situation it is required. We only see this issue in dynamic composition in the component container but not elsewhere due to the global setting of that is default to https://github.com/ros2/rclcpp/blob/master/rclcpp/include/rclcpp/node_options.hpp#L391 Below assumes that changing It seems arbitrary that all node types can use it, but the container of components restricts it by statically It would be silly if Nav2 or other projects in the ecosystem had to create its own implementation of a component container simply to remove 1 line for the odd use-case which does appear. I think a decent middle ground is to allow it but then add a
Would that be a decent compromise? Or is there another way to get our parameters to the internal node? We currently use a single file for all parameters https://github.com/ros-planning/navigation2/blob/main/nav2_bringup/params/nav2_params.yaml that is passed to the nodes to grab their particular values. I'm not particularly excited about setting |
I am with @hidmic with this.
if the custom node implementation wasn't planned to be used with some arguments, probably node implementation needs to be responsible for that? |
sorry, the internal nodes (e.g. |
This issue has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-2021-9-16/22372/1 |
Still feels like a niche we should have resolved |
Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
closing in favor of #2685 |
Bug report
Required Info:
Steps to reproduce issue
Minimal component example:
Start a component container and load above component with extra arguments, either as launch, or via cli:
Expected behavior
Actual behavior
Additional Information
Does not seem to depend on order or number of arguments.
The text was updated successfully, but these errors were encountered: