Simox
2.3.74.0
|
This class provides intelligent coordinates for the virtual robot. More...
Public Member Functions | |
LinkedCoordinate (const RobotPtr &virtualRobot) | |
LinkedCoordinate (const LinkedCoordinate &other) | |
LinkedCoordinate & | operator= (const LinkedCoordinate &other) |
virtual | ~LinkedCoordinate () |
void | set (const RobotNodePtr &frame, const Eigen::Matrix4f &pose=Eigen::Matrix4f::Identity()) |
void | set (const RobotNodePtr &frame, const Eigen::Vector3f &position) |
void | set (const std::string &frame, const Eigen::Matrix4f &pose=Eigen::Matrix4f::Identity()) |
void | set (const std::string &frame, const Eigen::Vector3f &position) |
RobotNodePtr | getFrame () const |
void | changeFrame (const std::string &frame) |
void | changeFrame (const RobotNodePtr &frame) |
Eigen::Matrix4f | getInFrame (const std::string &frame) const |
Eigen::Matrix4f | getInFrame (const RobotNodePtr &frame) const |
Eigen::Matrix4f | getPose () const |
Eigen::Vector3f | getPosition () const |
Static Public Member Functions | |
static Eigen::Matrix4f | getCoordinateTransformation (const RobotNodePtr &origin, const RobotNodePtr &destination, const RobotPtr &robot) |
Computes the transformation matrix that represents a coordinate transformation. More... | |
Protected Attributes | |
RobotPtr | robot |
Eigen::Matrix4f | pose |
RobotNodePtr | frame |
This class provides intelligent coordinates for the virtual robot.
The intelligent coordinates (and poses!) are connected to the virtual robot and are aware of the reference frame they have been defined in. In addition, they allow coordinate transformations using the current state of the robot.
Let instances conveniently be created by RobotNode and Robot instances.
Look for convenient converter functions. For instance, QuaternionToMatrix4f.
Compile and design test cases. For instance, the transformation between to successing joints should be easy to confirm if there is a getTransformFromParent().
Check if the order of const and throw is okay.
|
inline |
Creates a new intelligent coordinate.
virtualRobot | Pointer to the virtual robot the coordinate is connected to. |
LinkedCoordinate::LinkedCoordinate | ( | const LinkedCoordinate & | other | ) |
|
virtual |
void LinkedCoordinate::changeFrame | ( | const std::string & | frame | ) |
Sets a new reference frame and performs a coordinate transformation into this new frame.
frame | The name of the robot node that defines the new reference. |
If iCoord::set has not been called before, the pose is set to the unit marix.
void LinkedCoordinate::changeFrame | ( | const RobotNodePtr & | frame | ) |
Sets a new reference frame and performs a coordinate transformation into this new frame.
frame | A reference to the robot node that defines the new reference. |
If iCoord::set has not been called before, the pose is set to the unit marix.
VirtualRobotException | An exception is thrown if frame is NULL. |
|
static |
Computes the transformation matrix that represents a coordinate transformation.
|
inline |
Returns a RobotNodePtr that contains the frame of reference the coordinate is defined in.
The actual matrix then can be obtained by calling RobotNode::getGlobalPose().
Eigen::Matrix4f LinkedCoordinate::getInFrame | ( | const std::string & | frame | ) | const |
Performs only a coordinate transformation into a new frame of reference.
frame | The name of the robot node that defines the new reference. |
If iCoord::set has not been called before, the pose is set to the unit marix.
Eigen::Matrix4f LinkedCoordinate::getInFrame | ( | const RobotNodePtr & | frame | ) | const |
Performs only a coordinate transformation into a new frame of reference.
frame | A reference to the robot node that defines the new reference. |
If iCoord::set has not been called before, the pose is set to the unit marix.
If you are only interested in the translational part use iCoord::getPosition() or Eigen::Matrix4f::block<3,1>(0,3).
VirtualRobotException | An exception is thrown if frame is NULL. |
|
inline |
Returns the actual pose stored in this object.
If you are only interested in the translational part use iCoord::getPosition() or Eigen::Matrix4f::block<3,1>(0,3).
|
inline |
Conveniently returns the translational part of the actual pose stored in this object.
|
default |
void LinkedCoordinate::set | ( | const RobotNodePtr & | frame, |
const Eigen::Matrix4f & | pose = Eigen::Matrix4f::Identity() |
||
) |
Sets the frame of reference and the pose relative to it.
frame | The name of the robot node that defines the reference frame of the coordinate. |
pose | A homogeneous matrix that defines the pose relative to the frame of reference. If omitted, it defaults to the identity matrix. |
VirtualRobotException | An exception is thrown if frame does not belong to the robot or the reference is empty. |
If you want to use a different format for the pose you can use these helper functions
void LinkedCoordinate::set | ( | const RobotNodePtr & | frame, |
const Eigen::Vector3f & | position | ||
) |
Sets the frame of reference and the coordinate relative to it.
frame | The name of the robot node that defines the reference frame of the coordinate. |
position | A translational vector defines the position relative to the frame of reference. |
VirtualRobotException | An exception is thrown if frame does not belong to the robot. |
A homogeneous vector can be converted using Eigen::Vector4f::head<3>().
void LinkedCoordinate::set | ( | const std::string & | frame, |
const Eigen::Matrix4f & | pose = Eigen::Matrix4f::Identity() |
||
) |
Sets the frame of reference and the pose relative to it.
frame | The name of the robot node that defines the reference frame of the coordinate. |
pose | A homogeneous matrix that defines the pose relative to the frame of reference. If omitted, it defaults to the identity matrix. |
VirtualRobotException | An exception is thrown if frame does not belong to the robot or the reference is empty. |
void LinkedCoordinate::set | ( | const std::string & | frame, |
const Eigen::Vector3f & | position | ||
) |
Sets the frame of reference and the coordinate relative to it.
frame | The name of the robot node that defines the reference frame of the coordinate. |
position | The pose relative to the frame of reference. |
VirtualRobotException | An exception is thrown if frame does not belong to the robot. |
A homogeneous vector can be previously converted using Eigen::Vector4f::head<3>().
|
protected |
|
protected |
|
protected |