diff --git a/plugins/static_layer.cpp b/plugins/static_layer.cpp index 303d1a5..520dca6 100755 --- a/plugins/static_layer.cpp +++ b/plugins/static_layer.cpp @@ -198,9 +198,14 @@ void StaticLayer::handleImpl(const void* data, if (type == typeid(robot_nav_msgs::OccupancyGrid) && (topic == map_topic_ || topic == "/" + map_topic_)) { incomingMap(*static_cast(data)); - } else if (type == typeid(robot_map_msgs::OccupancyGridUpdate) && + } else if (type == typeid(robot_map_msgs::OccupancyGridUpdate) && (topic == map_topic_ + "_updates" || topic == "/" + map_topic_ + "_updates")) { incomingUpdate(*static_cast(data)); + } else if (type == typeid(robot_nav_msgs::OccupancyGrid) || + type == typeid(robot_map_msgs::OccupancyGridUpdate)) { + // Right type, another layer's topic: the gateway sends every grid to every layer of this + // type (other StaticLayers, the direction grid). Normal traffic, not an error. + return; } else { std::string readable = boost::core::demangle(type.name()); @@ -209,7 +214,6 @@ void StaticLayer::handleImpl(const void* data, { readable = readable.substr(0, pos); } - robot::log_error("[] con1: %x, con2: %x ", type == typeid(robot_nav_msgs::OccupancyGrid), (topic == map_topic_ || topic == "/" + map_topic_)); robot::log_error("[StaticLayer] Received data of unknown type: %s on topic: %s, map_topic_: %s\n", readable.c_str(), topic.c_str(), map_topic_.c_str()); // std::cout << "[StaticLayer] Unknown type: " << type.name() << " on topic: " << topic << std::endl; }