CARLA
GnssSerializer.h
Go to the documentation of this file.
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"
10 #include "carla/geom/GeoLocation.h"
11 #include "carla/rpc/ActorId.h"
12 #include "carla/sensor/RawData.h"
13 
14 #include <cstdint>
15 #include <cstring>
16 
17 namespace carla {
18 namespace sensor {
19 
20  class SensorData;
21 
22 namespace s11n {
23 
25  public:
26 
27  static geom::GeoLocation DeserializeRawData(const RawData &message) {
28  return MsgPack::UnPack<geom::GeoLocation>(message.begin(), message.size());
29  }
30 
31  template <typename SensorT>
32  static Buffer Serialize(
33  const SensorT &,
34  const geom::GeoLocation &geo_location
35  ) {
36  return MsgPack::Pack(geo_location);
37  }
38 
40  };
41 
42 } // namespace s11n
43 } // namespace sensor
44 } // namespace carla
static SharedPtr< SensorData > Deserialize(RawData &&data)
static Buffer Pack(const T &obj)
Definition: MsgPack.h:19
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
static Buffer Serialize(const SensorT &, const geom::GeoLocation &geo_location)
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
auto begin() noexcept
Begin iterator to the data generated by the sensor.
Definition: RawData.h:51
size_t size() const
Size in bytes of the data generated by the sensor.
Definition: RawData.h:82
static geom::GeoLocation DeserializeRawData(const RawData &message)
A piece of raw data.
Definition: carla/Buffer.h:41
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition: RawData.h:20