RemoteRobot Class Reference

Mimics the behaviour of the VirtualRobot::Robot class while redirecting everything to an Ice proxy. More...

#include <RobotAPI/libraries/core/remoterobot/RemoteRobot.h>

+ Inheritance diagram for RemoteRobot:

Public Member Functions

VirtualRobot::RobotPtr createLocalClone ()
 Clones the structure of this remote robot to a local instance.
 
Eigen::Matrix4f getGlobalPose () const override
 
std::string getName () const override
 
VirtualRobot::RobotNodePtr getRobotNode (const std::string &robotNodeName) const override
 
void getRobotNodes (std::vector< VirtualRobot::RobotNodePtr > &storeNodes, bool clearVector=true) const override
 
VirtualRobot::RobotNodeSetPtr getRobotNodeSet (const std::string &nodeSetName) const override
 
void getRobotNodeSets (std::vector< VirtualRobot::RobotNodeSetPtr > &storeNodeSet) const override
 
VirtualRobot::RobotNodePtr getRootNode () const override
 
float getScaling ()
 
SharedRobotInterfacePrx getSharedRobot () const
 Use this method to share the robot instance over Ice.
 
bool hasRobotNode (const std::string &robotNodeName) const override
 
bool hasRobotNode (VirtualRobot::RobotNodePtr) const override
 
bool hasRobotNodeSet (const std::string &name) const override
 
 RemoteRobot (SharedRobotInterfacePrx robot)
 
 ~RemoteRobot () override
 

Static Public Member Functions

static VirtualRobot::RobotPtr createLocalClone (RobotStateComponentInterfacePrx robotStatePrx, const std::string &filename=std::string(), const Ice::StringSeq packages=Ice::StringSeq(), VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
 
static VirtualRobot::RobotPtr createLocalClone (SharedRobotInterfacePrx sharedRobotPrx, std::string filename=std::string(), float scaling=1.0f, const Ice::StringSeq packages=Ice::StringSeq(), VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
 
static VirtualRobot::RobotPtr createLocalCloneFromFile (RobotStateComponentInterfacePrx robotStatePrx, VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
 This is a convenience function for createLocalClone, which automatically gets the filename from the RobotStateComponent, loads robot from the file and syncs it once.
 
static bool synchronizeLocalClone (VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx)
 
static bool synchronizeLocalClone (VirtualRobot::RobotPtr robot, SharedRobotInterfacePrx sharedRobotPrx)
 
static bool synchronizeLocalCloneToState (VirtualRobot::RobotPtr robot, RobotStateConfig const &state)
 
static bool synchronizeLocalCloneToTimestamp (VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx, Ice::Long timestamp)
 Synchronizes a local robot to a robot state at timestamp.
 

Protected Member Functions

VirtualRobot::RobotNodePtr createLocalNode (SharedRobotNodeInterfacePrx remoteNode, std::vector< VirtualRobot::RobotNodePtr > &allNodes, std::map< VirtualRobot::RobotNodePtr, std::vector< std::string > > &childrenMap, VirtualRobot::RobotPtr robo)
 
void deregisterRobotNode (VirtualRobot::RobotNodePtr node) override
 Not implemented yet.
 
void deregisterRobotNodeSet (VirtualRobot::RobotNodeSetPtr nodeSet) override
 Not implemented yet.
 
VirtualRobot::EndEffectorPtr getEndEffector (const std::string &endEffectorName) const override
 Not implemented yet.
 
void getEndEffectors (std::vector< VirtualRobot::EndEffectorPtr > &storeEEF) const override
 Not implemented yet.
 
bool hasEndEffector (const std::string &endEffectorName) const override
 Not implemented yet.
 
void registerEndEffector (VirtualRobot::EndEffectorPtr endEffector) override
 Not implemented yet.
 
void registerRobotNode (VirtualRobot::RobotNodePtr node) override
 Not implemented yet.
 
void registerRobotNodeSet (VirtualRobot::RobotNodeSetPtr nodeSet) override
 Not implemented yet.
 
void setGlobalPose (const Eigen::Matrix4f &globalPose, bool applyValues=true) override
 Sets the global pose of the robot.
 
void setRootNode (VirtualRobot::RobotNodePtr node) override
 Not implemented yet.
 

Static Protected Member Functions

static VirtualRobot::RobotNodePtr createRemoteRobotNode (SharedRobotNodeInterfacePrx, VirtualRobot::RobotPtr)
 

Protected Attributes

std::map< std::string, VirtualRobot::RobotNodePtr > _cachedNodes
 
SharedRobotInterfacePrx _robot
 
VirtualRobot::RobotNodePtr _root
 

Static Protected Attributes

static std::recursive_mutex m
 

Detailed Description

Mimics the behaviour of the VirtualRobot::Robot class while redirecting everything to an Ice proxy.

For a description of the members please refer to the Simox documentation (VirtualRobot::Robot). Note that not the complete interface has been made available yet. These functions are marked as protected.

Constructor & Destructor Documentation

◆ RemoteRobot()

◆ ~RemoteRobot()

~RemoteRobot ( )
override

Member Function Documentation

◆ createLocalClone() [1/3]

VirtualRobot::RobotPtr createLocalClone ( )

Clones the structure of this remote robot to a local instance.

◆ createLocalClone() [2/3]

VirtualRobot::RobotPtr createLocalClone ( RobotStateComponentInterfacePrx robotStatePrx,
const std::string & filename = std::string(),
const Ice::StringSeq packages = Ice::StringSeq(),
VirtualRobot::RobotIO::RobotDescription loadMode = VirtualRobot::RobotIO::eFull )
static

Creates a local robot that is synchronized once but not updated any more. You can use the synchronizeLocalClone method to update the joint values. Note that only the kinematic structure is cloned, but the visualization files, collision models, end effectors, etc are not copied. This means you can use this model for kinematic computations (e.g. coordinate transformations) but not for advanced features like collision detection. In order to get a fully featured robot model you can pass a filename to VirtualRobot::Robot, but then you need to make sure that the loaded model is identical to the model of the remote robot (otherwise errors will occur). In the packages parameter you can pass in ArmarX packages, in which the robot file model might be in. The loadMode specifies in which mode the model should be loaded. Refer to simox for more information (only matters if filename was passed in).

See also
createLocalCloneFromFile(), synchronizeLocalClone()

◆ createLocalClone() [3/3]

RobotPtr createLocalClone ( SharedRobotInterfacePrx sharedRobotPrx,
std::string filename = std::string(),
float scaling = 1.0f,
const Ice::StringSeq packages = Ice::StringSeq(),
VirtualRobot::RobotIO::RobotDescription loadMode = VirtualRobot::RobotIO::eFull )
static

◆ createLocalCloneFromFile()

RobotPtr createLocalCloneFromFile ( RobotStateComponentInterfacePrx robotStatePrx,
VirtualRobot::RobotIO::RobotDescription loadMode = VirtualRobot::RobotIO::eFull )
static

This is a convenience function for createLocalClone, which automatically gets the filename from the RobotStateComponent, loads robot from the file and syncs it once.

Parameters
robotStatePrxProxy to the RobotStateComponent
loadModeThe loadMode specifies in which mode the model should be loaded. Refer to simox for more information.
Returns
new robot clone
See also
createLocalClone(), synchronizeLocalClone()

◆ createLocalNode()

VirtualRobot::RobotNodePtr createLocalNode ( SharedRobotNodeInterfacePrx remoteNode,
std::vector< VirtualRobot::RobotNodePtr > & allNodes,
std::map< VirtualRobot::RobotNodePtr, std::vector< std::string > > & childrenMap,
VirtualRobot::RobotPtr robo )
protected

◆ createRemoteRobotNode()

RobotNodePtr createRemoteRobotNode ( SharedRobotNodeInterfacePrx node,
VirtualRobot::RobotPtr robot )
staticprotected

◆ deregisterRobotNode()

void deregisterRobotNode ( VirtualRobot::RobotNodePtr node)
overrideprotected

Not implemented yet.

◆ deregisterRobotNodeSet()

void deregisterRobotNodeSet ( VirtualRobot::RobotNodeSetPtr nodeSet)
overrideprotected

Not implemented yet.

◆ getEndEffector()

EndEffectorPtr getEndEffector ( const std::string & endEffectorName) const
overrideprotected

Not implemented yet.

◆ getEndEffectors()

void getEndEffectors ( std::vector< VirtualRobot::EndEffectorPtr > & storeEEF) const
overrideprotected

Not implemented yet.

◆ getGlobalPose()

Matrix4f getGlobalPose ( ) const
override
Returns
Global pose of the robot

◆ getName()

std::string getName ( ) const
override

◆ getRobotNode()

RobotNodePtr getRobotNode ( const std::string & robotNodeName) const
override

◆ getRobotNodes()

void getRobotNodes ( std::vector< VirtualRobot::RobotNodePtr > & storeNodes,
bool clearVector = true ) const
override

◆ getRobotNodeSet()

RobotNodeSetPtr getRobotNodeSet ( const std::string & nodeSetName) const
override

◆ getRobotNodeSets()

void getRobotNodeSets ( std::vector< VirtualRobot::RobotNodeSetPtr > & storeNodeSet) const
override

◆ getRootNode()

RobotNodePtr getRootNode ( ) const
override

◆ getScaling()

float getScaling ( )

◆ getSharedRobot()

SharedRobotInterfacePrx getSharedRobot ( ) const

Use this method to share the robot instance over Ice.

◆ hasEndEffector()

bool hasEndEffector ( const std::string & endEffectorName) const
overrideprotected

Not implemented yet.

◆ hasRobotNode() [1/2]

bool hasRobotNode ( const std::string & robotNodeName) const
override

◆ hasRobotNode() [2/2]

bool hasRobotNode ( VirtualRobot::RobotNodePtr ) const
override

◆ hasRobotNodeSet()

bool hasRobotNodeSet ( const std::string & name) const
override

◆ registerEndEffector()

void registerEndEffector ( VirtualRobot::EndEffectorPtr endEffector)
overrideprotected

Not implemented yet.

◆ registerRobotNode()

void registerRobotNode ( VirtualRobot::RobotNodePtr node)
overrideprotected

Not implemented yet.

◆ registerRobotNodeSet()

void registerRobotNodeSet ( VirtualRobot::RobotNodeSetPtr nodeSet)
overrideprotected

Not implemented yet.

◆ setGlobalPose()

void setGlobalPose ( const Eigen::Matrix4f & globalPose,
bool applyValues = true )
overrideprotected

Sets the global pose of the robot.

Parameters
globalPosenew global pose
applyValuesNo effect. Will be always applied.

◆ setRootNode()

void setRootNode ( VirtualRobot::RobotNodePtr node)
overrideprotected

Not implemented yet.

◆ synchronizeLocalClone() [1/2]

bool synchronizeLocalClone ( VirtualRobot::RobotPtr robot,
RobotStateComponentInterfacePrx robotStatePrx )
static

Use this method to synchronize (i.e. copy the joint values) from the remote robot to the local clone. The local clone must have the identical structure as the remote robot model, otherwise an error will be reported. This is the fastest way to get update a local robot.

◆ synchronizeLocalClone() [2/2]

bool synchronizeLocalClone ( VirtualRobot::RobotPtr robot,
SharedRobotInterfacePrx sharedRobotPrx )
static

◆ synchronizeLocalCloneToState()

bool synchronizeLocalCloneToState ( VirtualRobot::RobotPtr robot,
RobotStateConfig const & state )
static

◆ synchronizeLocalCloneToTimestamp()

bool synchronizeLocalCloneToTimestamp ( VirtualRobot::RobotPtr robot,
RobotStateComponentInterfacePrx robotStatePrx,
Ice::Long timestamp )
static

Synchronizes a local robot to a robot state at timestamp.

Parameters
robotLocal robot that should be updated
robotStatePrxProxy to the RobotStateComponent
timestampTimestamp to which the local robot should be sychronized. Must be in range of the state history of the RobotStateComponent.
Returns
True if successfully synced.

Member Data Documentation

◆ _cachedNodes

std::map<std::string, VirtualRobot::RobotNodePtr> _cachedNodes
mutableprotected

◆ _robot

SharedRobotInterfacePrx _robot
protected

◆ _root

VirtualRobot::RobotNodePtr _root
mutableprotected

◆ m

std::recursive_mutex m
staticprotected

The documentation for this class was generated from the following files: