|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
18 #ifndef NVMULTIOBJECTTRACKERLIB_MEMORYACCESSCOMMUNICATOR_HPP_
19 #define NVMULTIOBJECTTRACKERLIB_MEMORYACCESSCOMMUNICATOR_HPP_
21 #include "modules/MultiViewAssociator/ICommunicator.hpp"
22 #include "modules/NvMultiObjectTracker/NvTrackerParams.hpp"
48 this->
read(configRoot[moduleName]);
68 void read(
const YAML::Node &fn)
override
71 if(!fn.size()) {
return;}
73 for (YAML::const_iterator fit = fn.begin(); fit != fn.end(); ++fit)
75 std::string paramKey = fit->first.as<std::string>();
76 if (paramKey ==
"debugVerboseLevel") {
78 }
else if (paramKey ==
"communicatorType") {
80 }
else if (paramKey ==
"saveLog2File") {
82 }
else if (paramKey ==
"pubSubInfoConfigPath") {
84 }
else if (paramKey ==
"mqttProtoAdaptorConfigPath"){
86 }
else if (paramKey ==
"connTimeout") {
88 }
else if (paramKey ==
"waitForConnInterval") {
90 }
else {std::cerr <<
"Unknown parameter: " << paramKey <<
"\n"; }
131 std::map<
StreamId, std::shared_ptr<ICommunicator>> localInstanceCommunicators,
132 const std::string &sensorName =
""
148 void requestToSend(
const std::vector<Payload>& payloads)
override;
186 void commLog(std::string event,
Payload payload);
203 void initializePubSubInfo(std::map<
StreamId, std::shared_ptr<ICommunicator>> localInstanceCommunicators);
206 std::ofstream m_logFile;
207 std::ofstream m_commLatencyLogFile;
209 std::string m_configFilePath;
210 std::map<StreamId, std::shared_ptr<ICommunicator>> m_localInstancePeerCommunicators;
211 std::atomic<bool> m_isRunning, m_isFinished;
214 std::vector<CamId> m_peerCamIds;
216 std::deque<Payload> m_inPayloadBuffer, m_outPayloadBuffer;
217 std::mutex m_inPayloadBufferMutex, m_outPayloadBufferMutex;
218 std::mutex m_commMutex;
219 std::mutex m_commLatencyMutex;
222 #endif // NVMULTIOBJECTTRACKERLIB_MEMORYACCESSCOMMUNICATOR_HPP_
MessageType
Message kinds exchanged between multi-view tracker instances.
int m_debugVerboseLevel
Controls debug message verbosity.
std::string m_mqttProtoAdaptorConfigPath
Stores the MQTT protocol-adaptor configuration path.
void initialize(const StreamId streamId, system_clock::time_point start, std::map< StreamId, std::shared_ptr< ICommunicator >> localInstanceCommunicators, const std::string &sensorName="") override
Initialize the communicator and start its processing loop.
@ DUMMY_COMMUNICATOR
Selects the dummy communicator.
bool isInitialized() override
Return whether the communicator is initialized.
std::string m_pubSubInfoConfigPath
Path to publish/subscribe configuration file.
void get(Payload &payload) override
Get the message from buffer.
std::string CamId
Camera IDs are represented as strings to maintain consistency across different communicator types.
static std::string resolvePathRelativeToConfig(const std::string &configFilePath, const std::string &filePath)
Resolve a configured path relative to the tracker configuration file.
static const YAML::Node getConfigRoot(const std::string &configFilePath, const bool printMessage=false)
Load the root YAML node from a tracker configuration file.
COMMUNICATOR_TYPES getCommunicatorType() override
Return the communicator implementation type.
Store communicator configuration parameters.
~MemoryAccessCommunicator() override
Stop and destroy the memory-access communicator.
std::vector< CamId > getPeerCamIds() override
Return peer camera IDs from camera configuration.
constexpr const char * start
int m_saveLog2File
Indicates whether communicator logs are saved to a file.
COMMUNICATOR_TYPES m_communicatorType
Selects the communicator implementation.
Provides common loading helpers for tracker configuration parameters.
int m_waitForConnInterval
Specifies the interval between connection checks.
void broadcast(Payload payload) override
Broadcast message.
CommunicatorParams()
Initialize communicator parameters with default values.
Represent a message exchanged between multi-view tracker instances.
void processMessage(Payload payload) override
Process an incoming message.
void requestToSend(Payload payload) override
Request to send a message.
COMMUNICATOR_TYPES
Communicator implementations that can be selected by configuration.
CommunicatorParams(const std::string &configFilePath, const std::string moduleName)
Initialize communicator parameters from a configuration module.
MemoryAccessCommunicator class is responsible for handling the communication between the MultiViewAss...
Interface for the communicator.
MessageType available() override
Return the type of the next buffered message, or NONE when the buffer is empty.
void read(const YAML::Node &fn) override
Update communicator parameters from a YAML node.
CommunicatorParams(const YAML::Node &fn)
Initialize communicator parameters from a YAML node.
std::chrono::steady_clock::time_point time_point
int m_connTimeout
Specifies the connection timeout.
MemoryAccessCommunicator()
Construct an uninitialized memory-access communicator.
CamId getEgoCamId() override
Return the ego camera ID from camera configuration.
@ MEMORY_ACCESS_COMMUNICATOR
Selects the in-process memory-access communicator.