Go to the documentation of this file.
28 #include <VirtualRobot/VirtualRobot.h>
29 #include <VirtualRobot/XML/RobotIO.h>
30 #include <VirtualRobot/RobotNodeSet.h>
31 #include <VirtualRobot/VirtualRobotException.h>
36 #include <SimoxUtility/algorithm/string/string_tools.h>
46 const std::string
project = getProperty<std::string>(
"RobotFileNameProject").getValue();
48 std::vector<std::string> result;
50 std::set<std::string> packageSet {packages.begin(), packages.end()};
64 Ice::StringSeq includePaths;
72 includePaths.insert(includePaths.end(), projectIncludePaths.begin(), projectIncludePaths.end());
77 throw UserException(
"Could not find robot file " + robotFile);
83 robot = VirtualRobot::RobotIO::loadRobot(robotFile, VirtualRobot::RobotIO::eStructure);
85 catch (VirtualRobot::VirtualRobotException& e)
87 throw UserException(e.what());
93 throw UserException(
"RobotNodeSet not defined");
97 robotNodes = robotNodeSetPtr->getAllRobotNodes();
138 NameControlModeMap
c;
140 for (
const auto& j : getJoints())
142 c[j] = ControlMode::ePositionControl;
150 NameControlModeMap
c;
152 for (
const auto& j : getJoints())
154 c[j] = ControlMode::eVelocityControl;
186 return robot->getName();
190 throw NotInitializedException(
"Robot Ptr is NULL",
"getName");
198 throw NotInitializedException(
"RobotNodeSetName is empty",
"getRobotNodeSetName");
std::string relativeRobotFile
static const std::string & GetProjectName()
void setJointAngles(const NameValueMap &targetJointAngles, const Ice::Current &c=Ice::emptyCurrent) override
void onExitComponent() override
Hook for subclass.
void release(const Ice::Current &c=Ice::emptyCurrent) override
Release exclusive access to current unit.
virtual void onStartKinematicUnit()=0
std::string robotNodeSetName
void offeringTopicFromProperty(const std::string &propertyName)
Offer a topic whose name is specified by the given property.
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
void request(const Ice::Current &c=Ice::emptyCurrent) override
Request exclusive access to current unit.
std::vector< std::string > getArmarXPackages(const Ice::Current &=Ice::emptyCurrent) const override
getArmarXPackages
void setJointAnglesToZero()
std::string getReportTopicName(const Ice::Current &=Ice::emptyCurrent) const override
std::string getRobotName(const Ice::Current &=Ice::emptyCurrent) const override
virtual void onExitKinematicUnit()=0
void setJointVelocitiesToZero()
std::vector< std::string > armarXPackages
const LogSender::manipulator flush
void onConnectComponent() override
Pure virtual hook for the subclass.
std::string getDataDir() const
std::vector< VirtualRobot::RobotNodePtr > robotNodes
void setJointVelocities(const NameValueMap &targetJointVelocities, const Ice::Current &c=Ice::emptyCurrent) override
std::string getRobotNodeSetName(const Ice::Current &=Ice::emptyCurrent) const override
virtual void releaseKinematicUnit(const Ice::StringSeq &nodes, const Ice::Current &c=Ice::emptyCurrent)
void switchControlMode(const NameControlModeMap &targetJointModes, const Ice::Current &c=Ice::emptyCurrent) override
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
PropertyDefinitionsPtr createPropertyDefinitions() override
void onInitComponent() override
Pure virtual hook for the subclass.
KinematicUnitListenerPrx listenerPrx
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
virtual void requestKinematicUnit(const Ice::StringSeq &nodes, const Ice::Current &c=Ice::emptyCurrent)
virtual void onInitKinematicUnit()=0
std::string getRobotFilename(const Ice::Current &=Ice::emptyCurrent) const override
static bool getAbsolutePath(const std::string &relativeFilename, std::string &storeAbsoluteFilename, const std::vector< std::string > &additionalSearchPaths={}, bool verbose=true)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
VirtualRobot::RobotPtr robot
This file offers overloads of toIce() and fromIce() functions for STL container types.
static const Ice::StringSeq & GetProjectDependencies()
std::vector< std::string > split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)