CARLA
载入中...
搜索中...
未找到
LibCarla
source
carla
rpc
LibCarla/source/carla/rpc/VehicleControl.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
9
#include "
carla/MsgPack.h
"
10
11
#ifdef LIBCARLA_INCLUDED_FROM_UE4
12
#include <
compiler/enable-ue4-macros.h
>
13
#include "
Carla/Vehicle/VehicleControl.h
"
14
#include <
compiler/disable-ue4-macros.h
>
15
#endif
// LIBCARLA_INCLUDED_FROM_UE4
16
17
namespace
carla
{
18
namespace
rpc {
19
20
class
VehicleControl
{
21
public
:
22
23
VehicleControl
() =
default
;
24
25
VehicleControl
(
26
float
in_throttle,
27
float
in_steer,
28
float
in_brake,
29
bool
in_hand_brake,
30
bool
in_reverse,
31
bool
in_manual_gear_shift,
32
int32_t in_gear)
33
:
throttle
(in_throttle),
34
steer
(in_steer),
35
brake
(in_brake),
36
hand_brake
(in_hand_brake),
37
reverse
(in_reverse),
38
manual_gear_shift
(in_manual_gear_shift),
39
gear
(in_gear) {}
40
41
float
throttle
= 0.0f;
42
float
steer
= 0.0f;
43
float
brake
= 0.0f;
44
bool
hand_brake
=
false
;
45
bool
reverse
=
false
;
46
bool
manual_gear_shift
=
false
;
47
int32_t
gear
= 0;
48
49
#ifdef LIBCARLA_INCLUDED_FROM_UE4
50
51
VehicleControl
(
const
FVehicleControl
&Control)
52
:
throttle
(Control.Throttle),
53
steer
(Control.Steer),
54
brake
(Control.Brake),
55
hand_brake
(Control.bHandBrake),
56
reverse
(Control.bReverse),
57
manual_gear_shift
(Control.bManualGearShift),
58
gear
(Control.Gear) {}
59
60
operator
FVehicleControl
()
const
{
61
FVehicleControl
Control;
62
Control.
Throttle
=
throttle
;
63
Control.
Steer
=
steer
;
64
Control.
Brake
=
brake
;
65
Control.
bHandBrake
=
hand_brake
;
66
Control.
bReverse
=
reverse
;
67
Control.
bManualGearShift
=
manual_gear_shift
;
68
Control.
Gear
=
gear
;
69
return
Control;
70
}
71
72
#endif
// LIBCARLA_INCLUDED_FROM_UE4
73
74
bool
operator!=
(
const
VehicleControl
&rhs)
const
{
75
return
76
throttle
!= rhs.
throttle
||
77
steer
!= rhs.
steer
||
78
brake
!= rhs.
brake
||
79
hand_brake
!= rhs.
hand_brake
||
80
reverse
!= rhs.
reverse
||
81
manual_gear_shift
!= rhs.
manual_gear_shift
||
82
gear
!= rhs.
gear
;
83
}
84
85
bool
operator==
(
const
VehicleControl
&rhs)
const
{
86
return
!(*
this
!= rhs);
87
}
88
89
MSGPACK_DEFINE_ARRAY
(
90
throttle
,
91
steer
,
92
brake
,
93
hand_brake
,
94
reverse
,
95
manual_gear_shift
,
96
gear
);
97
};
98
99
}
// namespace rpc
100
}
// namespace carla
MsgPack.h
VehicleControl.h
carla::rpc::VehicleControl
Definition
LibCarla/source/carla/rpc/VehicleControl.h:20
carla::rpc::VehicleControl::operator!=
bool operator!=(const VehicleControl &rhs) const
Definition
LibCarla/source/carla/rpc/VehicleControl.h:74
carla::rpc::VehicleControl::manual_gear_shift
bool manual_gear_shift
Definition
LibCarla/source/carla/rpc/VehicleControl.h:46
carla::rpc::VehicleControl::gear
int32_t gear
Definition
LibCarla/source/carla/rpc/VehicleControl.h:47
carla::rpc::VehicleControl::steer
float steer
Definition
LibCarla/source/carla/rpc/VehicleControl.h:42
carla::rpc::VehicleControl::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(throttle, steer, brake, hand_brake, reverse, manual_gear_shift, gear)
carla::rpc::VehicleControl::operator==
bool operator==(const VehicleControl &rhs) const
Definition
LibCarla/source/carla/rpc/VehicleControl.h:85
carla::rpc::VehicleControl::VehicleControl
VehicleControl()=default
carla::rpc::VehicleControl::throttle
float throttle
Definition
LibCarla/source/carla/rpc/VehicleControl.h:41
carla::rpc::VehicleControl::VehicleControl
VehicleControl(float in_throttle, float in_steer, float in_brake, bool in_hand_brake, bool in_reverse, bool in_manual_gear_shift, int32_t in_gear)
Definition
LibCarla/source/carla/rpc/VehicleControl.h:25
carla::rpc::VehicleControl::reverse
bool reverse
Definition
LibCarla/source/carla/rpc/VehicleControl.h:45
carla::rpc::VehicleControl::VehicleControl
VehicleControl(const FVehicleControl &Control)
Definition
LibCarla/source/carla/rpc/VehicleControl.h:51
carla::rpc::VehicleControl::hand_brake
bool hand_brake
Definition
LibCarla/source/carla/rpc/VehicleControl.h:44
carla::rpc::VehicleControl::brake
float brake
Definition
LibCarla/source/carla/rpc/VehicleControl.h:43
disable-ue4-macros.h
enable-ue4-macros.h
carla
This file contains definitions of common data structures used in traffic manager.
Definition
Carla.cpp:133
FVehicleControl
Definition
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:13
FVehicleControl::Steer
float Steer
Definition
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:20
FVehicleControl::Throttle
float Throttle
Definition
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:17
FVehicleControl::Brake
float Brake
Definition
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:23
FVehicleControl::Gear
int32 Gear
Definition
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:35
FVehicleControl::bManualGearShift
bool bManualGearShift
Definition
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:32
FVehicleControl::bHandBrake
bool bHandBrake
Definition
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:26
FVehicleControl::bReverse
bool bReverse
Definition
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:29
制作者
1.10.0