LaserScannerUnitObserver.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package RobotAPI::units
19 * @author Fabian Paus ( fabian dot paus at kit dot edu )
20 * @date 2017
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25#pragma once
26
27#include <mutex>
28
30
31#include <RobotAPI/interface/units/LaserScannerUnit.h>
32#include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
34
35namespace armarx
36{
37 /**
38 * \class LaserScannerUnitObserverPropertyDefinitions
39 * \brief
40 */
42 {
43 public:
46 {
48 "LaserScannerTopicName", "LaserScans", "Name of the laser scan topic.");
49 }
50 };
51
52 /**
53 * \class LaserScannerUnitObserver
54 * \ingroup RobotAPI-SensorActorUnits-observers
55 * \brief Observer monitoring laser scanner values
56 *
57 * The LaserScannerUnitObserver monitors laser scanner values published by LaserScannerUnit-implementations.
58 */
60 virtual public Observer,
61 virtual public LaserScannerUnitObserverInterface
62 {
63 public:
67
68 std::string
69 getDefaultName() const override
70 {
71 return "LaserScannerUnitObserver";
72 }
73
74 void onInitObserver() override;
75 void onConnectObserver() override;
76 void onExitObserver() override;
77 /**
78 * @see PropertyUser::createPropertyDefinitions()
79 */
81
82 void reportSensorValues(const std::string& device,
83 const std::string& name,
84 const LaserScan& scan,
85 const TimestampBasePtr& timestamp,
86 const Ice::Current& c) override;
87
88 private:
89 std::mutex dataMutex;
90 };
91} // namespace armarx
std::string timestamp()
constexpr T c
void onConnectObserver() override
Framework hook.
void onExitObserver() override
Framework hook.
PropertyDefinitionsPtr createPropertyDefinitions() override
void reportSensorValues(const std::string &device, const std::string &name, const LaserScan &scan, const TimestampBasePtr &timestamp, const Ice::Current &c) override
void onInitObserver() override
Framework hook.
std::string getDefaultName() const override
Retrieve default name of component.
ObserverPropertyDefinitions(std::string prefix)
Definition Observer.h:52
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.