ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org |
![]() | 1 | initial version |
if (ros::param::has("/rateFilterUWB")) {
ros::param::get("/rateFilterUWB", rateFilterUWB);
ros::Rate loop_rate(rateFilterUWB);
}
else
ros::Rate loop_rate(100);
Your issue is right here -- you have scoped the definition of the loop_rate
variable.
You could use a default value parameter to fix this.
double rate;
ros::param::param<double>("/rateFilterUWB", rate, 100);
![]() | 2 | No.2 Revision |
Your issue is right here -- you have scoped the definition of the loop_rate
variable.
You could use a default value parameter to fix this.
double rate;
ros::param::param<double>("/rateFilterUWB", rate, 100);
See here for more information.