CARLA
载入中...
搜索中...
未找到
Unreal
CarlaUE4
Plugins
Carla
Source
Carla
Actor
ActorROS2Handler.cpp
浏览该文件的文档.
1
// Copyright (c) 2023 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
#include "
ActorROS2Handler.h
"
8
9
#include "
Carla/Vehicle/CarlaWheeledVehicle.h
"
10
#include "
Carla/Vehicle/VehicleControl.h
"
11
12
void
ActorROS2Handler::operator()
(
carla::ros2::VehicleControl
&Source)
13
{
14
if
(!
_Actor
)
return
;
15
16
ACarlaWheeledVehicle
*
Vehicle
= Cast<ACarlaWheeledVehicle>(
_Actor
);
17
if
(!
Vehicle
)
return
;
18
19
// setup control values
20
FVehicleControl
NewControl;
21
NewControl.
Throttle
= Source.
throttle
;
22
NewControl.
Steer
= Source.
steer
;
23
NewControl.
Brake
= Source.
brake
;
24
NewControl.
bHandBrake
= Source.
hand_brake
;
25
NewControl.
bReverse
= Source.
reverse
;
26
NewControl.
bManualGearShift
= Source.
manual_gear_shift
;
27
NewControl.
Gear
= Source.
gear
;
28
29
Vehicle
->ApplyVehicleControl(NewControl, EVehicleInputPriority::User);
30
}
ActorROS2Handler.h
CarlaWheeledVehicle.h
Vehicle
@ Vehicle
Definition
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/EnvironmentObject.h:22
VehicleControl.h
ACarlaWheeledVehicle
Base class for CARLA wheeled vehicles.
Definition
CarlaWheeledVehicle.h:74
ActorROS2Handler::operator()
void operator()(carla::ros2::VehicleControl &Source)
Definition
ActorROS2Handler.cpp:12
ActorROS2Handler::_Actor
AActor * _Actor
Definition
ActorROS2Handler.h:23
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
carla::ros2::VehicleControl
Definition
ROS2CallbackData.h:23
carla::ros2::VehicleControl::reverse
bool reverse
Definition
ROS2CallbackData.h:28
carla::ros2::VehicleControl::manual_gear_shift
bool manual_gear_shift
Definition
ROS2CallbackData.h:30
carla::ros2::VehicleControl::hand_brake
bool hand_brake
Definition
ROS2CallbackData.h:27
carla::ros2::VehicleControl::throttle
float throttle
Definition
ROS2CallbackData.h:24
carla::ros2::VehicleControl::brake
float brake
Definition
ROS2CallbackData.h:26
carla::ros2::VehicleControl::steer
float steer
Definition
ROS2CallbackData.h:25
carla::ros2::VehicleControl::gear
int32_t gear
Definition
ROS2CallbackData.h:29
制作者
1.10.0