ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
For the slightly different case than what @tfoote linked to, here's how to get a single parameter as an array of values.
We recently merged this feature (made by @ayrton04), see:
Looks like there's no documentation yet, but there is an example of setting:
https://github.com/ros2/demos/blob/03ee0e0963ecb0990742eaeee22b334c11b16722/demo_nodes_cpp/src/parameters/set_and_get_parameters.cpp#L47-L48
And you can use get_parameter(s)
to get the rclcpp::Parameter
for it, and on that class there are as_*_array()
methods:
https://github.com/ros2/rclcpp/blob/a49281cff3082410621aeea388944b35ba63f819/rclcpp/include/rclcpp/parameter.hpp#L95-L113
Which return vector<T>
.