RTC Toolkit  1.0.0
mudpiProcessor.hpp
Go to the documentation of this file.
1 
12 #ifndef RTCTK_REUSABLECOMPONENT_TELREPUB_MUDPIPROCESSOR_HPP_
13 #define RTCTK_REUSABLECOMPONENT_TELREPUB_MUDPIPROCESSOR_HPP_
14 
15 #include <atomic>
16 #include <boost/asio.hpp>
17 #include <thread>
18 
19 #include "mudpi.h"
20 #include "mudpiProcessingError.hpp"
21 
22 #include "ddsPubThread.hpp"
23 
24 namespace rtctk::telRepub {
25 
38  uint32_t m_statistic_msg_update_rate;
39 
40  bool m_in_synch = true;
41  uint32_t m_frame_id_errors = 0;
42  uint32_t m_sample_id_errors = 0;
43 
44  std::atomic<uint32_t> m_frame_id_errors_per_topic = 0;
45  std::atomic<uint32_t> m_sample_id_errors_per_topic = 0;
46 
50  PubThreadBase<>& m_pub;
51 
52  RepubBuf<rtctk::AgnosticTopic>* m_repub_buf;
53  rtctk::AgnosticTopic* m_dds_topic;
54 
55  uint32_t m_total_buf_len; // changed from 16 bit for Pixel topic (DOR)
56 #ifdef USE_RTI_DDS
57  topicT m_topicBuf;
58 #endif
59 
60  mudpi::uint32_t m_last_sample_id = -1; // TBC!!!
61  mudpi::timestamp_t m_last_timestamp = 0.0;
62 
63  mudpi::uint16_t m_last_frame_id = 0;
64  mudpi::uint16_t m_num_frames = -1; // TBC !!!
65 
69  struct timeval m_start_time;
70  struct timeval m_now_time;
71  double m_elapsed_time;
72  double m_pck_per_sec_est;
73 
74  std::atomic<uint32_t> m_recvd = 0;
75  mudpi::uint16_t m_topic_id = 0;
76  mudpi::uint32_t m_sample_id = 0;
77  mudpi::uint16_t m_frame_id = 0;
78 
79  time_t m_ctt = {};
80 
81  log4cplus::Logger m_logger;
82 
83 public:
91  explicit MudpiProcessor(PubThreadBase<>& pub, uint32_t statisticMsgUpdateRate = 5000);
92 
96  MudpiProcessor(MudpiProcessor const& rhs);
97 
99 
106  std::error_code ProcessMudpi(mudpi::mudpiHeader* packet);
107 
111  void Statistics();
112 }; // MudpiProcessor
113 
114 } // namespace rtctk::telRepub
115 
116 #endif // RTCTK_REUSABLECOMPONENT_TELREPUB_MUDPIPROCESSOR_HPP_
rtctk::telRepub::MudpiProcessor::~MudpiProcessor
~MudpiProcessor()
Definition: mudpiProcessor.cpp:69
ddsPubThread.hpp
DDS agnostic topic publioshing thread.
rtctk::telRepub
Definition: ddsPubThread.hpp:27
mudpi::mudpiHeader
MUDPI header definition.
Definition: mudpi.h:27
mudpi::uint16_t
unsigned short uint16_t
Definition: mudpi.h:15
rtctk::telRepub::MudpiProcessor::MudpiProcessor
MudpiProcessor(PubThreadBase<> &pub, uint32_t statisticMsgUpdateRate=5000)
MUDPI Processor constructor.
Definition: mudpiProcessor.cpp:22
mudpi::timestamp_t
double timestamp_t
Definition: mudpi.h:18
rtctk::AgnosticTopic
This class represents the structure AgnosticTopic defined by the user in the IDL file.
Definition: agnostictopicif.h:72
rtctk::telRepub::RepubBuf< rtctk::AgnosticTopic >
rtctk::telRepub::MudpiProcessor::Statistics
void Statistics()
Dump statistics.
Definition: mudpiProcessor.cpp:279
rtctk::telRepub::MudpiProcessor
Processing MUDPI data received by UDP receiver: rtctk::telRepub::UdpReceiver.
Definition: mudpiProcessor.hpp:34
rtctk::telRepub::topicT
structure where aggregation of the MUDPI topic payload is done, and put to the queue for DDS publishi...
Definition: ddsPubThread.hpp:38
mudpi::uint32_t
unsigned int uint32_t
Definition: mudpi.h:16
rtctk::telRepub::MudpiProcessor::ProcessMudpi
std::error_code ProcessMudpi(mudpi::mudpiHeader *packet)
Here the actual processing is done (frame by frame (MUDPI datagram)).
Definition: mudpiProcessor.cpp:77
mudpiProcessingError.hpp
MUDPI processor error codes.
rtctk::telRepub::PubThreadBase
DDS publisher thread class that provides queue with aggregated topic to be published by DDS.
Definition: ddsPubThread.hpp:50