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

Dynamic Reconfigure - Can I Set An Array Of Values?

asked 2014-03-10 07:47:06 -0600

trianta2 gravatar image

Hi,

I want to use dynamic_reconfigure in one of my nodes, however, one of my parameters is actually a variably-sized array of doubles. Can dynamic_reconfigure support variably-sized arrays, or does it only handle name-value pairs and structures?

Would a service with custom message type be a better solution for setting the array?

Thank you for your help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-08-01 08:57:52 -0600

Oded gravatar image

Know it's been a long time but: You can't have an array of values, however, you can use a string with a comma deliminator between the values.

For example

gen.add("vals", str_t, 0, "A comma delimited list", "1,2,3,4")

later on you can break it into an array in your code. In python it's really ease, just use you_string.split(',')

edit flag offensive delete link more

Comments

anything changed here since 2016?

tanasis gravatar image tanasis  ( 2020-11-30 07:46:17 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-03-10 07:47:06 -0600

Seen: 1,326 times

Last updated: Aug 01 '16