scansegment_threads.cpp
Go to the documentation of this file.
1 /*
2  * @brief scansegement_threads runs all threads to receive, convert and publish scan data for the sick 3D lidar multiScan136.
3  *
4  * Copyright (C) 2022 Ing.-Buero Dr. Michael Lehning, Hildesheim
5  * Copyright (C) 2022 SICK AG, Waldkirch
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  * All rights reserved.
20  *
21  * Redistribution and use in source and binary forms, with or without
22  * modification, are permitted provided that the following conditions are met:
23  *
24  * * Redistributions of source code must retain the above copyright
25  * notice, this list of conditions and the following disclaimer.
26  * * Redistributions in binary form must reproduce the above copyright
27  * notice, this list of conditions and the following disclaimer in the
28  * documentation and/or other materials provided with the distribution.
29  * * Neither the name of SICK AG nor the names of its
30  * contributors may be used to endorse or promote products derived from
31  * this software without specific prior written permission
32  * * Neither the name of Ing.-Buero Dr. Michael Lehning nor the names of its
33  * contributors may be used to endorse or promote products derived from
34  * this software without specific prior written permission
35  *
36  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
37  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
39  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
40  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
41  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
42  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
43  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
44  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
45  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46  * POSSIBILITY OF SUCH DAMAGE.
47  *
48  * Authors:
49  * Michael Lehning <michael.lehning@lehning.de>
50  *
51  * Copyright 2022 SICK AG
52  * Copyright 2022 Ing.-Buero Dr. Michael Lehning
53  *
54  */
65 
66 #define DELETE_PTR(p) do{if(p){delete(p);(p)=0;}}while(false)
67 
70 
71 /*
72  * @brief Initializes and runs all threads to receive, convert and publish scan data for the sick 3D lidar multiScan136.
73  */
74 int sick_scansegment_xd::run(rosNodePtr node, const std::string& scannerName)
75 {
76  // sick_scansegment_xd configuration
77  setDiagnosticStatus(SICK_DIAGNOSTIC_STATUS::INIT, "sick_scan_xd initializing " + scannerName);
79  if (!config.Init(node))
80  {
81  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd::run(" << config.scanner_type << "): Config::Init() failed, using default values.");
83  }
84  config.PrintConfig();
85  if (scannerName == SICK_SCANNER_SCANSEGMENT_XD_NAME)
86  {
87  std::vector<int> layer_elevation_table_mdeg = { 22710, 17560, 12480, 7510, 2490, 70, -2430, -7290, -12790, -17280, -21940, -26730, -31860, -34420, -37180, -42790 };
89  }
90  // Run sick_scansegment_xd (msgpack receive, convert and publish)
91  ROS_INFO_STREAM("sick_scansegment_xd (" << config.scanner_type << ") started.");
93  if(!msgpack_threads.start(config))
94  {
95  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd::run(" << config.scanner_type << "): sick_scansegment_xd::MsgPackThreads::start() failed");
97  }
98  // std::cout << "sick_scansegment_xd::run(" << __LINE__ << "): sick_scansegment_xd thread started" << std::endl;
99  // std::this_thread::sleep_for(std::chrono::seconds(1));
100  msgpack_threads.join();
101  // std::cout << "sick_scansegment_xd::run(" << __LINE__ << "): sick_scansegment_xd thread finished" << std::endl;
102  // Close sick_scansegment_xd
104  // std::cout << "sick_scansegment_xd::run() finishing" << std::endl;
105  if(!msgpack_threads.stop(false))
106  {
107  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd::run(" << config.scanner_type << "): sick_scansegment_xd::MsgPackThreads::stop() failed");
108  }
109  std::cout << "sick_scansegment_xd (" << config.scanner_type << ") finished." << std::endl;
111 }
112 
113 /*
114  * @brief MsgPackThreads constructor
115  */
117 : m_scansegment_thread(0), m_run_scansegment_thread(false)
118 {
119 }
120 
121 /*
122  * @brief MsgPackThreads destructor
123  */
125 {
126  stop(true);
127 }
128 
129 /*
130  * @brief Initializes msgpack receiver, converter and publisher and starts msgpack handling and publishing in a background thread.
131  */
133 {
134  m_config = config;
135  m_run_scansegment_thread = true;
136  m_scansegment_thread = new std::thread(&sick_scansegment_xd::MsgPackThreads::runThreadCb, this);
137  return true;
138 }
139 
140 /*
141  * @brief Stops running threads and closes msgpack receiver, converter and publisher.
142  */
144 {
145  m_run_scansegment_thread = false;
146  if(m_scansegment_thread)
147  {
148  if (do_join && m_scansegment_thread->joinable()) // std::thread::joinable() is false if std::thread::join finished successfull before
149  m_scansegment_thread->join();
150  delete m_scansegment_thread;
151  m_scansegment_thread = 0;
152  }
153  return true;
154 }
155 
156 /*
157  * @brief Joins running threads and returns after they finished.
158  */
160 {
161  if(m_scansegment_thread && m_scansegment_thread->joinable())
162  {
163  m_scansegment_thread->join();
164  std::cout << "sick_scansegment_xd::join(): sick_scansegment_xd thread finished" << std::endl;
165  }
166 }
167 
168 /*
169  * @brief Thread callback, initializes and runs msgpack receiver, converter and publisher.
170  */
172 {
173  ROS_INFO_STREAM("sick_scansegment_xd::runThreadCb() start (" << __LINE__ << "," << (int)m_run_scansegment_thread << "," << (int)rosOk() << ")...");
174  if(!m_config.logfolder.empty() && m_config.logfolder != ".")
175  {
176  sick_scansegment_xd::MkDir(m_config.logfolder);
177  }
178 
179  // (Re-)initialize and run loop
180  while(m_run_scansegment_thread && rosOk())
181  {
182  ROS_INFO_STREAM("sick_scansegment_xd initializing...");
183 
184  // Initialize udp receiver for scan data
185  sick_scansegment_xd::UdpReceiver* udp_receiver = 0;
186  while(m_run_scansegment_thread && rosOk() && udp_receiver == 0)
187  {
188  udp_receiver = new sick_scansegment_xd::UdpReceiver();
189  if(udp_receiver->Init(m_config.udp_sender, m_config.udp_port, m_config.udp_input_fifolength, m_config.verbose_level > 1, m_config.export_udp_msg, m_config.scandataformat, 0))
190  {
191  ROS_INFO_STREAM("sick_scansegment_xd: udp socket to " << m_config.udp_sender << ":" << m_config.udp_port << " initialized");
192  }
193  else
194  {
195  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd: UdpReceiver::Init(" << m_config.udp_sender << "," << m_config.udp_port << ") failed, retrying...");
196  delete(udp_receiver);
197  udp_receiver = 0;
198  std::this_thread::sleep_for(std::chrono::seconds(1));
199  }
200  }
201 
202  // Initialize udp receiver for imu data
203  sick_scansegment_xd::UdpReceiver* udp_receiver_imu = 0;
204  while(m_run_scansegment_thread && rosOk() && m_config.imu_enable && m_config.scandataformat == SCANDATA_COMPACT && udp_receiver_imu == 0)
205  {
206  udp_receiver_imu = new sick_scansegment_xd::UdpReceiver();
207  if(udp_receiver_imu->Init(m_config.udp_sender, m_config.imu_udp_port, m_config.udp_input_fifolength, m_config.verbose_level > 1, m_config.export_udp_msg, m_config.scandataformat, udp_receiver->Fifo())) // udp receiver for scan and imu data share the same fifo
208  {
209  // m_config.imu_latency_microsec
210  ROS_INFO_STREAM("sick_scansegment_xd: udp socket to " << m_config.udp_sender << ":" << m_config.imu_udp_port << " initialized");
211  }
212  else
213  {
214  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd: UdpReceiver::Init(" << m_config.udp_sender << "," << m_config.imu_udp_port << ") failed, retrying...");
215  delete(udp_receiver_imu);
216  udp_receiver_imu = 0;
217  std::this_thread::sleep_for(std::chrono::seconds(1));
218  }
219  }
220 
221  // Initialize msgpack converter and connect to udp receiver
222  ScanSegmentParserConfig scansegment_parser_config;
223  scansegment_parser_config.imu_latency_microsec = m_config.imu_latency_microsec;
224  sick_scansegment_xd::MsgPackConverter msgpack_converter(scansegment_parser_config, m_config.add_transform_xyz_rpy, udp_receiver->Fifo(), m_config.scandataformat, m_config.msgpack_output_fifolength, m_config.verbose_level > 1);
225  assert(udp_receiver->Fifo());
226  assert(msgpack_converter.Fifo());
227 
228  // Initialize msgpack exporter and publisher
229  sick_scansegment_xd::MsgPackExporter msgpack_exporter(udp_receiver->Fifo(), msgpack_converter.Fifo(), m_config.logfolder, m_config.export_csv, m_config.verbose_level > 0, m_config.measure_timing);
230  std::shared_ptr<sick_scansegment_xd::RosMsgpackPublisher> ros_msgpack_publisher = std::make_shared<sick_scansegment_xd::RosMsgpackPublisher>("sick_scansegment_xd", m_config);
231  msgpack_exporter.AddExportListener(ros_msgpack_publisher->ExportListener());
232  sick_scansegment_xd::MsgPackExportListenerIF* listener = ros_msgpack_publisher->ExportListener();
233 
234  // Run udp receiver, msgpack converter and msgpack exporter in background tasks
235  if (msgpack_converter.Start() && udp_receiver->Start() && msgpack_exporter.Start())
236  {
237  ROS_INFO_STREAM("MsgPackThreads: Start msgpack converter, udp receiver and msgpack exporter, receiving from " << m_config.udp_sender << ":" << m_config.udp_port);
238  if (udp_receiver_imu)
239  {
240  if (udp_receiver_imu->Start())
241  ROS_INFO_STREAM("MsgPackThreads: udp receiver for imu data started, receiving from " << m_config.udp_sender << ":" << m_config.imu_udp_port);
242  else
243  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd: UdpReceiver::Start() failed for imu data, not receiving imu udp packages from " << m_config.udp_sender << ":" << m_config.imu_udp_port);
244  }
245  }
246  else
247  {
248  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd: MsgPackConverter::Start(), UdpReceiver::Start() or MsgPackExporter::Start() failed, not receiving udp packages from " << m_config.udp_sender << ":" << m_config.udp_port);
249  }
250 
251  // Start SOPAS services (ROS-1 or ROS-2 only)
252  sick_scan_xd::SickScanCommonTcp* sopas_tcp = 0;
253  sick_scan_xd::SickScanServices* sopas_service = 0;
254  std::string scannerName = SICK_SCANNER_SCANSEGMENT_XD_NAME;
257  basic_param.setScannerName(scannerName);
258  bool multiscan_write_filtersettings = m_config.host_set_FREchoFilter || m_config.host_set_LFPangleRangeFilter || m_config.host_set_LFPlayerFilter;
259  if (m_config.start_sopas_service || m_config.send_sopas_start_stop_cmd || m_config.host_read_filtersettings || multiscan_write_filtersettings)
260  {
261  ROS_INFO_STREAM("MsgPackThreads: initializing sopas tcp (" << m_config.hostname << ":" << m_config.sopas_tcp_port << ", timeout:" << (0.001*m_config.sopas_timeout_ms) << ", binary:" << m_config.sopas_cola_binary << ")");
262  sopas_tcp = new sick_scan_xd::SickScanCommonTcp(m_config.hostname, m_config.sopas_tcp_port, m_config.sopas_timeout_ms, m_config.node, &parser, m_config.sopas_cola_binary ? 'B' : 'A');
263  ROS_INFO_STREAM("MsgPackThreads: initializing device");
264  sopas_tcp->init_device(); // sopas_tcp->init();
265  sopas_tcp->setReadTimeOutInMs(m_config.sopas_timeout_ms);
266  ROS_INFO_STREAM("MsgPackThreads: initializing services");
267  sopas_service = new sick_scan_xd::SickScanServices(m_config.node, sopas_tcp, &basic_param);
268  ROS_INFO_STREAM("MsgPackThreads: ros services initialized");
269  }
270  else
271  {
272  ROS_INFO_STREAM("MsgPackThreads: ros services not initialized");
273  }
274 
275  // Send SOPAS commands to read or optionally write filter settings for (FREchoFilter, LFPangleRangeFilter, LFPlayerFilter)
276  if ((m_config.host_read_filtersettings || multiscan_write_filtersettings) && sopas_tcp && sopas_service)
277  {
278  if (sopas_tcp->isConnected())
279  {
280  // Optionally send SOPAS commands to write filter settings
281  if (multiscan_write_filtersettings)
282  {
283  sopas_service->sendAuthorization();//(m_config.client_authorization_pw);
284  sopas_service->writeMultiScanFiltersettings((m_config.host_set_FREchoFilter ? m_config.host_FREchoFilter : -1),
285  (m_config.host_set_LFPangleRangeFilter ? m_config.host_LFPangleRangeFilter : ""),
286  (m_config.host_set_LFPlayerFilter ? m_config.host_LFPlayerFilter : ""),
287  (m_config.host_set_LFPintervalFilter ? m_config.host_LFPintervalFilter : ""),
288  m_config.scanner_type);
289  }
290  // Send SOPAS commands to read filter settings
291  sopas_service->sendAuthorization();//(m_config.client_authorization_pw);
292  if (sopas_service->queryMultiScanFiltersettings(m_config.host_FREchoFilter, m_config.host_LFPangleRangeFilter, m_config.host_LFPlayerFilter, m_config.msgpack_validator_filter_settings, m_config.scanner_type))
293  {
294  // Overwrite configured LFPangleRangeFilter and LFPlayerFilter with settings received from lidar
295  bool angle_range_filter_enabled = ros_msgpack_publisher->initLFPangleRangeFilterSettings(m_config.host_LFPangleRangeFilter);
296  bool layer_filter_enabled = ros_msgpack_publisher->initLFPlayerFilterSettings(m_config.host_LFPlayerFilter);
297  float fullframe_azimuth_min_deg = 0, fullframe_azimuth_max_deg = 0, fullframe_elevation_min_deg = 0, fullframe_elevation_max_deg = 0;
298  ros_msgpack_publisher->GetFullframeAngleRanges(fullframe_azimuth_min_deg, fullframe_azimuth_max_deg, fullframe_elevation_min_deg, fullframe_elevation_max_deg);
299  if (angle_range_filter_enabled)
300  ROS_INFO_STREAM("expected azimuth range of fullframe scans: " << std::fixed << std::setprecision(3) << fullframe_azimuth_min_deg << " to " << fullframe_azimuth_max_deg << " deg");
301  if (layer_filter_enabled)
302  ROS_INFO_STREAM("expected elevation range of fullframe scans: " << std::fixed << std::setprecision(3) << fullframe_elevation_min_deg << " to " << fullframe_elevation_max_deg << " deg");
303  }
304  }
305  else
306  {
307  ROS_WARN_STREAM("## ERROR sick_scansegment_xd: no sopas tcp connection, multiScan136 filter settings not queried or written");
308  }
309  }
310 
311  // Initialize msgpack validation
312  // sick_scansegment_xd::MsgPackValidator msgpack_validator; // default validator expecting full range (all echos, -PI <= azimuth <= PI, -PI/2 <= elevation <= PI/2, all segments)
313  sick_scansegment_xd::MsgPackValidator msgpack_validator = sick_scansegment_xd::MsgPackValidator(m_config.msgpack_validator_filter_settings.msgpack_validator_required_echos,
314  m_config.msgpack_validator_filter_settings.msgpack_validator_azimuth_start, m_config.msgpack_validator_filter_settings.msgpack_validator_azimuth_end,
315  m_config.msgpack_validator_filter_settings.msgpack_validator_elevation_start, m_config.msgpack_validator_filter_settings.msgpack_validator_elevation_end,
316  m_config.msgpack_validator_valid_segments, m_config.msgpack_validator_filter_settings.msgpack_validator_layer_filter,
317  m_config.msgpack_validator_verbose);
318  msgpack_converter.SetValidator(msgpack_validator, m_config.msgpack_validator_enabled, m_config.msgpack_validator_discard_msgpacks_out_of_bounds, m_config.msgpack_validator_check_missing_scandata_interval);
319 
320  ros_msgpack_publisher->SetActive(true);
321 
322  // Send SOPAS start command
323  if(sopas_tcp && sopas_service && m_config.send_sopas_start_stop_cmd)
324  {
325  if (sopas_tcp->isConnected())
326  {
327  sopas_service->sendAuthorization();//(m_config.client_authorization_pw);
328  if (!sopas_service->sendMultiScanStartCmd(m_config.udp_receiver_ip, m_config.udp_port, m_config.scanner_type, m_config.scandataformat, m_config.imu_enable, m_config.imu_udp_port,
329  m_config.performanceprofilenumber, m_config.check_udp_receiver_ip, m_config.check_udp_receiver_port))
330  {
331  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd: failed to send startup sequence, receiving scan data may fail.");
332  }
333  }
334  else
335  {
336  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd: no sopas tcp connection, startup sequence not sent, receiving scan data may fail.");
337  }
338  }
339 
340  // Run event loop and monitor tcp-connection and udp messages
342  s_sopas_service = sopas_service;
343  // Wait for first udp message with initial timeout after start in milliseconds, default: 60*1000
344  fifo_timestamp fifo_timestamp_start = fifo_clock::now();
345  while(m_run_scansegment_thread && rosOk() && sopas_tcp->isConnected()
346  && udp_receiver->Fifo()->TotalMessagesPushed() <= 1
347  && udp_receiver->Fifo()->Seconds(fifo_timestamp_start, fifo_clock::now()) <= 1.0e-3 * m_config.udp_timeout_ms_initial)
348  {
349  std::this_thread::sleep_for(std::chrono::milliseconds(10));
350  }
351  // Monitor udp packets with timeout for udp messages in milliseconds, default: 10*1000
352  while(m_run_scansegment_thread && rosOk())
353  {
354  if (!sopas_tcp->isConnected())
355  {
356  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd: sopas tcp connection lost, stop and reconnect...");
357  break;
358  }
359  if (udp_receiver->Fifo()->TotalMessagesPushed() <= 1 || udp_receiver->Fifo()->SecondsSinceLastPush() > 1.0e-3 * m_config.udp_timeout_ms)
360  {
361  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd: " << (udp_receiver->Fifo()->TotalMessagesPushed()) << " udp messages received");
362  if (udp_receiver->Fifo()->TotalMessagesPushed() > 0)
363  {
364  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd: last message received " << (udp_receiver->Fifo()->SecondsSinceLastPush()) << " seconds ago.");
365  }
366  ROS_ERROR_STREAM("## ERROR sick_scansegment_xd: udp receive timeout, stop and reconnect...");
367  break;
368  }
369  // Unit test for restart after timeout error - do not activate except for error and timeout simulation
370  // if (udp_receiver->Fifo()->TotalMessagesPushed() > 1000)
371  // {
372  // ROS_ERROR_STREAM("## ERROR sick_scansegment_xd: " << (udp_receiver->Fifo()->TotalMessagesPushed()) << " udp messages received, simulating timeout error, aborting to restart");
373  // break;
374  // }
376  std::this_thread::sleep_for(std::chrono::milliseconds(10));
377  }
378  s_sopas_service = 0;
379 
380  // Close msgpack receiver, converter and exporter
382  ROS_INFO_STREAM("sick_scansegment_xd finishing (" << __LINE__ << ")");
383  msgpack_exporter.RemoveExportListener(ros_msgpack_publisher->ExportListener());
384  msgpack_exporter.Stop();
385  if (udp_receiver_imu)
386  {
387  udp_receiver_imu->Close();
388  DELETE_PTR(udp_receiver_imu);
389  }
390  udp_receiver->Stop();
391  udp_receiver->Fifo()->Shutdown();
392  ROS_INFO_STREAM("sick_scansegment_xd finishing (" << __LINE__ << ")");
393 
394  // Send stop command (sopas and/or rest-api)
395  if(sopas_tcp && sopas_service && m_config.send_sopas_start_stop_cmd && sopas_tcp->isConnected())
396  {
397  std::cout << "sick_scansegment_xd exit: sending stop commands..." << std::endl;
398  sopas_service->sendAuthorization();//(m_config.client_authorization_pw);
399  sopas_service->sendMultiScanStopCmd(m_config.imu_enable);
400  std::cout << "sick_scansegment_xd exit: stop commands sent." << std::endl;
401  }
402  // Stop SOPAS services
403  std::cout << "sick_scansegment_xd exit: stopping services and communication (" << __LINE__ << ")" << std::endl;
404  try
405  {
406  // Shutdown, cleanup and exit
407  DELETE_PTR(sopas_service);
408  DELETE_PTR(sopas_tcp);
409  msgpack_converter.Fifo()->Shutdown();
410  msgpack_exporter.Close();
411  msgpack_converter.Close();
412  udp_receiver->Close();
413  DELETE_PTR(udp_receiver);
414  std::cout << "sick_scansegment_xd exit: services and communication stopped (" << __LINE__ << ")" << std::endl;
415  }
416  catch(const std::exception& e)
417  {
418  std::cerr << "## ERROR sick_scansegment_xd exit: exception \"" << e.what() << "\"" << std::endl;
419  }
420  }
421 
422  ROS_INFO_STREAM("sick_scansegment_xd::runThreadCb() finished (" << __LINE__ << ")");
423  return true;
424 }
sick_scansegment_xd::MsgPackThreads::stop
bool stop(bool do_join)
Definition: scansegment_threads.cpp:143
sick_scansegment_xd::MkDir
static bool MkDir(const std::string &folder)
Definition: include/sick_scansegment_xd/common.h:182
udp_sockets.h
sick_scansegment_xd::CompactDataParser::SetLayerElevationTable
static void SetLayerElevationTable(const std::vector< int > &layer_elevation_table_mdeg)
Definition: compact_parser.cpp:430
sick_scan_xd::SickScanServices
Definition: sick_scan_services.h:76
sick_scansegment_xd::UdpReceiver::Start
bool Start(void)
Definition: udp_receiver.cpp:150
sick_scan_xd::SickScanCommonTcp::isConnected
bool isConnected()
Definition: sick_scan_common_tcp.h:127
sick_scansegment_xd::MsgPackConverter::SetValidator
void SetValidator(sick_scansegment_xd::MsgPackValidator &msgpack_validator, bool msgpack_validator_enabled, bool discard_msgpacks_not_validated, int msgpack_validator_check_missing_scandata_interval)
Definition: msgpack_converter.cpp:144
sick_scan_xd::SickGenericParser
Definition: sick_generic_parser.h:239
ros_msgpack_publisher.h
scansegment_parser_output.h
INIT
@ INIT
Definition: sick_scan_logging.h:76
sick_scansegment_xd::MsgPackExporter::AddExportListener
void AddExportListener(sick_scansegment_xd::MsgPackExportListenerIF *listener)
Definition: msgpack_exporter.cpp:92
udp_receiver.h
scansegment_threads.h
sick_scansegment_xd::UdpReceiver::Init
bool Init(const std::string &udp_sender, int udp_port, int udp_input_fifolength=20, bool verbose=false, bool export_udp_msg=false, int scandataformat=1, PayloadFifo *fifo=0)
Definition: udp_receiver.cpp:106
sick_scansegment_xd::UdpReceiver::Close
void Close(void)
Definition: udp_receiver.cpp:172
sick_scansegment_xd::sopasService
sick_scan_xd::SickScanServices * sopasService()
Definition: scansegment_threads.cpp:69
sick_scansegment_xd::MsgPackExporter::Start
bool Start(void)
Definition: msgpack_exporter.cpp:127
ROS::now
ROS::Time now(void)
Definition: ros_wrapper.cpp:116
sick_scan_xd::ScannerBasicParam::setScannerName
void setScannerName(std::string _s)
Setting name (type) of scanner.
Definition: sick_generic_parser.cpp:86
sick_scansegment_xd::MsgPackThreads::join
void join(void)
Definition: scansegment_threads.cpp:159
compact_parser.h
sick_scansegment_xd::ScanSegmentParserConfig::imu_latency_microsec
int imu_latency_microsec
Definition: scansegment_parser_output.h:94
ROS_WARN_STREAM
#define ROS_WARN_STREAM(args)
Definition: sick_scan_logging.h:123
ROS_INFO_STREAM
#define ROS_INFO_STREAM(...)
Definition: sick_scan_ros2_example.cpp:71
setDiagnosticStatus
void setDiagnosticStatus(SICK_DIAGNOSTIC_STATUS status_code, const std::string &status_message)
Definition: sick_generic_laser.cpp:302
sick_scan_xd::SickScanCommonTcp::init_device
virtual int init_device()
Definition: sick_scan_common_tcp.cpp:598
polar_to_cartesian_pointcloud_ros1.node
node
Definition: polar_to_cartesian_pointcloud_ros1.py:81
msgpack_validator.h
sick_scansegment_xd::MsgPackConverter::Fifo
sick_scansegment_xd::Fifo< ScanSegmentParserOutput > * Fifo(void)
Definition: msgpack_converter.h:132
sick_scansegment_xd::MsgPackThreads::start
bool start(const sick_scansegment_xd::Config &config)
Definition: scansegment_threads.cpp:132
imu_delay_tester.parser
parser
Definition: imu_delay_tester.py:116
OK
@ OK
Definition: sick_scan_logging.h:73
sick_scansegment_xd::Fifo::Seconds
static double Seconds(const fifo_timestamp &timestamp_start, const fifo_timestamp &timestamp_end=fifo_clock::now())
Definition: fifo.h:166
sick_scansegment_xd::MsgPackThreads::MsgPackThreads
MsgPackThreads()
Definition: scansegment_threads.cpp:116
sick_scansegment_xd::MsgPackThreads::~MsgPackThreads
~MsgPackThreads()
Definition: scansegment_threads.cpp:124
sick_scansegment_xd::MsgPackExporter::RemoveExportListener
void RemoveExportListener(sick_scansegment_xd::MsgPackExportListenerIF *listener)
Definition: msgpack_exporter.cpp:101
sick_scansegment_xd::MsgPackExporter
Definition: msgpack_exporter.h:87
sick_scan_xd::ExitSuccess
@ ExitSuccess
Definition: abstract_parser.h:46
sick_scansegment_xd::MsgPackThreads::runThreadCb
bool runThreadCb(void)
Definition: scansegment_threads.cpp:171
ros::NodeHandle
fifo_timestamp
std::chrono::time_point< std::chrono::system_clock > fifo_timestamp
Definition: fifo.h:68
sick_scansegment_xd::Config
Definition: config.h:84
sick_scansegment_xd::Fifo::SecondsSinceLastPush
virtual double SecondsSinceLastPush()
Definition: fifo.h:157
sick_scansegment_xd::Fifo::TotalMessagesPushed
virtual size_t TotalMessagesPushed()
Definition: fifo.h:148
msgpack_converter.h
s_sopas_service
sick_scan_xd::SickScanServices * s_sopas_service
Definition: scansegment_threads.cpp:68
msgpack_exporter.h
DELETE_PTR
#define DELETE_PTR(p)
Definition: scansegment_threads.cpp:66
sick_scan_xd::SickScanCommon::setReadTimeOutInMs
void setReadTimeOutInMs(int timeOutInMs)
set timeout in milliseconds
Definition: sick_scan_common.cpp:1463
sick_scansegment_xd::MsgPackExporter::Stop
void Stop(void)
Definition: msgpack_exporter.cpp:137
sick_scan_services.h
sick_scansegment_xd::MsgPackThreads
Definition: scansegment_threads.h:76
sick_scansegment_xd::MsgPackExportListenerIF
Definition: msgpack_exporter.h:73
sick_scan_xd::SickScanCommonTcp
Definition: sick_scan_common_tcp.h:91
sick_scansegment_xd::MsgPackExporter::Close
void Close(void)
Definition: msgpack_exporter.cpp:145
sick_scansegment_xd::MsgPackConverter::Start
bool Start(void)
Definition: msgpack_converter.cpp:106
ROS::seconds
double seconds(ROS::Duration duration)
Definition: ros_wrapper.cpp:180
sick_scansegment_xd::MsgPackConverter
Definition: msgpack_converter.h:84
sick_scansegment_xd::MsgPackValidator
Definition: msgpack_validator.h:201
ROS_ERROR_STREAM
#define ROS_ERROR_STREAM(...)
Definition: sick_scan_ros2_example.cpp:72
sick_scansegment_xd::ScanSegmentParserConfig
Definition: scansegment_parser_output.h:91
sick_scan_xd::SickScanServices::sendAuthorization
bool sendAuthorization()
Definition: sick_scan_services.cpp:372
rosOk
bool rosOk(void)
Definition: sick_ros_wrapper.h:206
sick_scan_xd::ScannerBasicParam
Definition: sick_generic_parser.h:110
SICK_SCANNER_SCANSEGMENT_XD_NAME
#define SICK_SCANNER_SCANSEGMENT_XD_NAME
Definition: sick_generic_parser.h:82
config
config
EXIT
@ EXIT
Definition: sick_scan_logging.h:77
sick_scansegment_xd::Fifo::Shutdown
virtual void Shutdown(void)
Definition: fifo.h:138
SCANDATA_COMPACT
#define SCANDATA_COMPACT
Definition: include/sick_scansegment_xd/common.h:93
sick_scansegment_xd::MsgPackConverter::Close
void Close(void)
Definition: msgpack_converter.cpp:116
sick_scan_xd::ExitError
@ ExitError
Definition: abstract_parser.h:47
sick_scansegment_xd::UdpReceiver
Definition: udp_receiver.h:78
sick_scansegment_xd::run
int run(rosNodePtr node, const std::string &scannerName)
Definition: scansegment_threads.cpp:74
sick_scansegment_xd::UdpReceiver::Fifo
PayloadFifo * Fifo(void)
Definition: udp_receiver.h:122
sick_scansegment_xd::UdpReceiver::Stop
void Stop(bool do_join=true)
Definition: udp_receiver.cpp:160


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:10