CARLA
 
载入中...
搜索中...
未找到
ActorDynamicState.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
10#include "carla/geom/Vector3D.h"
11#include "carla/rpc/ActorId.h"
17
18#include <cstdint>
19
20namespace carla {
21namespace sensor {
22namespace data {
23
24namespace detail {
25
26#pragma pack(push, 1)
28 public:
29
31
33 : throttle(control.throttle),
34 steer(control.steer),
35 brake(control.brake),
36 hand_brake(control.hand_brake),
37 reverse(control.reverse),
39 gear(control.gear) {}
40
41 operator rpc::VehicleControl() const {
43 }
44
45 private:
46
47 float throttle;
48 float steer;
49 float brake;
51 bool reverse;
53 int32_t gear;
54 };
55
56#pragma pack(pop)
57
58#pragma pack(push, 1)
69#pragma pack(pop)
70
71#pragma pack(push, 1)
73 public:
74
76
78 : direction{control.direction.x, control.direction.y, control.direction.z},
79 speed(control.speed),
80 jump(control.jump) {}
81
82 operator rpc::WalkerControl() const {
83 return {geom::Vector3D{direction[0u], direction[1u], direction[2u]}, speed, jump};
84 }
85
86 private:
87
88 float direction[3u];
89 float speed;
90 bool jump;
91 };
92
93#pragma pack(pop)
94
95#pragma pack(push, 1)
96
109#pragma pack(pop)
110
111#pragma pack(push, 1)
112
114 TrafficSignData() = default;
115
116 char sign_id[32u];
117 };
118#pragma pack(pop)
119} // namespace detail
120
121#pragma pack(push, 1)
122
123 /// Dynamic state of an actor at a certain frame.
145
146#pragma pack(pop)
147
148 static_assert(
149 sizeof(ActorDynamicState) == 119u,
150 "Invalid ActorDynamicState size! "
151 "If you modified this class please update the size here, else you may "
152 "comment this assert, but your platform may have compatibility issues "
153 "connecting to other platforms.");
154
155} // namespace data
156} // namespace sensor
157} // namespace carla
PackedVehicleControl(const rpc::VehicleControl &control)
PackedWalkerControl(const rpc::WalkerControl &control)
uint32_t ActorId
Definition ActorId.h:14
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
rpc::ActorId ActorId
Definition ActorId.h:18
Dynamic state of an actor at a certain frame.
union carla::sensor::data::ActorDynamicState::TypeDependentState state