17#include <boost/archive/binary_iarchive.hpp>
18#include <boost/archive/binary_oarchive.hpp>
24void toBinMsg(std::shared_ptr<carma_wm::TrafficControl> gf_ptr, autoware_lanelet2_msgs::msg::MapBin* msg)
28 RCLCPP_ERROR_STREAM(rclcpp::get_logger(
"carma_wm::TrafficControl"), __FUNCTION__ <<
": msg is null pointer!");
32 boost::archive::binary_oarchive oa(ss);
34 std::string data_str(ss.str());
37 msg->data.assign(data_str.begin(), data_str.end());
40void fromBinMsg(
const autoware_lanelet2_msgs::msg::MapBin& msg, std::shared_ptr<carma_wm::TrafficControl> gf_ptr, lanelet::LaneletMapPtr lanelet_map)
44 RCLCPP_ERROR_STREAM(rclcpp::get_logger(
"carma_wm::TrafficControl"), __FUNCTION__ <<
": gf_ptr is null pointer!");
49 data_str.assign(msg.data.begin(), msg.data.end());
53 boost::archive::binary_iarchive oa(ss);
60 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(
"carma_wm::TrafficControl"),
"Lanelet Map is provided to match memory addresses of received binary map update");
62 lanelet::utils::OverwriteParameterVisitor memory_visitor(lanelet_map);
64 if (!gf_ptr->update_list_.empty())
65 gf_ptr->update_list_.front().second->applyVisitor(memory_visitor);
66 if (!gf_ptr->remove_list_.empty())
67 gf_ptr->remove_list_.front().second->applyVisitor(memory_visitor);
69 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(
"carma_wm::TrafficControl"),
"Done resolving memory addresses of received regulatory elements!");
void fromBinMsg(const autoware_lanelet2_msgs::msg::MapBin &msg, std::shared_ptr< carma_wm::TrafficControl > gf_ptr, lanelet::LaneletMapPtr lanelet_map=nullptr)
void toBinMsg(std::shared_ptr< carma_wm::TrafficControl > gf_ptr, autoware_lanelet2_msgs::msg::MapBin *msg)