MCPcopy Create free account
hub / github.com/PeterFWS/Structure-PLP-SLAM / serialize_map_diff

Method serialize_map_diff

src/socket_publisher/data_serializer.cc:52–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 }
51
52 std::string data_serializer::serialize_map_diff()
53 {
54 std::vector<PLPSLAM::data::keyframe *> keyframes;
55 map_publisher_->get_keyframes(keyframes);
56
57 std::vector<PLPSLAM::data::landmark *> all_landmarks;
58 std::set<PLPSLAM::data::landmark *> local_landmarks;
59 map_publisher_->get_landmarks(all_landmarks, local_landmarks);
60
61 const auto current_camera_pose = map_publisher_->get_current_cam_pose();
62
63 const double pose_hash = get_mat_hash(current_camera_pose);
64 if (pose_hash == current_pose_hash_)
65 {
66 current_pose_hash_ = pose_hash;
67 return "";
68 }
69 current_pose_hash_ = pose_hash;
70
71 return serialize_as_protobuf(keyframes, all_landmarks, local_landmarks, current_camera_pose);
72 }
73
74 std::string data_serializer::serialize_latest_frame(const unsigned int image_quality)
75 {

Callers 1

runMethod · 0.80

Calls 3

get_keyframesMethod · 0.80
get_landmarksMethod · 0.45
get_current_cam_poseMethod · 0.45

Tested by

no test coverage detected