Go to the documentation of this file.
28 #include <SimoxUtility/algorithm/string/string_tools.h>
29 #include <VirtualRobot/Nodes/RobotNode.h>
30 #include <VirtualRobot/RobotNodeSet.h>
31 #include <VirtualRobot/VirtualRobot.h>
32 #include <VirtualRobot/VirtualRobotException.h>
33 #include <VirtualRobot/XML/RobotIO.h>
48 const std::string
project = getProperty<std::string>(
"RobotFileNameProject").getValue();
50 std::vector<std::string> result;
52 std::set<std::string> packageSet{packages.begin(), packages.end()};
66 Ice::StringSeq includePaths;
75 includePaths.end(), projectIncludePaths.begin(), projectIncludePaths.end());
80 throw UserException(
"Could not find robot file " + robotFile);
87 VirtualRobot::RobotIO::loadRobot(robotFile, VirtualRobot::RobotIO::eStructure);
89 catch (VirtualRobot::VirtualRobotException& e)
91 throw UserException(e.what());
97 throw UserException(
"RobotNodeSet not defined");
101 robotNodes = robotNodeSetPtr->getAllRobotNodes();
105 getProperty<std::string>(
"TopicPrefix").getValue() +
robotNodeSetName +
"State";
130 const Ice::Current&
c)
141 const Ice::Current&
c)
148 NameControlModeMap
c;
150 for (
const auto& j : getJoints())
152 c[j] = ControlMode::ePositionControl;
162 NameControlModeMap
c;
164 for (
const auto& j : getJoints())
166 c[j] = ControlMode::eVelocityControl;
191 std::vector<std::string>
202 return robot->getName();
206 throw NotInitializedException(
"Robot Ptr is NULL",
"getName");
215 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
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)
std::vector< VirtualRobot::RobotNodePtr > robotNodes