SVHFeedbackPollingThread.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of the SCHUNK SVH Driver suite.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2014 SCHUNK Mobile Greifsysteme GmbH, Lauffen/Neckar Germany
12 // © Copyright 2014 FZI Forschungszentrum Informatik, Karlsruhe, Germany
13 //
14 // -- END LICENSE BLOCK ------------------------------------------------
15 
16 //----------------------------------------------------------------------
29 //----------------------------------------------------------------------
30 #include <driver_svh/Logging.h>
32 
33 namespace driver_svh {
34 
36  : PeriodicThread("SVHReceiveThread", period),
37  m_finger_manager(finger_manager)
38 {
39 }
40 
42 {
43  while (execute())
44  {
45  if (m_finger_manager != NULL)
46  {
48  {
50 
51  // This would inform a websocket server about new states, disregard that.
52  #ifdef _IC_BUILDER_ICL_COMM_WEBSOCKET_
53  m_finger_manager->updateWebSocket();
54  #endif // _IC_BUILDER_ICL_COMM_WEBSOCKET_
55  }
56  else
57  {
58  LOGGING_WARNING_C(DriverSVH, SVHFeedbackPollingThread, "SCHUNK five finger hand is not connected!" << endl);
59  }
60  }
61  else
62  {
63  LOGGING_WARNING_C(DriverSVH, SVHFeedbackPollingThread, "Pointer to FingerManager is NULL!" << endl);
64  }
65 
66  // Wait for the thread period so that the timing is in sync.
67  waitPeriod();
68  }
69 }
70 
71 }
SVHFingerManager * m_finger_manager
pointer to SCHUNK five finger hand fingermanager object
SVHFeedbackPollingThread(const TimeSpan &period, SVHFingerManager *finger_manager)
SVHFeedbackPollingThread constructs a new thread to poll the feedback of all fingers periodically...
bool isConnected()
returns connected state of finger manager
#define LOGGING_WARNING_C(streamname, classname, arg)
virtual void run()
run method of the thread
ThreadStream & endl(ThreadStream &stream)
Thread for periodically requesting feedback messages from the SCHUNK five finger hand.
bool requestControllerFeedback(const SVHChannel &channel)
send request controller feedback paket


schunk_svh_driver
Author(s): Georg Heppner
autogenerated on Mon Jun 10 2019 15:04:59