src
ur
calibration_checker.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
// 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
29
#include <
ur_client_library/ur/calibration_checker.h
>
30
31
namespace
urcl
32
{
33
CalibrationChecker::CalibrationChecker
(
const
std::string& expected_hash)
34
: expected_hash_(expected_hash), checked_(false), matches_(false)
35
{
36
}
37
bool
CalibrationChecker::consume
(std::shared_ptr<primary_interface::PrimaryPackage> product)
38
{
39
auto
kin_info = std::dynamic_pointer_cast<primary_interface::KinematicsInfo>(product);
40
if
(kin_info !=
nullptr
)
41
{
42
// URCL_LOG_INFO("%s", product->toString().c_str());
43
//
44
matches_
= kin_info->toHash() ==
expected_hash_
;
45
46
checked_
=
true
;
47
}
48
49
return
true
;
50
}
51
}
// namespace urcl
urcl::CalibrationChecker::consume
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...
Definition:
calibration_checker.cpp:37
calibration_checker.h
urcl
Definition:
bin_parser.h:36
urcl::CalibrationChecker::CalibrationChecker
CalibrationChecker(const std::string &expected_hash)
Creates a new CalibrationChecker object with an expected hash calculated from the used kinematics.
Definition:
calibration_checker.cpp:33
urcl::CalibrationChecker::matches_
bool matches_
Definition:
calibration_checker.h:115
urcl::CalibrationChecker::checked_
bool checked_
Definition:
calibration_checker.h:114
urcl::CalibrationChecker::expected_hash_
std::string expected_hash_
Definition:
calibration_checker.h:113
ur_client_library
Author(s): Thomas Timm Andersen, Simon Rasmussen, Felix Exner, Lea Steffen, Tristan Schnell
autogenerated on Mon May 26 2025 02:35:58