CARLA
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 
11 
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 }
void ApplyVehicleControl(const FVehicleControl &Control, EVehicleInputPriority Priority)
void operator()(carla::ros2::VehicleControl &Source)
Base class for CARLA wheeled vehicles.