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  geom::Vector3D in_position)
28  : tire_friction(in_tire_friction),
29  damping_rate(in_damping_rate),
30  max_steer_angle(in_max_steer_angle),
31  radius(in_radius),
32  max_brake_torque(in_max_brake_torque),
33  max_handbrake_torque(in_max_handbrake_torque),
34  position(in_position) {}
35 
36  float tire_friction = 2.0f;
37  float damping_rate = 0.25f;
38  float max_steer_angle = 70.0f;
39  float radius = 30.0f;
40  float max_brake_torque = 1500.0f;
41  float max_handbrake_torque = 3000.0f;
42  geom::Vector3D position = {0.0f, 0.0f, 0.0f};
43 
44  bool operator!=(const WheelPhysicsControl &rhs) const {
45  return
46  tire_friction != rhs.tire_friction ||
47  damping_rate != rhs.damping_rate ||
48  max_steer_angle != rhs.max_steer_angle ||
49  radius != rhs.radius ||
50  max_brake_torque != rhs.max_brake_torque ||
51  max_handbrake_torque != rhs.max_handbrake_torque ||
52  position != rhs.position;
53  }
54 
55  bool operator==(const WheelPhysicsControl &rhs) const {
56  return !(*this != rhs);
57  }
58 #ifdef LIBCARLA_INCLUDED_FROM_UE4
59 
61  : tire_friction(Wheel.TireFriction),
64  radius(Wheel.Radius),
67  position(Wheel.Position.X, Wheel.Position.Y, Wheel.Position.Z) {}
68 
69  operator FWheelPhysicsControl() const {
72  Wheel.DampingRate = damping_rate;
74  Wheel.Radius = radius;
77  Wheel.Position = {position.x, position.y, position.z};
78  return Wheel;
79  }
80 #endif
81 
82  MSGPACK_DEFINE_ARRAY(tire_friction,
83  damping_rate,
84  max_steer_angle,
85  radius,
86  max_brake_torque,
87  max_handbrake_torque,
88  position)
89  };
90 
91 }
92 }
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:99
bool operator==(const WheelPhysicsControl &rhs) const
bool operator!=(const WheelPhysicsControl &rhs) const
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, geom::Vector3D in_position)