Tesseract 0.28.4
Loading...
Searching...
No Matches
tesseract::kinematics::JointGroup Class Reference

A Joint Group is defined by a list of joint_names. More...

#include <joint_group.h>

Inheritance diagram for tesseract::kinematics::JointGroup:

Public Types

using Ptr = std::shared_ptr<JointGroup>
using ConstPtr = std::shared_ptr<const JointGroup>
using UPtr = std::unique_ptr<JointGroup>
using ConstUPtr = std::unique_ptr<const JointGroup>

Public Member Functions

 JointGroup (const JointGroup &other)
JointGroup & operator= (const JointGroup &other)
 JointGroup (JointGroup &&)=default
JointGroup & operator= (JointGroup &&)=default
 JointGroup (std::string name, std::vector< tesseract::common::JointId > joint_ids, const tesseract::scene_graph::SceneGraph &scene_graph, const tesseract::scene_graph::SceneState &scene_state)
 Create a kinematics group without inverse kinematics for the provided joint ids.
tesseract::common::LinkIdTransformMap calcFwdKin (const Eigen::Ref< const Eigen::VectorXd > &joint_angles) const
 Calculates tool pose of robot chain.
void calcFwdKin (tesseract::common::LinkIdTransformMap &transforms, const Eigen::Ref< const Eigen::VectorXd > &joint_angles) const
 Calculates tool pose of robot chain.
Eigen::MatrixXd calcJacobian (const Eigen::Ref< const Eigen::VectorXd > &joint_angles, const tesseract::common::LinkId &link_id) const
 Calculates jacobian of robot given joint angles.
Eigen::MatrixXd calcJacobian (const Eigen::Ref< const Eigen::VectorXd > &joint_angles, const tesseract::common::LinkId &link_id, const Eigen::Vector3d &link_point) const
 Calculates jacobian of robot given joint angles.
Eigen::MatrixXd calcJacobian (const Eigen::Ref< const Eigen::VectorXd > &joint_angles, const tesseract::common::LinkId &base_link_id, const tesseract::common::LinkId &link_id) const
 Calculates jacobian of robot given joint angles.
Eigen::MatrixXd calcJacobian (const Eigen::Ref< const Eigen::VectorXd > &joint_angles, const tesseract::common::LinkId &base_link_id, const tesseract::common::LinkId &link_id, const Eigen::Vector3d &link_point) const
 Calculates jacobian of robot given joint angles.
const std::vector< tesseract::common::JointId > & getJointIds () const
 Get list of joint ids for kinematic object.
const std::vector< tesseract::common::LinkId > & getLinkIds () const
 Get list of all link ids (with and without geometry) for kinematic object.
const std::vector< tesseract::common::LinkId > & getActiveLinkIds () const
 Get list of active link ids (with and without geometry) for kinematic object.
const std::vector< tesseract::common::LinkId > & getStaticLinkIds () const
 Get list of static link ids (with and without geometry) for kinematic object.
bool isActiveLinkId (const tesseract::common::LinkId &link_id) const
 Check if link is an active link.
bool hasLinkId (const tesseract::common::LinkId &link_id) const
 Check if link id exists.
tesseract::common::KinematicLimits getLimits () const
 Get the kinematic limits (joint, velocity, acceleration, etc.).
void setLimits (const tesseract::common::KinematicLimits &limits)
 Setter for kinematic limits (joint, velocity, acceleration, etc.).
std::vector< Eigen::Index > getRedundancyCapableJointIndices () const
 Get vector indicating which joints are capable of producing redundant solutions.
Eigen::Index numJoints () const
 Number of joints in robot.
tesseract::common::LinkId getBaseLinkId () const
 Get the robot base link ID.
std::string getName () const
 Name of the manipulator.
bool checkJoints (const Eigen::Ref< const Eigen::VectorXd > &vec) const
 Check for consistency in # and limits of joints.

Protected Attributes

std::string name_
tesseract::scene_graph::SceneState state_
std::unique_ptr< tesseract::scene_graph::StateSolver > state_solver_
std::vector< tesseract::common::LinkId > link_ids_
std::vector< tesseract::common::JointId > joint_ids_
std::unordered_set< tesseract::common::LinkId > link_id_set_
std::vector< tesseract::common::LinkId > active_link_ids_
std::unordered_set< tesseract::common::LinkId > active_link_ids_set_
std::vector< tesseract::common::LinkId > static_link_ids_
tesseract::common::LinkIdTransformMap static_link_transforms_
tesseract::common::KinematicLimits limits_
std::vector< Eigen::Index > redundancy_indices_
std::vector< Eigen::Index > jacobian_map_

Detailed Description

A Joint Group is defined by a list of joint_names.

Provides the ability to calculate forward kinematics and jacobian.

Note
This creates an optimized object replace all joints not listed in the provided list with a fixed joint calculated using the provided state. Also the calcFwdKin only return the link transforms in the optimized object which is all active links and root of the scene graph usually.

Constructor & Destructor Documentation

◆ JointGroup()

tesseract::kinematics::JointGroup::JointGroup ( std::string name,
std::vector< tesseract::common::JointId > joint_ids,
const tesseract::scene_graph::SceneGraph & scene_graph,
const tesseract::scene_graph::SceneState & scene_state )

Create a kinematics group without inverse kinematics for the provided joint ids.

Parameters
nameThe name of the kinematic group
joint_idsThe joint ids to create kinematic group from
scene_graphThe scene graph
scene_stateThe scene state

Member Function Documentation

◆ calcFwdKin() [1/2]

tesseract::common::LinkIdTransformMap tesseract::kinematics::JointGroup::calcFwdKin ( const Eigen::Ref< const Eigen::VectorXd > & joint_angles) const

Calculates tool pose of robot chain.

Throws an exception on failures (including uninitialized)

Parameters
joint_anglesVector of joint angles (size must match number of joints in robot chain)
Returns
A map of LinkId to transforms

◆ calcFwdKin() [2/2]

void tesseract::kinematics::JointGroup::calcFwdKin ( tesseract::common::LinkIdTransformMap & transforms,
const Eigen::Ref< const Eigen::VectorXd > & joint_angles ) const

Calculates tool pose of robot chain.

Throws an exception on failures (including uninitialized). Overwrites the transform of every link in the group but does not clear transforms first; keys from another group persist. Reusing a scratch map without clearing is safe iff every key later read is a link of this group.

Parameters
transformsThe map to populate with transforms
joint_anglesVector of joint angles (size must match number of joints in robot chain)

◆ calcJacobian() [1/4]

Eigen::MatrixXd tesseract::kinematics::JointGroup::calcJacobian ( const Eigen::Ref< const Eigen::VectorXd > & joint_angles,
const tesseract::common::LinkId & link_id ) const

Calculates jacobian of robot given joint angles.

Parameters
joint_anglesInput vector of joint angles
link_idThe frame that the jacobian is calculated for
Returns
The jacobian at the provided link relative to the joint group base link

◆ calcJacobian() [2/4]

Eigen::MatrixXd tesseract::kinematics::JointGroup::calcJacobian ( const Eigen::Ref< const Eigen::VectorXd > & joint_angles,
const tesseract::common::LinkId & link_id,
const Eigen::Vector3d & link_point ) const

Calculates jacobian of robot given joint angles.

Parameters
joint_anglesInput vector of joint angles
link_idThe frame that the jacobian is calculated for
link_pointA point on the link that the jacobian is calculated for
Returns
The jacobian at the provided link relative to the joint group base link

◆ calcJacobian() [3/4]

Eigen::MatrixXd tesseract::kinematics::JointGroup::calcJacobian ( const Eigen::Ref< const Eigen::VectorXd > & joint_angles,
const tesseract::common::LinkId & base_link_id,
const tesseract::common::LinkId & link_id ) const

Calculates jacobian of robot given joint angles.

Parameters
joint_anglesInput vector of joint angles
base_link_idThe frame that the jacobian is calculated in
link_idThe frame that the jacobian is calculated for
Returns
The jacobian at the provided link_id relative to the provided base_link_id
Exceptions
std::runtime_errorIf the base link does not exist

◆ calcJacobian() [4/4]

Eigen::MatrixXd tesseract::kinematics::JointGroup::calcJacobian ( const Eigen::Ref< const Eigen::VectorXd > & joint_angles,
const tesseract::common::LinkId & base_link_id,
const tesseract::common::LinkId & link_id,
const Eigen::Vector3d & link_point ) const

Calculates jacobian of robot given joint angles.

Parameters
joint_anglesInput vector of joint angles
base_link_idThe frame that the jacobian is calculated in
link_idThe frame that the jacobian is calculated for
link_pointA point on the link that the jacobian is calculated for
Returns
The jacobian at the provided link_id relative to the provided base_link_id
Exceptions
std::runtime_errorIf the base link does not exist

◆ getJointIds()

const std::vector< tesseract::common::JointId > & tesseract::kinematics::JointGroup::getJointIds ( ) const

Get list of joint ids for kinematic object.

Returns
A vector of joint ids

◆ getLinkIds()

const std::vector< tesseract::common::LinkId > & tesseract::kinematics::JointGroup::getLinkIds ( ) const

Get list of all link ids (with and without geometry) for kinematic object.

Returns
A vector of link ids

◆ getActiveLinkIds()

const std::vector< tesseract::common::LinkId > & tesseract::kinematics::JointGroup::getActiveLinkIds ( ) const

Get list of active link ids (with and without geometry) for kinematic object.

Note: This only includes links that are children of the active joints

Returns
A vector of active link ids

◆ getStaticLinkIds()

const std::vector< tesseract::common::LinkId > & tesseract::kinematics::JointGroup::getStaticLinkIds ( ) const

Get list of static link ids (with and without geometry) for kinematic object.

Returns
A vector of static link ids

◆ isActiveLinkId()

bool tesseract::kinematics::JointGroup::isActiveLinkId ( const tesseract::common::LinkId & link_id) const

Check if link is an active link.

Parameters
link_idThe link id to check
Returns
True if active, otherwise false

◆ hasLinkId()

bool tesseract::kinematics::JointGroup::hasLinkId ( const tesseract::common::LinkId & link_id) const

Check if link id exists.

Parameters
link_idThe link id to check for
Returns
True if it exists, otherwise false

◆ getLimits()

tesseract::common::KinematicLimits tesseract::kinematics::JointGroup::getLimits ( ) const

Get the kinematic limits (joint, velocity, acceleration, etc.).

Returns
Kinematic Limits

◆ setLimits()

void tesseract::kinematics::JointGroup::setLimits ( const tesseract::common::KinematicLimits & limits)

Setter for kinematic limits (joint, velocity, acceleration, etc.).

Parameters
KinematicLimits

◆ getRedundancyCapableJointIndices()

std::vector< Eigen::Index > tesseract::kinematics::JointGroup::getRedundancyCapableJointIndices ( ) const

Get vector indicating which joints are capable of producing redundant solutions.

Returns
A vector of joint indices

◆ numJoints()

Eigen::Index tesseract::kinematics::JointGroup::numJoints ( ) const

Number of joints in robot.

Returns
Number of joints in robot

◆ checkJoints()

bool tesseract::kinematics::JointGroup::checkJoints ( const Eigen::Ref< const Eigen::VectorXd > & vec) const

Check for consistency in # and limits of joints.

Parameters
vecVector of joint values
Returns
True if size of vec matches # of robot joints and all joints are within limits