VirtualRobotWriter.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @author Fabian Reister ( fabian dot reister at kit dot edu )
17  * @date 2021
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <VirtualRobot/VirtualRobot.h>
25 
27 
28 #include "RobotWriter.h"
29 
31 {
32  /**
33  * @brief The VirtualRobotReader class.
34  *
35  * The aim of this class is to obtain a virtual robot instance and synchronize it
36  * with the data (joint positions, global pose, ...) stored in the working memory.
37  *
38  * This is only a lightweight wrapper of @see RobotReader for Simox's VirtualRobot class.
39  */
40  class VirtualRobotWriter : virtual public RobotWriter
41  {
42  public:
43  VirtualRobotWriter() = default;
44  ~VirtualRobotWriter() override;
45 
46  void connect(armem::client::MemoryNameSystem& memoryNameSystem);
48 
49  [[nodiscard]] bool storeDescription(const VirtualRobot::Robot& robot,
50  const armem::Time& timestamp = armem::Time::Invalid());
51 
52 
53  [[nodiscard]] bool storeState(const VirtualRobot::Robot& robot,
54  const armem::Time& timestamp);
57  };
58 
59 } // namespace armarx::armem::robot_state
armarx::armem::robot_state::VirtualRobotWriter::VirtualRobotWriter
VirtualRobotWriter()=default
armarx::armem::robot_state::VirtualRobotWriter::storeState
bool storeState(const VirtualRobot::Robot &robot, const armem::Time &timestamp)
Definition: VirtualRobotWriter.cpp:63
RobotWriter.h
armarx::armem::robot_state::RobotWriter
The RobotReader class.
Definition: RobotWriter.h:43
forward_declarations.h
armarx::armem::robot_state
Definition: RobotStatePredictionClient.cpp:41
armarx::armem::robot_state::RobotWriter::storeState
bool storeState(const RobotState &state, const std::string &robotTypeName, const std::string &robotName, const std::string &robotRootNodeName) override
Definition: RobotWriter.cpp:179
armarx::armem::robot_state::VirtualRobotWriter::storeDescription
bool storeDescription(const VirtualRobot::Robot &robot, const armem::Time &timestamp=armem::Time::Invalid())
Definition: VirtualRobotWriter.cpp:48
armarx::armem::human::Robot
@ Robot
Definition: util.h:17
armarx::armem::robot_state::VirtualRobotWriter::registerPropertyDefinitions
void registerPropertyDefinitions(::armarx::PropertyDefinitionsPtr &def)
Definition: VirtualRobotWriter.cpp:34
armarx::armem::robot_state::VirtualRobotWriter::~VirtualRobotWriter
~VirtualRobotWriter() override
armarx::armem::robot_state::RobotWriter::storeDescription
bool storeDescription(const description::RobotDescription &description, const armem::Time &timestamp=armem::Time::Invalid()) override
Definition: RobotWriter.cpp:67
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::armem::robot_state::VirtualRobotWriter::connect
void connect(armem::client::MemoryNameSystem &memoryNameSystem)
Definition: VirtualRobotWriter.cpp:27
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::armem::client::MemoryNameSystem
The memory name system (MNS) client.
Definition: MemoryNameSystem.h:68
armarx::armem::robot_state::VirtualRobotWriter
The VirtualRobotReader class.
Definition: VirtualRobotWriter.h:40
armarx::core::time::DateTime::Invalid
static DateTime Invalid()
Definition: DateTime.cpp:57