cisst-saw
|
#include <prmTransformationManager.h>
Public Types | |
typedef std::list < prmTransformationBasePtr > | NodeListType |
Static Public Member Functions | |
static void | Clear () |
static bool | NodeCreatesCycle (const prmTransformationBasePtr &attachPoint, const prmTransformationBasePtr &newFrame) |
static bool | NodeCreatesCycle (const std::string &pName, const prmTransformationBasePtr &newFrame) |
static vctFrm3 | WRTReference (const prmTransformationBasePtr &tipFrame, const prmTransformationBasePtr &refFrame) |
static unsigned int | ReplaceReference (const prmTransformationBasePtr &nodePtr, const prmTransformationBasePtr &newReference) |
static unsigned int | ReplaceReference (const prmTransformationBasePtr &nodePtr, const std::string &parentName) |
static void | ToStreamDot (std::ostream &outputStream) |
static void | ToStreamDotHelper (std::ostream &outputStream, prmTransformationBasePtr parent) |
static bool | FindPath (const prmTransformationBasePtr &target, const prmTransformationBasePtr &reference) |
static bool | FindPathConnectedTree (const prmTransformationBasePtr &target, const prmTransformationBasePtr &reference) |
static prmTransformationBasePtr | GetTransformationNodePtr (const std::string pName) |
static void | PathToStreamDot (std::ostream &outputStream) |
Static Public Attributes | |
static prmTransformationFixed | TheWorld |
Static Protected Member Functions | |
static bool | Attach (const prmTransformationBasePtr &attachPoint, const prmTransformationBasePtr &newFrame) |
static bool | Attach (const std::string &parentName, const prmTransformationBasePtr &newFrame) |
static bool | Detach (const prmTransformationBasePtr &frame) |
Static Protected Attributes | |
static NodeListType | Path |
static NodeListType | VisitedNodes |
static NodeListType | VisitedNodes2 |
Friends | |
class | prmTransformationBase |
This class is intended to support computation of relationships between different coordinate systems in a CIS system. The tree consists of nodes (various coordinate systems ) and the edges (static or dynamic transformations between the connected coordinate systems). Transformations between coordinate systems are retrieved using a user provided command.
Examples:
setup joints transformation vctFrm3 setupPos; setupPos.Translation() = vct3(10.0, 4.0, 3.0); prmTransformationFixed setupFrame("Setup frame", setupPos);
robot transformation prmTransformationDynamic robotFrame("Robot frame", setupFrame, robot.GetCommandRead("GetTipPosition"));
add a camera defined in world frame vctFrm3 cameraPos; cameraPos.Translation() = vct3(-10.0, 3.4, 5.34); vctRandom(cameraPos.Rotation()); // artificial move! prmTransformationFixed cameraFrame("Camera frame", cameraPos);
Get the position of the camera wrt to the robot std::cout << prmWRTReference(cameraFrame, robotFrame) << std::endl;
Compute the robot motion wrt its base so that the tip moves in the x direction of the camera. vctFrm3 moveWRTCamera; PositionCartesianArg goalArgs;
move.Translation() = vct3(1.0, 0.0, 0.0); vctFrm3 moveWRTRobot = prmWRTReference(cameraFrame, setupFrame) * move; goalArgs.SetGoal(moveWRTRobot); myRobot.MovePositionCart(goalArgs);
typedef std::list<prmTransformationBasePtr> prmTransformationManager::NodeListType |
|
staticprotected |
Add the frame to the tree in the transformation manager. This method is private and can only be accessed by the "friend" class prmTransformationBase.
attachPoint | prmTransformationBasePtr pointer to the new frame |
newFrame | prmTransformationBasePtr pointer to parent in the tree |
|
staticprotected |
|
static |
A method to clean up a transformation tree. Deletes all nodes and restores clean state. This should never need to be used as every node should attach or detach itself. It is primarily meant for testing and debugging purposes.
|
staticprotected |
Remove the frame from the tree Internally calls ReplaceReference(frame, theWorld).
frame | prmTransformationBase* pointer to the frame to be discarded. |
|
static |
Helper function for computing transformations. Traverses the tree and stores the path between target and reference in path
|
static |
Helper function for computing transformations. In contrast to above, this assumes a path exists and only merges two traversals from target/reference to tree root
|
static |
Helper function for attaching with names
|
static |
Test if attaching a reference frame at a particular node will introduce a circular dependency. The implementation is a simple depth first search, that returns true if a node is revisited more than once.
attachPoint | prmTransformationBasePr new parent |
newFrame | prmTransformationBasePtr candidate frame |
|
static |
|
static |
Print the path for last reference computation to a graphviz dot file
|
static |
Update all frames using a given frame as reference.
May be useful before a call to prmTransformationManager::Detach or its equivalent prmTransformationBase::~prmTransformationBase
currentReference | prmTransformationBase* old Reference frame |
newReference | prmTransformationBase* new Reference frame |
|
static |
|
static |
Print the tree to a graphviz dot file
If you have graphviz then "dot -Tjpg -o tree.jpg tree.dot" where tree.dot is the output of this function will print a tree representation of the transformation tree.
outputStream | std::ostream stream to dump dot file |
|
static |
Helper function for printing the tree to a graphviz dot file
|
static |
Compute the transformation between two frames (WRT = With Respect To). The computation will use registered get mtsCommandRead methods for the nodes on the path from node refFrame to node tipFrame. The implementation is a breadth first search from refFrame to tipFrame.
tipFrame | prmTransformationBasePtr the frame transform to be computed |
refFrame | prmTransformationBasePtr the reference frame chosen |
|
friend |
|
staticprotected |
List of modes on the last transformation computed.
|
static |
Frame used as reference for all other frames, root of the tree. All other frames are attached/detached by application code.
|
staticprotected |
Tree traversal helper
|
staticprotected |