Go to the documentation of this file.
6 #include <VirtualRobot/Robot.h>
7 #include <VirtualRobot/VirtualRobot.h>
8 #include <VirtualRobot/XML/RobotIO.h>
23 const auto robotState =
queryState(robot.getName(), timestamp);
27 << robot.getName() <<
"` "
28 <<
"(type `" << robot.getType() <<
"`)!";
32 robot.setJointValues(robotState->jointMap);
33 robot.setGlobalPose(robotState->globalPose.matrix());
46 << robot.getName() <<
"` "
47 <<
"(type `" << robot.getType() <<
"`)!";
51 robot.setJointValues(robotState->jointMap);
59 const VirtualRobot::RobotIO::RobotDescription& loadMode)
68 <<
"` is not a available!";
73 const std::string xmlFilename = description->xml.toSystemPath();
74 ARMARX_CHECK(std::filesystem::exists(xmlFilename)) << xmlFilename;
77 <<
"' from XML file '" << xmlFilename <<
"'";
79 auto robot = VirtualRobot::RobotIO::loadRobot(xmlFilename, loadMode);
89 const VirtualRobot::BaseIO::RobotDescription& loadMode,
97 const std::string& name,
99 const VirtualRobot::RobotIO::RobotDescription& loadMode,
102 return _getSynchronizedRobot(name, timestamp, loadMode, blocking);
106 VirtualRobotReader::_getSynchronizedRobot(
107 const std::string& name,
108 const Time& timestamp,
109 const VirtualRobot::BaseIO::RobotDescription& loadMode,
std::optional< RobotState > queryJointState(const std::string &robotName, const armem::Time ×tamp) const
VirtualRobot::RobotPtr getRobot(const std::string &name, const armem::Time ×tamp=armem::Time::Invalid(), const VirtualRobot::RobotIO::RobotDescription &loadMode=VirtualRobot::RobotIO::RobotDescription::eStructure)
static void WaitFor(const Duration &duration)
Wait for a certain duration on the virtual clock.
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
bool synchronizeRobot(VirtualRobot::Robot &robot, const armem::Time ×tamp) const
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
bool synchronizeRobotJoints(VirtualRobot::Robot &robot, const armem::Time ×tamp) const
std::optional< description::RobotDescription > queryDescription(const std::string &name, const armem::Time ×tamp) const
VirtualRobot::RobotPtr getSynchronizedRobot(const std::string &name, const VirtualRobot::RobotIO::RobotDescription &loadMode=VirtualRobot::RobotIO::RobotDescription::eStructure, bool blocking=true)
Represents a point in time.
static DateTime Now()
Current time on the virtual clock.
std::optional< RobotState > queryState(const std::string &robotName, const armem::Time ×tamp) const
armem::Duration sleepAfterFailure
static DateTime Invalid()
std::shared_ptr< class Robot > RobotPtr