ROS parameters - understanding of a line code
Hi,
I found a code on the internet about SLAM and i'm not able to make it function. I need to understand what those code line do:
std::string transport;
std::string depth_topic;
if(!nh.getParam("depth_topic",depth_topic))
{
depth_topic = "camera/depth_registered/image_raw";
ROS_INFO_STREAM("Could not retrieve depth_topic param");
}
if(!nh.getParam("depth_image_transport",transport))
{
transport = "compressedDepth";
ROS_INFO_STREAM("could not retrieve depth_image_transport param");
}
Because when i run the code i have all the INFO messages displayed on my terminal, so it means that it doesn't find topics from my camera. Indeed, on the book "a gentle introduction to ROS", they write the following sentence: The get function returns true if the value was read successfully and false if there was a problem, usually indicating that the requested parameters has not been assigned a value"
Does the code assume that we have a yaml file ? if not, how i can avoid this message, that is to say return true at the line nh.etParam.
Thank you