42 CHECK_NOTNULL(trajectory_pb);
43 trajectory_pb->mutable_header()->set_timestamp_sec(header_time_);
44 trajectory_pb->mutable_trajectory_point()->CopyFrom({begin(), end()});
46 const auto& last_tp = back();
47 trajectory_pb->set_total_path_length(last_tp.path_point().s());
48 trajectory_pb->set_total_path_time(last_tp.relative_time());