CARLA
 
载入中...
搜索中...
未找到
WheelTelemetryData.h
浏览该文件的文档.
1// Copyright (c) 2022 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/MsgPack.h"
10
11namespace carla {
12namespace rpc {
13
15 public:
16
17 WheelTelemetryData() = default;
18
42
43 float tire_friction = 0.0f;
44 float lat_slip = 0.0f;
45 float long_slip = 0.0f;
46 float omega = 0.0f;
47 float tire_load = 0.0f;
49 float torque = 0.0f;
50 float long_force = 0.0f;
51 float lat_force = 0.0f;
54
55 bool operator!=(const WheelTelemetryData &rhs) const {
56 return
58 lat_slip != rhs.lat_slip ||
59 long_slip != rhs.long_slip ||
60 omega != rhs.omega ||
61 tire_load != rhs.tire_load ||
63 torque != rhs.torque ||
64 long_force != rhs.long_force ||
65 lat_force != rhs.lat_force ||
68 }
69
70 bool operator==(const WheelTelemetryData &rhs) const {
71 return !(*this != rhs);
72 }
73#ifdef LIBCARLA_INCLUDED_FROM_UE4
74
76 : tire_friction(TelemetryData.TireFriction),
77 lat_slip(TelemetryData.LatSlip),
78 long_slip(TelemetryData.LongSlip),
79 omega(TelemetryData.Omega),
80 tire_load(TelemetryData.TireLoad),
81 normalized_tire_load(TelemetryData.NormalizedTireLoad),
82 torque(TelemetryData.Torque),
83 long_force(TelemetryData.LongForce),
84 lat_force(TelemetryData.LatForce),
85 normalized_long_force(TelemetryData.NormalizedLongForce),
86 normalized_lat_force(TelemetryData.NormalizedLatForce) {}
87
88 operator FWheelTelemetryData() const {
89 FWheelTelemetryData TelemetryData;
90 TelemetryData.TireFriction = tire_friction;
91 TelemetryData.LatSlip = lat_slip;
92 TelemetryData.LongSlip = long_slip;
93 TelemetryData.Omega = omega;
94 TelemetryData.TireLoad = tire_load;
96 TelemetryData.Torque = torque;
97 TelemetryData.LongForce = long_force;
98 TelemetryData.LatForce = lat_force;
101
102 return TelemetryData;
103 }
104#endif
105
106 MSGPACK_DEFINE_ARRAY(tire_friction,
107 lat_slip,
108 long_slip,
109 omega,
110 tire_load,
112 torque,
114 lat_force,
117 };
118
119} // namespace rpc
120} // namespace carla
WheelTelemetryData(const FWheelTelemetryData &TelemetryData)
bool operator==(const WheelTelemetryData &rhs) const
bool operator!=(const WheelTelemetryData &rhs) const
WheelTelemetryData(float tire_friction, float lat_slip, float long_slip, float omega, float tire_load, float normalized_tire_load, float torque, float long_force, float lat_force, float normalized_long_force, float normalized_lat_force)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133