I have used the following pattern a number of times, across a variety of packages:
double my_param_seconds;
ros::param::get("~my_param", my_param_seconds);
my_param_ = ros::Duration(my_param_seconds);
This seems awkward compared to parameterizing integers or doubles. It's fine if it's only one or two, but for a safety state machine which has a half-dozen parameterized timeouts, this is a drag. I can write my own little wrapper function, but perhaps something standard already exists?
Alternatively, is it better to simply store the seconds value, and convert that to a `ros::Duration` at the point of use?
Thanks.
↧