navigation icon indicating copy to clipboard operation
navigation copied to clipboard

YAML errors in map_server not caught

Open celynw opened this issue 4 years ago • 2 comments

When running rosrun map_server map_server map.yaml or equivalent, any errors cause it to close without producing any output. For instance, setting the resolution as a string. I see in the code (map_server/src/main.cpp) it is supposed to produce a ROS_ERROR if the resolution could not be loaded, but this is never printed.

        try {
          doc["resolution"] >> res;
        } catch (YAML::InvalidScalar &) {
          ROS_ERROR("The map does not contain a resolution tag or it is invalid.");
          exit(-1);
        }

In my usage I never get any of these error messages.

I can't find and specifically catch what is being thrown, but catching std::exception::what() does work:

yaml-cpp: error at line 0, column 0: bad conversion

Environment:

  • OS: Ubuntu 18.04
  • Branch: melodic-devel
  • Commit: b496f689

celynw avatar Jul 10 '20 11:07 celynw

any update?

acaviedes15 avatar May 25 '23 17:05 acaviedes15

Setting,

resolution: "0.050000"

within the .yaml

Allows the current method to parse the resolution, is this acceptable?

maker-ATOM avatar Apr 08 '24 12:04 maker-ATOM