calibration_checker.h
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 // Copyright 2019 FZI Forschungszentrum Informatik
5 // Created on behalf of Universal Robots A/S
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 // -- END LICENSE BLOCK ------------------------------------------------
19 
20 //----------------------------------------------------------------------
27 //----------------------------------------------------------------------
28 #ifndef UR_CLIENT_LIBRARY_UR_CALIBRATION_CHECKER_H_INCLUDED
29 #define UR_CLIENT_LIBRARY_UR_CALIBRATION_CHECKER_H_INCLUDED
30 
32 
34 
35 namespace urcl
36 {
42 class CalibrationChecker : public comm::IConsumer<primary_interface::PrimaryPackage>
43 {
44 public:
51  CalibrationChecker(const std::string& expected_hash);
52  virtual ~CalibrationChecker() = default;
53 
57  virtual void setupConsumer()
58  {
59  }
63  virtual void teardownConsumer()
64  {
65  }
69  virtual void stopConsumer()
70  {
71  }
75  virtual void onTimeout()
76  {
77  }
78 
87  virtual bool consume(std::shared_ptr<primary_interface::PrimaryPackage> product);
88 
94  bool isChecked()
95  {
96  return checked_;
97  }
98 
106  {
107  return matches_;
108  }
109 
110 private:
111  std::string expected_hash_;
112  bool checked_;
113  bool matches_;
114 };
115 } // namespace urcl
116 
117 #endif // ifndef UR_CLIENT_LIBRARY_UR_CALIBRATION_CHECKER_H_INCLUDED
virtual bool consume(std::shared_ptr< primary_interface::PrimaryPackage > product)
Consumes a package, checking its hash if it is a KinematicsInfo package. If the hash does not match t...
virtual void stopConsumer()
Stops the consumer.
virtual void setupConsumer()
Empty setup function, as no setup is needed.
Parent class for for arbitrary consumers.
Definition: pipeline.h:43
virtual void teardownConsumer()
Tears down the consumer.
virtual ~CalibrationChecker()=default
CalibrationChecker(const std::string &expected_hash)
Creates a new CalibrationChecker object with an expected hash calculated from the used kinematics...
virtual void onTimeout()
Handles timeouts.
bool isChecked()
Used to make sure the calibration check is not performed several times.
The CalibrationChecker class consumes primary packages ignoring all but KinematicsInfo packages...
bool checkSuccessful()
Returns whether the calibration check was successful.


ur_client_library
Author(s): Thomas Timm Andersen, Simon Rasmussen, Felix Exner, Lea Steffen, Tristan Schnell
autogenerated on Tue Jul 4 2023 02:09:47