CARLA
 
载入中...
搜索中...
未找到
SensorHeaderSerializer.h
浏览该文件的文档.
1// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
9#include "carla/Buffer.h"
10#include "carla/rpc/Transform.h"
11
12namespace carla {
13namespace sensor {
14namespace s11n {
15
16 /// Serializes the meta-information (header) sent with all the sensor data.
18 public:
19
20#pragma pack(push, 1)
21 struct Header {
22 uint64_t sensor_type;
23 uint64_t frame;
24 double timestamp;
26 };
27#pragma pack(pop)
28
29 constexpr static auto header_offset = sizeof(Header);
30
31 static Buffer Serialize(
32 uint64_t index,
33 uint64_t frame,
34 double timestamp,
35 rpc::Transform transform);
36
37 static const Header &Deserialize(const Buffer &message) {
38 return *reinterpret_cast<const Header *>(message.data());
39 }
40 };
41
42} // namespace s11n
43} // namespace sensor
44} // namespace carla
A piece of raw data.
const value_type * data() const noexcept
Direct access to the allocated memory or nullptr if no memory is allocated.
Serializes the meta-information (header) sent with all the sensor data.
static Buffer Serialize(uint64_t index, uint64_t frame, double timestamp, rpc::Transform transform)
static const Header & Deserialize(const Buffer &message)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133