Newer
Older
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author Fabian Reister ( fabian dot reister at kit dot edu )
* @date 2021
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
// ArmarX
#include <ArmarXCore/core/Component.h>
#include <ArmarXCore/interface/observers/ObserverInterface.h>
#include <ArmarXCore/util/tasks.h>
#include <ArmarXGui/libraries/ArmarXGuiComponentPlugins/LightweightRemoteGuiComponentPlugin.h>
// RobotAPI
#include <RobotAPI/interface/armem/server/MemoryInterface.h>
#include <RobotAPI/interface/armem/mns/MemoryNameSystemInterface.h>
#include <RobotAPI/libraries/armem/core/wm/memory_definitions.h>
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <RobotAPI/libraries/armem_robot_state/client/common/VirtualRobotReader.h>
namespace armarx::robot_state
{
/**
* @defgroup Component-ExampleClient ExampleClient
* @ingroup RobotAPI-Components
* A description of the component ExampleClient.
*
* @class ExampleClient
* @ingroup Component-ExampleClient
* @brief Brief description of class ExampleClient.
*
* Detailed description of class ExampleClient.
*/
class VirtualRobotReaderExampleClient :
virtual public armarx::Component,
virtual public armarx::armem::client::ComponentPluginUser
{
public:
VirtualRobotReaderExampleClient();
/// @see armarx::ManagedIceObject::getDefaultName()
std::string getDefaultName() const override;
protected:
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override;
void onInitComponent() override;
void onConnectComponent() override;
void onDisconnectComponent() override;
void onExitComponent() override;
void run();
private:
struct Properties
{
std::string robotName{"Armar6"};
float updateFrequency{10.F};
} p;
armarx::PeriodicTask<VirtualRobotReaderExampleClient>::pointer_type task;
armarx::DebugObserverInterfacePrx debugObserver;
// std::unique_ptr<::armarx::armem::articulated_object::Writer> articulatedObjectWriter;
armem::robot_state::VirtualRobotReader virtualRobotReader;
std::shared_ptr<VirtualRobot::Robot> virtualRobot{nullptr};
};
} // namespace armarx::robot_state