CARLA
LibCarla/source/carla/rpc/WheelPhysicsControl.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/geom/Vector3D.h"
10 #include "carla/MsgPack.h"
11 
12 namespace carla {
13 namespace rpc {
14 
16  public:
17 
18  WheelPhysicsControl() = default;
19 
21  float in_tire_friction,
22  float in_damping_rate,
23  float in_max_steer_angle,
24  float in_radius,
25  float in_max_brake_torque,
26  float in_max_handbrake_torque,
27  float in_lat_stiff_max_load,
28  float in_lat_stiff_value,
29  float in_long_stiff_value,
30  geom::Vector3D in_position)
31  : tire_friction(in_tire_friction),
32  damping_rate(in_damping_rate),
33  max_steer_angle(in_max_steer_angle),
34  radius(in_radius),
35  max_brake_torque(in_max_brake_torque),
36  max_handbrake_torque(in_max_handbrake_torque),
37  lat_stiff_max_load(in_lat_stiff_max_load),
38  lat_stiff_value(in_lat_stiff_value),
39  long_stiff_value(in_long_stiff_value),
40  position(in_position) {}
41 
42  float tire_friction = 2.0f;
43  float damping_rate = 0.25f;
44  float max_steer_angle = 70.0f;
45  float radius = 30.0f;
46  float max_brake_torque = 1500.0f;
47  float max_handbrake_torque = 3000.0f;
48  float lat_stiff_max_load = 2.0f;
49  float lat_stiff_value = 17.0f;
50  float long_stiff_value = 1000.0f;
51  geom::Vector3D position = {0.0f, 0.0f, 0.0f};
52 
53  bool operator!=(const WheelPhysicsControl &rhs) const {
54  return
55  tire_friction != rhs.tire_friction ||
56  damping_rate != rhs.damping_rate ||
57  max_steer_angle != rhs.max_steer_angle ||
58  radius != rhs.radius ||
59  max_brake_torque != rhs.max_brake_torque ||
60  max_handbrake_torque != rhs.max_handbrake_torque ||
61  lat_stiff_max_load != rhs.lat_stiff_max_load ||
62  lat_stiff_value != rhs.lat_stiff_value ||
63  long_stiff_value != rhs.long_stiff_value ||
64  position != rhs.position;
65  }
66 
67  bool operator==(const WheelPhysicsControl &rhs) const {
68  return !(*this != rhs);
69  }
70 #ifdef LIBCARLA_INCLUDED_FROM_UE4
71 
73  : tire_friction(Wheel.TireFriction),
76  radius(Wheel.Radius),
82  position(Wheel.Position.X, Wheel.Position.Y, Wheel.Position.Z) {}
83 
84  operator FWheelPhysicsControl() const {
87  Wheel.DampingRate = damping_rate;
89  Wheel.Radius = radius;
95  Wheel.Position = {position.x, position.y, position.z};
96  return Wheel;
97  }
98 #endif
99 
100  MSGPACK_DEFINE_ARRAY(tire_friction,
101  damping_rate,
102  max_steer_angle,
103  radius,
104  max_brake_torque,
105  max_handbrake_torque,
106  lat_stiff_max_load,
107  lat_stiff_value,
108  long_stiff_value,
109  position)
110  };
111 
112 }
113 }
WheelPhysicsControl(float in_tire_friction, float in_damping_rate, float in_max_steer_angle, float in_radius, float in_max_brake_torque, float in_max_handbrake_torque, float in_lat_stiff_max_load, float in_lat_stiff_value, float in_long_stiff_value, geom::Vector3D in_position)
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
bool operator==(const WheelPhysicsControl &rhs) const
bool operator!=(const WheelPhysicsControl &rhs) const