abstract_primary_consumer.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 2020 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 
29 #ifndef UR_ROBOT_DRIVER_ABSTRACT_PRIMARY_CONSUMER_H_INCLUDED
30 #define UR_ROBOT_DRIVER_ABSTRACT_PRIMARY_CONSUMER_H_INCLUDED
31 
32 #include "ur_client_library/log.h"
36 
37 namespace urcl
38 {
39 namespace primary_interface
40 {
47 class AbstractPrimaryConsumer : public comm::IConsumer<PrimaryPackage>
48 {
49 public:
50  AbstractPrimaryConsumer() = default;
51  virtual ~AbstractPrimaryConsumer() = default;
52 
62  virtual bool consume(std::shared_ptr<PrimaryPackage> product) final
63  {
64  if (product != nullptr)
65  {
66  return product->consumeWith(*this);
67  }
68  return false;
69  }
70 
71  // To be implemented in specific consumers
72  virtual bool consume(RobotMessage& pkg) = 0;
73  virtual bool consume(RobotState& pkg) = 0;
74  virtual bool consume(VersionMessage& pkg) = 0;
75  virtual bool consume(KinematicsInfo& pkg) = 0;
76 
77 private:
78  /* data */
79 };
80 } // namespace primary_interface
81 } // namespace urcl
82 
83 #endif // ifndef UR_ROBOT_DRIVER_ABSTRACT_PRIMARY_CONSUMER_H_INCLUDED
virtual bool consume(std::shared_ptr< PrimaryPackage > product) final
This consume method is usally being called by the Pipeline structure. We don&#39;t necessarily need to kn...
Base class for a RobotState data packages will be used directly.
Definition: robot_state.h:59
Parent class for for arbitrary consumers.
Definition: pipeline.h:43
The VersionMessage class handles the version messages sent via the primary UR interface.
This messages contains information about the robot&#39;s calibration. The DH parameters are a combination...
The RobotMessage class is a parent class for the different received robot messages.
Definition: robot_message.h:57


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