CARLA
 
载入中...
搜索中...
未找到
RadarSerializer.h
浏览该文件的文档.
1// Copyright (c) 2019 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/Memory.h"
12
13#include <cstdint>
14#include <cstring>
15
16namespace carla {
17namespace sensor {
18
19 class SensorData;
20
21namespace s11n {
22
23 // ===========================================================================
24 // -- RadarSerializer --------------------------------------------------------
25 // ===========================================================================
26
27 /// Serializes the data generated by Radar sensors.
29 public:
30
31 template <typename Sensor>
32 static Buffer Serialize(
33 const Sensor &sensor,
34 const data::RadarData &measurement,
35 Buffer &&output);
36
38 };
39
40 template <typename Sensor>
42 const Sensor &,
43 const data::RadarData &measurement,
44 Buffer &&output) {
45 output.copy_from(measurement._detections);
46 return std::move(output);
47 }
48
49} // namespace s11n
50} // namespace sensor
51} // namespace carla
A piece of raw data.
void copy_from(const T &source)
Copy source into this buffer. Allocates memory if necessary.
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition RawData.h:21
std::vector< RadarDetection > _detections
Definition RadarData.h:74
Serializes the data generated by Radar sensors.
static Buffer Serialize(const Sensor &sensor, const data::RadarData &measurement, Buffer &&output)
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