CARLA
Unreal
CarlaUE4
Plugins
Carla
Source
Carla
Actor
ActorROS2Handler.cpp
Go to the documentation of this file.
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
}
ACarlaWheeledVehicle::ApplyVehicleControl
void ApplyVehicleControl(const FVehicleControl &Control, EVehicleInputPriority Priority)
Definition:
CarlaWheeledVehicle.h:210
VehicleControl.h
FVehicleControl
Definition:
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:12
FVehicleControl::bManualGearShift
bool bManualGearShift
Definition:
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:32
ActorROS2Handler::_Actor
AActor * _Actor
Definition:
ActorROS2Handler.h:23
FVehicleControl::Steer
float Steer
Definition:
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:20
ELightType::Vehicle
carla::ros2::VehicleControl::reverse
bool reverse
Definition:
ROS2CallbackData.h:28
carla::ros2::VehicleControl
Definition:
ROS2CallbackData.h:22
FVehicleControl::Gear
int32 Gear
Definition:
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:35
carla::ros2::VehicleControl::manual_gear_shift
bool manual_gear_shift
Definition:
ROS2CallbackData.h:30
carla::ros2::VehicleControl::steer
float steer
Definition:
ROS2CallbackData.h:25
FVehicleControl::Throttle
float Throttle
Definition:
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:17
carla::ros2::VehicleControl::gear
int32_t gear
Definition:
ROS2CallbackData.h:29
CarlaWheeledVehicle.h
ActorROS2Handler::operator()
void operator()(carla::ros2::VehicleControl &Source)
Definition:
ActorROS2Handler.cpp:12
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::brake
float brake
Definition:
ROS2CallbackData.h:26
ActorROS2Handler.h
carla::ros2::VehicleControl::throttle
float throttle
Definition:
ROS2CallbackData.h:24
ACarlaWheeledVehicle
Base class for CARLA wheeled vehicles.
Definition:
CarlaWheeledVehicle.h:72
FVehicleControl::Brake
float Brake
Definition:
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleControl.h:23
carla::ros2::VehicleControl::hand_brake
bool hand_brake
Definition:
ROS2CallbackData.h:27
Generated by
1.8.13