ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Inspired by williams answer and checking out the newest commit on master here: https://github.com/ros2/demos/blob/master/demo_nodes_cpp/src/parameters/set_and_get_parameters.cpp I found below code to work, not sure if this is the recommended way, but it works.

this->declare_parameter("foo");
rclcpp::Parameter foo_param("foo", std::vector<double>({}));
this->get_parameter("foo", foo_param);
std::vector<double> foo = foo_param.as_double_array();