CARLA
 
载入中...
搜索中...
未找到
LibCarla/source/carla/rpc/AckermannControllerSettings.h
浏览该文件的文档.
1// Copyright (c) 2021 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
11#ifdef LIBCARLA_INCLUDED_FROM_UE4
13#endif // LIBCARLA_INCLUDED_FROM_UE4
14
15namespace carla {
16namespace rpc {
17
19 public:
20
22
36
37 float speed_kp = 0.0f;
38 float speed_ki = 0.0f;
39 float speed_kd = 0.0f;
40 float accel_kp = 0.0f;
41 float accel_ki = 0.0f;
42 float accel_kd = 0.0f;
43
44#ifdef LIBCARLA_INCLUDED_FROM_UE4
45
47 : speed_kp(Settings.SpeedKp),
48 speed_ki(Settings.SpeedKi),
49 speed_kd(Settings.SpeedKd),
50 accel_kp(Settings.AccelKp),
51 accel_ki(Settings.AccelKi),
52 accel_kd(Settings.AccelKd) {}
53
56 Settings.SpeedKp = speed_kp;
57 Settings.SpeedKi = speed_ki;
58 Settings.SpeedKd = speed_kd;
59 Settings.AccelKp = accel_kp;
60 Settings.AccelKi = accel_ki;
61 Settings.AccelKd = accel_kd;
62 return Settings;
63 }
64
65#endif // LIBCARLA_INCLUDED_FROM_UE4
66
67 bool operator!=(const AckermannControllerSettings &rhs) const {
68 return
69 speed_kp != rhs.speed_kp ||
70 speed_ki != rhs.speed_ki ||
71 speed_kd != rhs.speed_kd ||
72 accel_kp != rhs.accel_kp ||
73 accel_ki != rhs.accel_ki ||
74 accel_kd != rhs.accel_kd;
75 }
76
77 bool operator==(const AckermannControllerSettings &rhs) const {
78 return !(*this != rhs);
79 }
80
88 );
89 };
90
91} // namespace rpc
92} // namespace carla
AckermannControllerSettings(const FAckermannControllerSettings &Settings)
MSGPACK_DEFINE_ARRAY(speed_kp, speed_ki, speed_kd, accel_kp, accel_ki, accel_kd)
AckermannControllerSettings(float speed_kp, float speed_ki, float speed_kd, float accel_kp, float accel_ki, float accel_kd)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133