Operating System:
Linux 6.8.0-106-generic #106~22.04.1-Ubuntu
ROS version or commit hash:
jazzy
Steps to reproduce issue
- Create a file with the example code below
param_echo_node.py
#!/usr/bin/env python3
import rclpy
from rclpy.node import Node
class ParamEchoNode(Node):
def __init__(self):
super().__init__(
"param_echo_node",
allow_undeclared_parameters=True,
automatically_declare_parameters_from_overrides=True,
)
params = [
f"### [PARAM] {name} = {p.value!r}"
for name, p in self.get_parameters_by_prefix("").items()
]
self.get_logger().info("Params:\n" + "\n".join(params))
def main(args=None):
rclpy.init(args=args)
node = ParamEchoNode()
rclpy.spin(node)
rclpy.shutdown()
if __name__ == "__main__":
main()
- Run it with
python param_echo_node.py --ros-args -r __ns:=/test -r __name:=echo -p echo:msg:=hi
- Note how the node does not have a
msg param
Expected behavior
I expected the node to have a msg param.
Actual behavior
The node will have a msg param if either the namespace or the param prefix (echo:) is removed. I could not find a way to give the param a prefix that would assign it to the node in the presence of a namespace. This particular combination is also missing from all the documentation as well as the test cases.
It seems that dots and slashes are not accepted in the prefix or param name. Is there no way to pass a param to a specific namespaced node?
Additional information
The tests linked above have the following comment which might be related:
TODO(hidmic): restore tests (and drop the following ones) when parameter names
are standardized to use slashes in lieu of dots.
Operating System:
Linux 6.8.0-106-generic #106~22.04.1-UbuntuROS version or commit hash:
jazzy
Steps to reproduce issue
param_echo_node.py
msgparamExpected behavior
I expected the node to have a
msgparam.Actual behavior
The node will have a
msgparam if either the namespace or the param prefix (echo:) is removed. I could not find a way to give the param a prefix that would assign it to the node in the presence of a namespace. This particular combination is also missing from all the documentation as well as the test cases.It seems that dots and slashes are not accepted in the prefix or param name. Is there no way to pass a param to a specific namespaced node?
Additional information
The tests linked above have the following comment which might be related: