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

How does <param> know the type when not explicitly set?

asked 2015-08-21 07:34:23 -0500

I am currently doing a C++ program which executes launchfiles and monitor their processes if they die and I now I wonder how normally the type of the value of the param is selected.

Actually I thought it is saved as string all the time and then depending on what the user decides to have it, trying to be converted.

But when I look at the functions in param.h ... this does not seem to be the case. So how are they checked if they are bool, float, double, string, when no type is given?



edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-21 07:55:27 -0500

Ah ok found it myself,

Specifies the type of the parameter. If you don't specify the type, roslaunch will attempt to automatically determine the type. These rules are very basic:

  • numbers with '.'s are floating point,
  • integers otherwise;
  • "true" and "false" are boolean (not case-sensitive).
  • all other values are strings
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-08-21 07:34:23 -0500

Seen: 194 times

Last updated: Aug 21 '15