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

jbu's profile - activity

2021-04-20 10:44:07 -0500 received badge  Student (source)
2020-07-01 18:52:30 -0500 received badge  Famous Question (source)
2020-07-01 18:52:30 -0500 received badge  Notable Question (source)
2020-07-01 18:52:30 -0500 received badge  Popular Question (source)
2019-08-26 12:55:21 -0500 received badge  Famous Question (source)
2019-05-08 03:50:29 -0500 received badge  Popular Question (source)
2019-05-07 14:10:31 -0500 received badge  Editor (source)
2019-05-06 16:18:06 -0500 received badge  Supporter (source)
2019-05-06 16:02:35 -0500 received badge  Notable Question (source)
2019-05-04 17:42:39 -0500 marked best answer Passing Matrices as params in Launch Files

I'd like to pass the data contained within a matrix as a parameter to several nodes in a launch file. This link states how to pass in std::vector<...> params for bools, ints, doubles, etc. Is it possible to pass in something like a std::vector< std::vector<int> > via the launch file?

I'm looking for something similar to this answer: given a launch file

<launch>
<node name="..." ...>
     <rosparam param="matrix">
         [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
     </rosparam>
</node>
</launch>

I'd like to recover the value of matrix within the node by calling something similar to:

std::vector<std::vector<int> > matrix;
nh.getParam("matrix", matrix);

This method didn't work when I tried it though. Is there another way this can be done?

(I'm using ROS Kinetic on Ubuntu 16.04)

2019-05-04 17:42:39 -0500 received badge  Scholar (source)
2019-05-03 09:01:31 -0500 received badge  Enthusiast
2019-05-01 12:01:22 -0500 received badge  Popular Question (source)