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/Robot.h>
25 #include <VirtualRobot/VirtualRobot.h>
26 #include <VirtualRobot/XML/RobotIO.h>
27 
29 
30 #include "RobotWriter.h"
31 
33 {
34  /**
35  * @brief The VirtualRobotReader class.
36  *
37  * The aim of this class is to obtain a virtual robot instance and synchronize it
38  * with the data (joint positions, global pose, ...) stored in the working memory.
39  *
40  * This is only a lightweight wrapper of @see RobotReader for Simox's VirtualRobot class.
41  */
42  class VirtualRobotWriter : virtual public RobotWriter
43  {
44  public:
45  VirtualRobotWriter() = default;
46  ~VirtualRobotWriter() override;
47 
48  void connect(armem::client::MemoryNameSystem& memoryNameSystem);
50 
51  [[nodiscard]] bool storeDescription(const VirtualRobot::Robot& robot,
52  const armem::Time& timestamp = armem::Time::Invalid());
53 
54 
55  [[nodiscard]] bool storeState(const VirtualRobot::Robot& robot,
56  const armem::Time& timestamp);
59  };
60 
61 } // 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:42
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:14
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:69
armarx::armem::robot_state::VirtualRobotWriter
The VirtualRobotReader class.
Definition: VirtualRobotWriter.h:42
armarx::core::time::DateTime::Invalid
static DateTime Invalid()
Definition: DateTime.cpp:60