|
#include <RobotComponents/components/RobotIK/RobotIK.h>
Public Member Functions | |
NameValueMap | computeCoMIK (const std::string &robotNodeSetJoints, const CoMIKDescriptor &desc, const Ice::Current &=Ice::emptyCurrent) override |
Computes an IK solution for the given robot joints such that the center of mass lies above the given point. More... | |
ExtendedIKResult | computeExtendedIKGlobalPose (const std::string &robotNodeSetName, const PoseBasePtr &tcpPose, armarx::CartesianSelection cs, const Ice::Current &=Ice::emptyCurrent) override |
Computes a single IK solution, error and reachability for the given robot node set and desired global TCP pose. More... | |
NameValueMap | computeHierarchicalDeltaIK (const std::string &robotNodeSet, const IKTasks &iktasks, const CoMIKDescriptor &comIK, float stepSize, bool avoidJointLimits, bool enableCenterOfMass, const Ice::Current &=Ice::emptyCurrent) override |
Computes a configuration gradient in order to solve several tasks/constraints simultaneously. More... | |
NameValueMap | computeIKFramedPose (const std::string &robotNodeSetName, const FramedPoseBasePtr &tcpPose, armarx::CartesianSelection cs, const Ice::Current &=Ice::emptyCurrent) override |
Computes a single IK solution for the given robot node set and desired TCP pose. More... | |
NameValueMap | computeIKGlobalPose (const std::string &robotNodeSetName, const PoseBasePtr &tcpPose, armarx::CartesianSelection cs, const Ice::Current &=Ice::emptyCurrent) override |
Computes a single IK solution for the given robot node set and desired global TCP pose. More... | |
PropertyDefinitionsPtr | createPropertyDefinitions () override |
Create an instance of RobotIKPropertyDefinitions. More... | |
bool | createReachabilitySpace (const std::string &chainName, const std::string &coordinateSystem, float stepTranslation, float stepRotation, const WorkspaceBounds &minBounds, const WorkspaceBounds &maxBounds, int numSamples, const Ice::Current &=Ice::emptyCurrent) override |
Creates a new reachability space for the given robot node set. More... | |
bool | defineRobotNodeSet (const std::string &name, const NodeNameList &nodes, const std::string &tcpName, const std::string &rootNode, const Ice::Current &=Ice::emptyCurrent) override |
Defines a new robot node set. More... | |
std::string | getDefaultName () const override |
Retrieve default name of component. More... | |
virtual std::string | getRobotFilename (const Ice::Current &) const |
bool | hasReachabilitySpace (const std::string &chainName, const Ice::Current &=Ice::emptyCurrent) const override |
Returns whether this component has a reachability space for the given robot node set. More... | |
bool | isFramedPoseReachable (const std::string &chainName, const FramedPoseBasePtr &tcpPose, const Ice::Current &=Ice::emptyCurrent) const override |
Returns whether a given framed pose is currently reachable by the TCP of the given robot node set. More... | |
bool | isPoseReachable (const std::string &chainName, const PoseBasePtr &tcpPose, const Ice::Current &=Ice::emptyCurrent) const override |
Returns whether a given global pose is currently reachable by the TCP of the given robot node set. More... | |
bool | loadReachabilitySpace (const std::string &filename, const Ice::Current &=Ice::emptyCurrent) override |
Loads the reachability space from the given file. More... | |
bool | saveReachabilitySpace (const std::string &robotNodeSet, const std::string &filename, const Ice::Current &=Ice::emptyCurrent) const override |
Saves a previously created reachability space of the given robot node set. More... | |
Public Member Functions inherited from Component | |
virtual void | componentPropertiesUpdated (const std::set< std::string > &changedProperties) |
Implement this function if you would like to react to changes in the properties. More... | |
void | forceComponentCreatedByComponentCreateFunc () |
forces the flag to be set to true that the object instance was created by the Component::create function More... | |
std::vector< PropertyUserPtr > | getAdditionalPropertyUsers () const |
template<typename PropertyType > | |
Property< PropertyType > | getProperty (const std::string &name) |
template<typename PropertyType > | |
Property< PropertyType > | getProperty (const std::string &name) const |
template<class T > | |
void | getProperty (std::atomic< T > &val, const std::string &name) const |
template<class T > | |
void | getProperty (T &val, const std::string &name) const |
template<class ProxyType > | |
ProxyType | getProxyFromProperty (const std::string &propertyName, bool addToDependencies=false, const std::string &endpoints="", bool throwOnProxyError=true) |
Get a proxy whose name is specified by the given property. More... | |
template<class ProxyType > | |
void | getProxyFromProperty (ProxyType &proxy, const std::string &propertyName, bool addToDependencies=false, const std::string &endpoints="", bool throwOnProxyError=true) |
template<class TopicProxyType > | |
TopicProxyType | getTopicFromProperty (const std::string &propertyName) |
Get a topic proxy whose name is specified by the given property. More... | |
template<class TopicProxyType > | |
void | getTopicFromProperty (TopicProxyType &top, const std::string &propertyName) |
void | initializeProperties (const std::string &configName, Ice::PropertiesPtr const &properties, const std::string &configDomain) |
initializes the properties of this component. More... | |
void | injectPropertyDefinitions (PropertyDefinitionsPtr &props) override |
void | offeringTopicFromProperty (const std::string &propertyName) |
Offer a topic whose name is specified by the given property. More... | |
virtual void | preOnConnectComponent () override |
virtual void | preOnInitComponent () override |
bool | usingProxyFromProperty (const std::string &propertyName, const std::string &endpoints="") |
Use a proxy whose name is specified by the given property. More... | |
void | usingTopicFromProperty (const std::string &propertyName, bool orderedPublishing=false) |
Use a topic whose name is specified by the given property. More... | |
Public Member Functions inherited from ManagedIceObject | |
void | enableProfiler (bool enable) |
setProfiler allows setting ManagedIceObject::profiler to a new instance (if the new instance is actually not a null pointer) More... | |
std::string | generateSubObjectName (const std::string &subObjectName) |
Generates a unique name for a sub object from a general name. More... | |
ArmarXManagerPtr | getArmarXManager () const |
Returns the ArmarX manager used to add and remove components. More... | |
ManagedIceObjectConnectivity | getConnectivity () const |
Retrieve connectivity of the object (topcis as well as proxies) More... | |
IceManagerPtr | getIceManager () const |
Returns the IceManager. More... | |
VariantBasePtr | getMetaInfo (const std::string &id) |
StringVariantBaseMap | getMetaInfoMap () const |
std::string | getName () const |
Retrieve name of object. More... | |
Ice::ObjectAdapterPtr | getObjectAdapter () const |
Returns object's Ice adapter. More... | |
ArmarXObjectSchedulerPtr | getObjectScheduler () const |
PeriodicTaskPtr | getPeriodicTask (const std::string &name) |
Profiler::ProfilerPtr | getProfiler () const |
getProfiler returns an instance of armarx::Profiler More... | |
template<class ProxyTarg , class... Args> | |
void | getProxy (const char *name, IceInternal::ProxyHandle< ProxyTarg > &proxy, Args &&...args) |
template<class ProxyType > | |
ProxyType | getProxy (const std::string &name, bool addToDependencies=false, const std::string &endpoints="", bool throwOnProxyError=true) |
Retrieves a proxy object. More... | |
template<class ProxyTarg , class... Args> | |
void | getProxy (const std::string &name, IceInternal::ProxyHandle< ProxyTarg > &proxy, Args &&...args) |
template<class ProxyTarg , class... Args> | |
void | getProxy (IceInternal::ProxyHandle< ProxyTarg > &proxy, const char *name, Args &&...args) |
template<class ProxyTarg , class... Args> | |
void | getProxy (IceInternal::ProxyHandle< ProxyTarg > &proxy, const std::string &name, Args &&...args) |
Assigns a proxy to proxy . More... | |
Ice::ObjectPrx | getProxy (long timeoutMs=0, bool waitForScheduler=true) const |
Returns the proxy of this object (optionally it waits for the proxy) More... | |
template<class Prx > | |
Prx | getProxy (long timeoutMs=0, bool waitForScheduler=true) const |
template<class ProxyType > | |
void | getProxy (ProxyType &proxy, const char *name, bool addToDependencies=false, const std::string &endpoints="", bool throwOnProxyError=true) |
Overload to allow using string literals as name (solve ambiguous overload). More... | |
template<class Prx > | |
void | getProxy (Prx &prx, long timeoutMs=0, bool waitForScheduler=true) const |
int | getState () const |
Retrieve current state of the ManagedIceObject. More... | |
template<class TopicProxyType > | |
TopicProxyType | getTopic (const std::string &name) |
Returns a proxy of the specified topic. More... | |
template<class TopicProxyType > | |
void | getTopic (TopicProxyType &topicProxy, const std::string &name) |
Assigns a proxy of the specified topic to topicProxy . More... | |
std::vector< std::string > | getUnresolvedDependencies () const |
returns the names of all unresolved dependencies More... | |
ManagedIceObject (ManagedIceObject const &other) | |
void | offeringTopic (const std::string &name) |
Registers a topic for retrival after initialization. More... | |
void | preambleGetTopic (std::string const &name) |
void | setMetaInfo (const std::string &id, const VariantBasePtr &value) |
Allows to set meta information that can be queried live via Ice interface on the ArmarXManager. More... | |
void | startPeriodicTask (const std::string &uniqueName, std::function< void(void)> f, int periodMs, bool assureMeanInterval=false, bool forceSystemTime=true) |
bool | stopPeriodicTask (const std::string &name) |
bool | unsubscribeFromTopic (const std::string &name) |
Unsubscribe from a topic. More... | |
bool | usingProxy (const std::string &name, const std::string &endpoints="") |
Registers a proxy for retrieval after initialization and adds it to the dependency list. More... | |
void | usingTopic (const std::string &name, bool orderedPublishing=false) |
Registers a proxy for subscription after initialization. More... | |
void | waitForObjectScheduler () |
Waits until the ObjectScheduler could resolve all dependencies. More... | |
void | waitForProxy (std::string const &name, bool addToDependencies) |
Public Member Functions inherited from Logging | |
SpamFilterDataPtr | deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const |
disables the logging for the current line for the given amount of seconds. More... | |
MessageTypeT | getEffectiveLoggingLevel () const |
Logging () | |
void | setLocalMinimumLoggingLevel (MessageTypeT level) |
With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More... | |
void | setTag (const LogTag &tag) |
void | setTag (const std::string &tagName) |
virtual | ~Logging () |
Public Member Functions inherited from PropertyUser | |
std::vector< std::string > | getComponentProxyNames () |
Ice::PropertiesPtr | getIceProperties () const |
Returns the set of Ice properties. More... | |
template<typename PropertyType > | |
Property< PropertyType > | getProperty (const std::string &name) |
Property creation and retrieval. More... | |
template<typename PropertyType > | |
Property< PropertyType > | getProperty (const std::string &name) const |
Hack to allow using getProperty in const -modified methods. More... | |
template<class T > | |
void | getProperty (std::atomic< T > &val, const std::string &name) const |
template<class T > | |
void | getProperty (T &val, const std::string &name) const |
template<class T > | |
std::vector< T > | getPropertyAsCSV (const std::string &name, const std::string &splitBy=",;", bool trimElements=true, bool removeEmptyElements=true) |
template<class ContainerT > | |
void | getPropertyAsCSV (ContainerT &val, const std::string &name, const std::string &splitBy=",;", bool trimElements=true, bool removeEmptyElements=true) |
PropertyDefinitionsPtr | getPropertyDefinitions () |
Returns the component's property definition container. More... | |
std::vector< std::string > | getSubscribedTopicNames () |
std::vector< std::string > | getTopicProxyNames () |
bool | hasProperty (const std::string &name) |
PropertyUser () | |
virtual void | setIceProperties (Ice::PropertiesPtr properties) |
Sets the Ice properties. More... | |
bool | tryAddProperty (const std::string &propertyName, const std::string &value) |
virtual void | updateIceProperties (const std::map< std::string, std::string > &changes) |
void | updateProperties () |
void | updateProxies (IceManagerPtr) |
~PropertyUser () override | |
Protected Member Functions | |
void | onConnectComponent () override |
Pure virtual hook for the subclass. More... | |
void | onDisconnectComponent () override |
Hook for subclass. More... | |
void | onInitComponent () override |
Load and create a VirtualRobot::Robot instance from the RobotFileName property. More... | |
Protected Member Functions inherited from Component | |
void | addPropertyUser (const PropertyUserPtr &subPropertyUser) |
Add additional property users here that should show up in the application help text. More... | |
Component () | |
Protected default constructor. Used for virtual inheritance. Use createManagedIceObject() instead. More... | |
std::string | getConfigDomain () |
Retrieve config domain for this component as set in constructor. More... | |
std::string | getConfigIdentifier () |
Retrieve config identifier for this component as set in constructor. More... | |
std::string | getConfigName () |
Retrieve config name for this component as set in constructor. More... | |
virtual void | icePropertiesInitialized () |
Protected Member Functions inherited from ManagedIceObject | |
template<class PluginT , class... ParamsT> | |
PluginT * | addPlugin (const std::string prefix="", ParamsT &&...params) |
template<class PluginT , class... ParamsT> | |
void | addPlugin (PluginT *&targ, const std::string prefix="", ParamsT &&...params) |
template<class PluginT , class... ParamsT> | |
void | addPlugin (std::experimental::observer_ptr< PluginT > &targ, const std::string prefix="", ParamsT &&...params) |
Ice::CommunicatorPtr | getCommunicator () const |
std::unique_ptr< ManagedIceObjectPlugin > & | getPluginPointer (std::type_info const &type, std::string const &prefix) |
ManagedIceObject () | |
Protected default constructor. More... | |
virtual void | onExitComponent () |
Hook for subclass. More... | |
virtual void | postOnConnectComponent () |
virtual void | postOnDisconnectComponent () |
virtual void | postOnExitComponent () |
virtual void | postOnInitComponent () |
virtual void | preOnDisconnectComponent () |
virtual void | preOnExitComponent () |
bool | removeProxyDependency (const std::string &name) |
This function removes the dependency of this object on the in parameter name specified object. More... | |
void | setName (std::string name) |
Override name of well-known object. More... | |
void | terminate () |
Initiates termination of this IceManagedObject. More... | |
~ManagedIceObject () override | |
Protected Member Functions inherited from Logging | |
bool | checkLogLevel (MessageTypeT level) const |
const LogSenderPtr & | getLogSender () const |
Retrieve log sender. More... | |
LogSenderPtr | loghelper (const char *file, int line, const char *function) const |
Additional Inherited Members | |
Public Types inherited from ManagedIceObject | |
using | PeriodicTaskPtr = IceUtil::Handle< SimplePeriodicTask< std::function< void(void)> >> |
Static Public Member Functions inherited from Component | |
template<class T , class TPtr = IceInternal::Handle<T>> | |
static TPtr | create (Ice::PropertiesPtr properties=Ice::createProperties(), const std::string &configName="", const std::string &configDomain="ArmarX") |
Factory method for a component. More... | |
Static Public Member Functions inherited from ManagedIceObject | |
static std::string | generateSubObjectName (const std::string &superObjectName, const std::string &subObjectName) |
Generates a unique name for a sub object from a general name and unique name. More... | |
static std::string | GetObjectStateAsString (int state) |
Static Public Attributes inherited from ManagedIceObject | |
static const ManagedIceObjectPtr | NullPtr |
A nullptr to be used when a const ref to a nullptr is required. More... | |
Protected Attributes inherited from Logging | |
MessageTypeT | minimumLoggingLevel |
SpamFilterDataPtr | spamFilter |
LogTag | tag |
|
override |
Computes an IK solution for the given robot joints such that the center of mass lies above the given point.
robotNodeSetJoints | Name of the robot node set that contains the joints you wish to compute the IK for. |
comIK | A center of mass description. Note that the priority field is relevant for this function as there is only a single CoM of descriptor. |
Definition at line 168 of file RobotIK.cpp.
|
override |
Computes a single IK solution, error and reachability for the given robot node set and desired global TCP pose.
The TCP pose is assumed to be in the global frame. The CartesianSelection parameter defines which part of the target pose should be reached.
robotNodeSetName | The name of a robot node set (robot node set) that is either stored within the robot model or has been defined via defineRobotNodeSet. |
tcpPose | The global target pose for the TCP. |
cs | Specifies which part of the pose needs to be reached by the IK, e.g. the position only, the orientation only or all. |
Definition at line 159 of file RobotIK.cpp.
|
override |
Computes a configuration gradient in order to solve several tasks/constraints simultaneously.
This function allows you to use the HierarchicalIK solver provided by Simox. It computes a configuration gradient for the given robot node set that minimizes the workspace errors for multiple tasks simultaneously. You can specify IK tasks, a center of mass task and a joint limit avoidance task. For details for the different type of tasks, see the parameter description. You must define a priority for each task. The task with maximal priority is the first task to be solved. Each subsequent task is then solved within the null space of the previous task. Note that this function returns a gradient and NOT an absolute IK solution. The gradient is computed on the current configuration of the robot. < >. The gradient is computed from the current robot configuration.
See @url http://simox.sourceforge.net/documentation/class_virtual_robot_1_1_hierarchical_i_k.html and @url http://sourceforge.net/p/simox/wiki/VirtualRobot/#hierarchical-ik-solving for more information.
robotNodeSet | The robot node set (e.g. kinematic tree) you wish to compute the gradient for. |
diffIKs | A list of IK tasks. Each IK task specifies a TCP and a desired pose for this TCP. |
comIK | A center of mass tasks. Defines where the center should be and its priority. Is only used if the CoM-task is enabled. |
stepSize | |
avoidJointLimits | Set whether or not to avoid joint limits. |
enableCenterOfMass | Set whether or not to adjust the center of mass. |
Definition at line 213 of file RobotIK.cpp.
|
override |
Computes a single IK solution for the given robot node set and desired TCP pose.
The TCP pose can be defined in any frame and is converted internally to a global pose according to the current robot state. The CartesianSelection parameter defines which part of the target pose should be reached.
robotNodeSetName | The name of a robot node set (robot node set) that is either stored within the robot model or has been defined via defineRobotNodeSet. |
tcpPose | The framed target pose for the TCP. |
cs | Specifies which part of the pose needs to be reached by the IK, e.g. the position only, the orientation only or all. |
Definition at line 142 of file RobotIK.cpp.
|
override |
Computes a single IK solution for the given robot node set and desired global TCP pose.
The TCP pose is assumed to be in the global frame. The CartesianSelection parameter defines which part of the target pose should be reached.
robotNodeSetName | The name of a robot node set (robot node set) that is either stored within the robot model or has been defined via defineRobotNodeSet. |
tcpPose | The global target pose for the TCP. |
cs | Specifies which part of the pose needs to be reached by the IK, e.g. the position only, the orientation only or all. |
Definition at line 150 of file RobotIK.cpp.
|
overridevirtual |
Create an instance of RobotIKPropertyDefinitions.
Reimplemented from Component.
Definition at line 136 of file RobotIK.cpp.
|
override |
Creates a new reachability space for the given robot node set.
If there is no reachability space for the given robot node set yet, a new one is created. This may take some time. The function returns true iff a reachability space for the given robot node set exists after execution of this function.
chainName | The name of a defined robot node set. This can be either a robot node set that is defined in the robot model or a robot node set that has been manually defined calling defineRobotNodeSet. |
coordinateSystem | The name of the robot node in whose coordinate system the reachability space shall be defined in. If you wish to choose the global coordinate system, pass an empty string. Note, however, that any reachability space defined in the global coordinate system gets invalidated once the robot moves. |
stepTranslation | The extend of a voxel dimension in translational dimensions (x,y,z) [mm] |
stepRotation | The extend of a voxel dimension in rotational dimensions (roll,pitch,yaw) [rad] |
minBounds | The minimum workspace poses (x,y,z,ro,pi,ya) given in the base node's coordinate system [mm and rad] |
maxBounds | The maximum workspace poses (x,y,z,ro,pi,ya) given in base node's coordinate system [mm and rad] |
numSamples | The number of tcp samples to take to create the reachability space (e.g 1000000) |
Definition at line 306 of file RobotIK.cpp.
|
override |
Defines a new robot node set.
Define a new robot node set with the given name that consists out of the given list of nodes with given TCP and root frame. Iff the chain is successfully added or already exists, <it>true</it> is returned.
name | The name of the robot node set. |
nodes | The list of robot nodes that make up the robot node set. |
tcpName | The name of the TCP node. |
rootNode | The name of the kinematic root. |
Definition at line 350 of file RobotIK.cpp.
|
inlineoverridevirtual |
Retrieve default name of component.
Implement this method in each IceManagedObject. The default name of a is used if no name is specified in the factory method.
Implements ManagedIceObject.
|
virtual |
Definition at line 398 of file RobotIK.cpp.
|
override |
Returns whether this component has a reachability space for the given robot node set.
True if there is a reachability space available, else false.
chainName | Name of the robot node set. |
Definition at line 403 of file RobotIK.cpp.
|
override |
Returns whether a given framed pose is currently reachable by the TCP of the given robot node set.
To determine whether a pose is reachable a reachability space for the given robot node set is required. If no such space exists, the function returns <it>false<\it>. Call createReachabilitySpace first to ensure there is such a space.
chainName | A name of a robot node set either defined in the robot model or previously defined via defineRobotNodeSet. |
framedPose | A framed pose to check for reachability. The pose is transformed into a global pose using the current robot state. |
Definition at line 409 of file RobotIK.cpp.
|
override |
Returns whether a given global pose is currently reachable by the TCP of the given robot node set.
To determine whether a pose is reachable a reachability space for the given robot node set is required. If no such space exists, the function returns <it>false<\it>. Call createReachabilitySpace first to ensure there is such a space.
chainName | A name of a robot node set either defined in the robot model or previously defined via defineRobotNodeSet. |
pose | A global pose to check for reachability. |
Definition at line 414 of file RobotIK.cpp.
|
override |
Loads the reachability space from the given file.
If loading the reachability space succeeds, the reachability space is ready to be used after this function terminates. A reachability space can only be loaded if there is no reachability space for the respective robot node set yet.
filename | Binary file containing a reachability space. Ensure that the path is valid and accessible from where this component is running. |
Definition at line 420 of file RobotIK.cpp.
|
overrideprotectedvirtual |
Pure virtual hook for the subclass.
Is called once all dependencies of the object have been resolved and Ice connection is established. This hook is called whenever the dependencies are found. That means if the a depedency crashes or shuts down, the ManagedIceObject goes into disconnected state. When the dependencies are found again, this hook is called again.
Implements ManagedIceObject.
Definition at line 113 of file RobotIK.cpp.
|
overrideprotectedvirtual |
Hook for subclass.
Is called if a dependency of the object got lost (crash, network error, stopped, ...). This hook should be the inverse to onConnectComponent(). So that onDisconnectComponent() and onConnectComponent() can be called alternatingly and the ManagedIceObject remains in valid states. *
Reimplemented from ManagedIceObject.
Definition at line 132 of file RobotIK.cpp.
|
overrideprotectedvirtual |
Load and create a VirtualRobot::Robot instance from the RobotFileName property.
Implements ManagedIceObject.
Definition at line 61 of file RobotIK.cpp.
|
override |
Saves a previously created reachability space of the given robot node set.
A reachability space for a robot node set can only be saved, if actually is one. You can check whether a reachability space is available by calling hasReachabilitySpace(robotNodeSet).
robotNodeSet | The robot node set for which you wish to save the reachability space. |
filename | The filename if the file(must be an accessible path for this component) you wish to save the space in. |
Definition at line 483 of file RobotIK.cpp.