CARLA
 
载入中...
搜索中...
未找到
V2XSensor.h
浏览该文件的文档.
1// Copyright (c) 2024 Institut fuer Technik der Informationsverarbeitung (ITIV) at the
2// Karlsruhe Institute of Technology
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
10
14#include "V2X/CaService.h"
15#include "V2X/PathLossModel.h"
16#include <list>
17#include <map>
18#include "V2XSensor.generated.h"
19
20UCLASS()
21class CARLA_API AV2XSensor : public ASensor
22{
23 GENERATED_BODY()
24
25 using FV2XData = carla::sensor::data::CAMDataS;
26 using ActorV2XDataMap = std::map<AActor *, carla::sensor::data::CAMData>;
27 using V2XDataList = std::vector<carla::sensor::data::CAMData>;
28
29public:
30 AV2XSensor(const FObjectInitializer &ObjectInitializer);
31
32 static FActorDefinition GetSensorDefinition();
33
34 void Set(const FActorDescription &ActorDescription) override;
35
36 void SetCaServiceParams(const float GenCamMin, const float GenCamMax, const bool FixedRate);
37 void SetPropagationParams(const float TransmitPower,
38 const float ReceiverSensitivity,
39 const float Frequency,
40 const float combined_antenna_gain,
41 const float path_loss_exponent,
42 const float reference_distance_fspl,
43 const float filter_distance,
44 const bool use_etsi_fading,
45 const float custom_fading_stddev);
46 void SetScenario(EScenario scenario);
47
48 // CAM params
49 void SetAccelerationStandardDeviation(const FVector &Vec);
50 void SetGNSSDeviation(const float noise_lat_stddev,
51 const float noise_lon_stddev,
52 const float noise_alt_stddev,
53 const float noise_head_stddev,
54 const float noise_lat_bias,
55 const float noise_lon_bias,
56 const float noise_alt_bias,
57 const float noise_head_bias);
58 void SetVelDeviation(const float noise_vel_stddev);
59 void SetYawrateDeviation(const float noise_yawrate_stddev, const float noise_yawrate_bias);
60 void SetPathLossModel(const EPathLossModel path_loss_model);
61
62 virtual void PrePhysTick(float DeltaSeconds) override;
63 virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime) override;
64 void SetOwner(AActor *Owner) override;
65
66private:
67 static std::list<AActor *> mV2XActorContainer;
68 CaService *CaServiceObj;
69 PathLossModel *PathLossModelObj;
70
71 // store data
72 static ActorV2XDataMap mActorV2XDataMap;
73 FV2XData mV2XData;
74
75 // write
76 void WriteMessageToV2XData(const V2XDataList &msg_received_power_list);
77};
EScenario
EPathLossModel
std::map< AActor *, carla::sensor::data::CAMData > ActorV2XDataMap
Definition V2XSensor.h:26
std::vector< carla::sensor::data::CAMData > V2XDataList
Definition V2XSensor.h:27
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
A definition of a Carla Actor with all the variation and attributes.
A description of a Carla Actor with all its variation.