Go to the documentation of this file.
6 #include <VirtualRobot/Robot.h>
7 #include <VirtualRobot/VirtualRobot.h>
8 #include <VirtualRobot/XML/RobotIO.h>
35 const auto robotState =
queryState(robotDescription, timestamp);
39 << robot.getName() <<
"` "
40 <<
"(type `" << robot.getType() <<
"`)!";
44 robot.setJointValues(robotState->jointMap);
45 robot.setGlobalPose(robotState->globalPose.matrix());
53 const VirtualRobot::RobotIO::RobotDescription& loadMode)
62 <<
"` is not a available!";
67 const std::string xmlFilename = description->xml.toSystemPath();
68 ARMARX_CHECK(std::filesystem::exists(xmlFilename)) << xmlFilename;
71 <<
"' from XML file '" << xmlFilename <<
"'";
73 auto robot = VirtualRobot::RobotIO::loadRobot(xmlFilename, loadMode);
83 const VirtualRobot::BaseIO::RobotDescription& loadMode,
91 const std::string& name,
93 const VirtualRobot::RobotIO::RobotDescription& loadMode,
96 return _getSynchronizedRobot(name, timestamp, loadMode, blocking);
100 VirtualRobotReader::_getSynchronizedRobot(
101 const std::string& name,
102 const Time& timestamp,
103 const VirtualRobot::BaseIO::RobotDescription& loadMode,
124 std::optional<std::map<RobotReader::Hand, robot::ForceTorque>>
128 if (not description.has_value())
std::optional< std::map< Hand, robot::ForceTorque > > queryForceTorque(const robot::RobotDescription &description, const armem::Time ×tamp) const
std::optional< std::map< RobotReader::Hand, robot::ForceTorque > > queryForceTorque(const std::string &name, const armem::Time ×tamp)
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...
virtual void registerPropertyDefinitions(::armarx::PropertyDefinitionsPtr &def)
std::optional< robot::RobotDescription > queryDescription(const std::string &name, const armem::Time ×tamp) const
void registerPropertyDefinitions(::armarx::PropertyDefinitionsPtr &def) override
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)
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< robot::RobotState > queryState(const robot::RobotDescription &description, const armem::Time ×tamp) const
armem::Duration sleepAfterFailure
static DateTime Invalid()
std::shared_ptr< class Robot > RobotPtr