CARLA
 
载入中...
搜索中...
未找到
CollisionEventSerializer.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/Debug.h"
11#include "carla/Memory.h"
12#include "carla/rpc/Actor.h"
13#include "carla/geom/Vector3D.h"
15
16namespace carla {
17namespace sensor {
18
19 class SensorData;
20
21namespace s11n {
22
23 /// Serializes the current state of the whole episode.
25 public:
26
37
38 constexpr static auto header_offset = 0u;
39
40 static Data DeserializeRawData(const RawData &message) {
41 return MsgPack::UnPack<Data>(message.begin(), message.size());
42 }
43
44 template <typename SensorT>
46 const SensorT &,
47 rpc::Actor self_actor,
48 rpc::Actor other_actor,
49 geom::Vector3D normal_impulse) {
50 return MsgPack::Pack(Data{self_actor, other_actor, normal_impulse});
51 }
52
54 };
55
56} // namespace s11n
57} // namespace sensor
58} // namespace carla
A piece of raw data.
static Buffer Pack(const T &obj)
Definition MsgPack.h:19
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition RawData.h:21
auto begin() noexcept
Begin iterator to the data generated by the sensor.
Definition RawData.h:52
size_t size() const
Size in bytes of the data generated by the sensor.
Definition RawData.h:83
Serializes the current state of the whole episode.
static Buffer Serialize(const SensorT &, rpc::Actor self_actor, rpc::Actor other_actor, geom::Vector3D normal_impulse)
static Data DeserializeRawData(const RawData &message)
static SharedPtr< SensorData > Deserialize(RawData &&data)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...
Definition Memory.h:20