CARLA
 
载入中...
搜索中...
未找到
CustomV2XSensor.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
13#include "V2X/PathLossModel.h"
14#include <list>
15#include <map>
16#include "CustomV2XSensor.generated.h"
17
18
19UCLASS()
20class CARLA_API ACustomV2XSensor : public ASensor
21{
22 GENERATED_BODY()
23
24 using FV2XData = carla::sensor::data::CustomV2XDataS;
25 using V2XDataList = std::vector<carla::sensor::data::CustomV2XData>;
26 using ActorV2XDataMap = std::map<AActor *, carla::sensor::data::CustomV2XData>;
27
28public:
29 ACustomV2XSensor(const FObjectInitializer &ObjectInitializer);
30
31 static FActorDefinition GetSensorDefinition();
32
33 void Set(const FActorDescription &ActorDescription) override;
34 void SetPropagationParams(const float TransmitPower,
35 const float ReceiverSensitivity,
36 const float Frequency,
37 const float combined_antenna_gain,
38 const float path_loss_exponent,
39 const float reference_distance_fspl,
40 const float filter_distance,
41 const bool use_etsi_fading,
42 const float custom_fading_stddev);
43 void SetScenario(EScenario scenario);
44 void SetPathLossModel(const EPathLossModel path_loss_model);
45
46 virtual void PrePhysTick(float DeltaSeconds) override;
47 virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime) override;
48 void SetOwner(AActor *Owner) override;
49
50 void Send(const FString message);
51
52private:
53 static std::list<AActor *> mV2XActorContainer;
54 PathLossModel *PathLossModelObj;
55
56 //store data
57 static ACustomV2XSensor::ActorV2XDataMap mActorV2XDataMap;
58 FV2XData mV2XData;
59
60 //write
61 void WriteMessageToV2XData(const ACustomV2XSensor::V2XDataList &msg_received_power_list);
62
63 //msg gen
64 void CreateITSPduHeader(CustomV2XM_t &message);
65 CustomV2XM_t CreateCustomV2XMessage();
66 const long mProtocolVersion = 2;
67 const long mMessageId = ITSContainer::messageID_custom;
68 long mStationId;
69 std::string mMessageData;
70 bool mMessageDataChanged = false;
71 constexpr static uint16_t data_size = sizeof(CustomV2XM_t::message);
72
73};
EScenario
EPathLossModel
std::map< AActor *, carla::sensor::data::CustomV2XData > ActorV2XDataMap
std::vector< carla::sensor::data::CustomV2XData > V2XDataList
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.