CARLA
 
载入中...
搜索中...
未找到
CarlaReplayerHelper.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
11#include "CarlaRecorderState.h"
20
21#include <unordered_map>
22
23class UCarlaEpisode;
24class FCarlaActor;
26
28{
29
30public:
31
32 // set the episode to use
33 void SetEpisode(UCarlaEpisode *ThisEpisode)
34 {
35 Episode = ThisEpisode;
36 }
37
38 // replay event for creating actor
39 std::pair<int, uint32_t> ProcessReplayerEventAdd(
40 FVector Location,
41 FVector Rotation,
43 uint32_t DesiredId,
44 bool bIgnoreHero,
45 bool bIgnoreSpectator,
46 bool ReplaySensors);
47
48 // replay event for removing actor
49 bool ProcessReplayerEventDel(uint32_t DatabaseId);
50
51 // replay event for parenting actors
52 bool ProcessReplayerEventParent(uint32_t ChildId, uint32_t ParentId);
53
54 // reposition actors
55 bool ProcessReplayerPosition(CarlaRecorderPosition Pos1, CarlaRecorderPosition Pos2, double Per, double DeltaTime, bool bIgnoreSpectator);
56
57 // replay event for traffic light state
59
60 // set the animation for Vehicles
62
63 // set the animation for Vehicles Wheels
65
66 // set the animation for walkers
68
69 // set the openings and closing of vehicle doors
71
72 // set the animation for bikers
74
75 // set the vehicle light
77
78 // set scene lights
80
81 // set walker bones
83
84 // replay finish
85 bool ProcessReplayerFinish(bool bApplyAutopilot, bool bIgnoreHero, std::unordered_map<uint32_t, bool> &IsHero);
86
87 // set the camera position to follow an actor
88 bool SetCameraPosition(uint32_t Id, FVector Offset, FQuat Rotation);
89
90 // set the velocity of the actor
91 void SetActorVelocity(FCarlaActor *CarlaActor, FVector Velocity);
92
93 // set the animation speed for walkers
94 void SetWalkerSpeed(uint32_t ActorId, float Speed);
95
96 void RemoveStaticProps();
97
98private:
99
101
102 std::pair<int, FCarlaActor*>TryToCreateReplayerActor(
103 FVector &Location,
104 FVector &Rotation,
105 FActorDescription &ActorDesc,
106 uint32_t DesiredId,
107 bool SpawnSensors);
108
109 FCarlaActor* FindTrafficLightAt(FVector Location);
110
111 // enable / disable physics for an actor
112 bool SetActorSimulatePhysics(FCarlaActor *CarlaActor, bool bEnabled);
113 // enable / disable autopilot for an actor
114 bool SetActorAutopilot(FCarlaActor *CarlaActor, bool bEnabled, bool bKeepState = false);
115};
void SetWalkerSpeed(uint32_t ActorId, float Speed)
std::pair< int, FCarlaActor * > TryToCreateReplayerActor(FVector &Location, FVector &Rotation, FActorDescription &ActorDesc, uint32_t DesiredId, bool SpawnSensors)
void ProcessReplayerWalkerBones(const CarlaRecorderWalkerBones &Walker)
bool ProcessReplayerFinish(bool bApplyAutopilot, bool bIgnoreHero, std::unordered_map< uint32_t, bool > &IsHero)
void SetActorVelocity(FCarlaActor *CarlaActor, FVector Velocity)
void ProcessReplayerAnimVehicleWheels(CarlaRecorderAnimWheels Vehicle)
void ProcessReplayerLightScene(CarlaRecorderLightScene LightScene)
void ProcessReplayerDoorVehicle(CarlaRecorderDoorVehicle DoorVehicle)
void ProcessReplayerAnimWalker(CarlaRecorderAnimWalker Walker)
void SetEpisode(UCarlaEpisode *ThisEpisode)
bool ProcessReplayerStateTrafficLight(CarlaRecorderStateTrafficLight State)
FCarlaActor * FindTrafficLightAt(FVector Location)
bool ProcessReplayerEventParent(uint32_t ChildId, uint32_t ParentId)
bool SetActorSimulatePhysics(FCarlaActor *CarlaActor, bool bEnabled)
void ProcessReplayerAnimVehicle(CarlaRecorderAnimVehicle Vehicle)
bool ProcessReplayerPosition(CarlaRecorderPosition Pos1, CarlaRecorderPosition Pos2, double Per, double DeltaTime, bool bIgnoreSpectator)
bool SetActorAutopilot(FCarlaActor *CarlaActor, bool bEnabled, bool bKeepState=false)
bool ProcessReplayerEventDel(uint32_t DatabaseId)
void ProcessReplayerLightVehicle(CarlaRecorderLightVehicle LightVehicle)
std::pair< int, uint32_t > ProcessReplayerEventAdd(FVector Location, FVector Rotation, CarlaRecorderActorDescription Description, uint32_t DesiredId, bool bIgnoreHero, bool bIgnoreSpectator, bool ReplaySensors)
void ProcessReplayerAnimBiker(CarlaRecorderAnimBiker Biker)
bool SetCameraPosition(uint32_t Id, FVector Offset, FQuat Rotation)
A view over an actor and its properties.
Definition CarlaActor.h:25
A simulation episode.
A description of a Carla Actor with all its variation.