error: ‘loop_rate’ was not declared in this scope
In my launch file I have a global variable
<param name = "rateFilterUWB" type="int" value="10" />
and I'm trying to reach this variable's value in my C++ code
int rateFilterUWB;
if (ros::param::has("/rateFilterUWB")) {
ros::param::get("/rateFilterUWB", rateFilterUWB);
ros::Rate loop_rate(rateFilterUWB);
}
else
ros::Rate loop_rate(100);
But I have an error during compilation:
error: ‘loop_rate’ was not declared in this scope
PS I'm running Linux raspberrypi 4.19.30-v7+