CARLA
ObstacleDetectionSensor.h
Go to the documentation of this file.
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/Sensor/Sensor.h"
12 #include "ObstacleDetectionSensor.generated.h"
13 
14 class UCarlaEpisode;
15 
16 /// A sensor to register collisions.
17 UCLASS()
18 class CARLA_API AObstacleDetectionSensor : public ASensor
19 {
20  GENERATED_BODY()
21 
22 public:
23 
24  static FActorDefinition GetSensorDefinition();
25 
26  AObstacleDetectionSensor(const FObjectInitializer &ObjectInitializer);
27 
28  void Set(const FActorDescription &Description) override;
29 
30  virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds) override;
31 
32 private:
33 
34  UFUNCTION()
35  void OnObstacleDetectionEvent(
36  AActor *Actor,
37  AActor *OtherActor,
38  float Distance,
39  const FHitResult &Hit);
40 
41 private:
42 
43  float Distance;
44 
45  float HitRadius;
46 
47  bool bOnlyDynamics = false;
48 
49  bool bDebugLineTrace = false;
50 };
A sensor to register collisions.
A definition of a Carla Actor with all the variation and attributes.
carla::SharedPtr< cc::Actor > Actor
A simulation episode.
Definition: CarlaEpisode.h:38
A description of a Carla Actor with all its variation.