Specific implementation of kinematics using KDL. This version can be used with any robot. More...
#include <ur_moveit_plugin.h>
Public Member Functions | |
const std::vector< std::string > & | getJointNames () const |
Return all the joint names in the order they are used internally. | |
const std::vector< std::string > & | getLinkNames () const |
Return all the link names in the order they are represented internally. | |
virtual bool | getPositionFK (const std::vector< std::string > &link_names, const std::vector< double > &joint_angles, std::vector< geometry_msgs::Pose > &poses) const |
virtual bool | getPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, std::vector< double > &solution, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const |
virtual bool | initialize (const std::string &robot_description, const std::string &group_name, const std::string &base_name, const std::string &tip_name, double search_discretization) |
virtual bool | searchPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, std::vector< double > &solution, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const |
virtual bool | searchPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, const std::vector< double > &consistency_limits, std::vector< double > &solution, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const |
virtual bool | searchPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, std::vector< double > &solution, const IKCallbackFn &solution_callback, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const |
virtual bool | searchPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, const std::vector< double > &consistency_limits, std::vector< double > &solution, const IKCallbackFn &solution_callback, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const |
URKinematicsPlugin () | |
Default constructor. | |
Protected Member Functions | |
bool | searchPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, std::vector< double > &solution, const IKCallbackFn &solution_callback, moveit_msgs::MoveItErrorCodes &error_code, const std::vector< double > &consistency_limits, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const |
Given a desired pose of the end-effector, search for the joint angles required to reach it. This particular method is intended for "searching" for a solutions by stepping through the redundancy (or other numerical routines). | |
virtual bool | setRedundantJoints (const std::vector< unsigned int > &redundant_joint_indices) |
Private Member Functions | |
bool | checkConsistency (const KDL::JntArray &seed_state, const std::vector< double > &consistency_limit, const KDL::JntArray &solution) const |
Check whether the solution lies within the consistency limit of the seed state. | |
int | getJointIndex (const std::string &name) const |
int | getKDLSegmentIndex (const std::string &name) const |
void | getRandomConfiguration (KDL::JntArray &jnt_array, bool lock_redundancy) const |
void | getRandomConfiguration (const KDL::JntArray &seed_state, const std::vector< double > &consistency_limits, KDL::JntArray &jnt_array, bool lock_redundancy) const |
Get a random configuration within joint limits close to the seed state. | |
bool | isRedundantJoint (unsigned int index) const |
bool | timedOut (const ros::WallTime &start_time, double duration) const |
Private Attributes | |
bool | active_ |
std::string | arm_prefix_ |
unsigned int | dimension_ |
double | epsilon_ |
moveit_msgs::KinematicSolverInfo | fk_chain_info_ |
moveit_msgs::KinematicSolverInfo | ik_chain_info_ |
std::vector< double > | ik_weights_ |
KDL::JntArray | joint_max_ |
KDL::JntArray | joint_min_ |
robot_model::JointModelGroup * | joint_model_group_ |
KDL::Chain | kdl_base_chain_ |
KDL::Chain | kdl_chain_ |
KDL::Chain | kdl_tip_chain_ |
double | max_solver_iterations_ |
std::vector < kdl_kinematics_plugin::JointMimic > | mimic_joints_ |
int | num_possible_redundant_joints_ |
bool | position_ik_ |
random_numbers::RandomNumberGenerator | random_number_generator_ |
std::vector< unsigned int > | redundant_joints_map_index_ |
robot_model::RobotModelPtr | robot_model_ |
robot_state::RobotStatePtr | state_ |
robot_state::RobotStatePtr | state_2_ |
int | ur_joint_inds_start_ |
std::vector< std::string > | ur_joint_names_ |
std::vector< std::string > | ur_link_names_ |
Specific implementation of kinematics using KDL. This version can be used with any robot.
Definition at line 111 of file ur_moveit_plugin.h.
Default constructor.
Definition at line 97 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::checkConsistency | ( | const KDL::JntArray & | seed_state, |
const std::vector< double > & | consistency_limit, | ||
const KDL::JntArray & | solution | ||
) | const [private] |
Check whether the solution lies within the consistency limit of the seed state.
seed_state | Seed state |
redundancy | Index of the redundant joint within the chain |
consistency_limit | The returned state for redundant joint should be in the range [seed_state(redundancy_limit)-consistency_limit,seed_state(redundancy_limit)+consistency_limit] |
solution | solution configuration |
Definition at line 158 of file ur_moveit_plugin.cpp.
int ur_kinematics::URKinematicsPlugin::getJointIndex | ( | const std::string & | name | ) | const [private] |
Definition at line 432 of file ur_moveit_plugin.cpp.
const std::vector< std::string > & ur_kinematics::URKinematicsPlugin::getJointNames | ( | ) | const [virtual] |
Return all the joint names in the order they are used internally.
Implements kinematics::KinematicsBase.
Definition at line 782 of file ur_moveit_plugin.cpp.
int ur_kinematics::URKinematicsPlugin::getKDLSegmentIndex | ( | const std::string & | name | ) | const [private] |
Definition at line 441 of file ur_moveit_plugin.cpp.
const std::vector< std::string > & ur_kinematics::URKinematicsPlugin::getLinkNames | ( | ) | const [virtual] |
Return all the link names in the order they are represented internally.
Implements kinematics::KinematicsBase.
Definition at line 787 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::getPositionFK | ( | const std::vector< std::string > & | link_names, |
const std::vector< double > & | joint_angles, | ||
std::vector< geometry_msgs::Pose > & | poses | ||
) | const [virtual] |
Implements kinematics::KinematicsBase.
Definition at line 736 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::getPositionIK | ( | const geometry_msgs::Pose & | ik_pose, |
const std::vector< double > & | ik_seed_state, | ||
std::vector< double > & | solution, | ||
moveit_msgs::MoveItErrorCodes & | error_code, | ||
const kinematics::KinematicsQueryOptions & | options = kinematics::KinematicsQueryOptions() |
||
) | const [virtual] |
Implements kinematics::KinematicsBase.
Definition at line 458 of file ur_moveit_plugin.cpp.
void ur_kinematics::URKinematicsPlugin::getRandomConfiguration | ( | KDL::JntArray & | jnt_array, |
bool | lock_redundancy | ||
) | const [private] |
Definition at line 99 of file ur_moveit_plugin.cpp.
void ur_kinematics::URKinematicsPlugin::getRandomConfiguration | ( | const KDL::JntArray & | seed_state, |
const std::vector< double > & | consistency_limits, | ||
KDL::JntArray & | jnt_array, | ||
bool | lock_redundancy | ||
) | const [private] |
Get a random configuration within joint limits close to the seed state.
seed_state | Seed state |
redundancy | Index of the redundant joint within the chain |
consistency_limit | The returned state will contain a value for the redundant joint in the range [seed_state(redundancy_limit)-consistency_limit,seed_state(redundancy_limit)+consistency_limit] |
jnt_array | Returned random configuration |
Definition at line 121 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::initialize | ( | const std::string & | robot_description, |
const std::string & | group_name, | ||
const std::string & | base_name, | ||
const std::string & | tip_name, | ||
double | search_discretization | ||
) | [virtual] |
Implements kinematics::KinematicsBase.
Definition at line 168 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::isRedundantJoint | ( | unsigned int | index | ) | const [private] |
Definition at line 113 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::searchPositionIK | ( | const geometry_msgs::Pose & | ik_pose, |
const std::vector< double > & | ik_seed_state, | ||
double | timeout, | ||
std::vector< double > & | solution, | ||
moveit_msgs::MoveItErrorCodes & | error_code, | ||
const kinematics::KinematicsQueryOptions & | options = kinematics::KinematicsQueryOptions() |
||
) | const [virtual] |
Implements kinematics::KinematicsBase.
Definition at line 477 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::searchPositionIK | ( | const geometry_msgs::Pose & | ik_pose, |
const std::vector< double > & | ik_seed_state, | ||
double | timeout, | ||
const std::vector< double > & | consistency_limits, | ||
std::vector< double > & | solution, | ||
moveit_msgs::MoveItErrorCodes & | error_code, | ||
const kinematics::KinematicsQueryOptions & | options = kinematics::KinematicsQueryOptions() |
||
) | const [virtual] |
Implements kinematics::KinematicsBase.
Definition at line 497 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::searchPositionIK | ( | const geometry_msgs::Pose & | ik_pose, |
const std::vector< double > & | ik_seed_state, | ||
double | timeout, | ||
std::vector< double > & | solution, | ||
const IKCallbackFn & | solution_callback, | ||
moveit_msgs::MoveItErrorCodes & | error_code, | ||
const kinematics::KinematicsQueryOptions & | options = kinematics::KinematicsQueryOptions() |
||
) | const [virtual] |
Implements kinematics::KinematicsBase.
Definition at line 516 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::searchPositionIK | ( | const geometry_msgs::Pose & | ik_pose, |
const std::vector< double > & | ik_seed_state, | ||
double | timeout, | ||
const std::vector< double > & | consistency_limits, | ||
std::vector< double > & | solution, | ||
const IKCallbackFn & | solution_callback, | ||
moveit_msgs::MoveItErrorCodes & | error_code, | ||
const kinematics::KinematicsQueryOptions & | options = kinematics::KinematicsQueryOptions() |
||
) | const [virtual] |
Implements kinematics::KinematicsBase.
Definition at line 535 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::searchPositionIK | ( | const geometry_msgs::Pose & | ik_pose, |
const std::vector< double > & | ik_seed_state, | ||
double | timeout, | ||
std::vector< double > & | solution, | ||
const IKCallbackFn & | solution_callback, | ||
moveit_msgs::MoveItErrorCodes & | error_code, | ||
const std::vector< double > & | consistency_limits, | ||
const kinematics::KinematicsQueryOptions & | options = kinematics::KinematicsQueryOptions() |
||
) | const [protected] |
Given a desired pose of the end-effector, search for the joint angles required to reach it. This particular method is intended for "searching" for a solutions by stepping through the redundancy (or other numerical routines).
ik_pose | the desired pose of the link |
ik_seed_state | an initial guess solution for the inverse kinematics |
timeout | The amount of time (in seconds) available to the solver |
solution | the solution vector |
solution_callback | A callback solution for the IK solution |
error_code | an error code that encodes the reason for failure or success |
check_consistency | Set to true if consistency check needs to be performed |
redundancy | The index of the redundant joint |
consistency_limit | The returned solutuion will contain a value for the redundant joint in the range [seed_state(redundancy_limit)-consistency_limit,seed_state(redundancy_limit)+consistency_limit] |
Definition at line 558 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::setRedundantJoints | ( | const std::vector< unsigned int > & | redundant_joint_indices | ) | [protected, virtual] |
Reimplemented from kinematics::KinematicsBase.
Definition at line 388 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::timedOut | ( | const ros::WallTime & | start_time, |
double | duration | ||
) | const [private] |
Definition at line 453 of file ur_moveit_plugin.cpp.
bool ur_kinematics::URKinematicsPlugin::active_ [private] |
Definition at line 241 of file ur_moveit_plugin.h.
std::string ur_kinematics::URKinematicsPlugin::arm_prefix_ [private] |
Definition at line 273 of file ur_moveit_plugin.h.
unsigned int ur_kinematics::URKinematicsPlugin::dimension_ [private] |
Definition at line 249 of file ur_moveit_plugin.h.
double ur_kinematics::URKinematicsPlugin::epsilon_ [private] |
Definition at line 266 of file ur_moveit_plugin.h.
moveit_msgs::KinematicSolverInfo ur_kinematics::URKinematicsPlugin::fk_chain_info_ [private] |
Stores information for the inverse kinematics solver
Definition at line 245 of file ur_moveit_plugin.h.
moveit_msgs::KinematicSolverInfo ur_kinematics::URKinematicsPlugin::ik_chain_info_ [private] |
Internal variable that indicates whether solvers are configured and ready
Definition at line 243 of file ur_moveit_plugin.h.
std::vector<double> ur_kinematics::URKinematicsPlugin::ik_weights_ [private] |
Definition at line 269 of file ur_moveit_plugin.h.
Definition at line 251 of file ur_moveit_plugin.h.
Dimension of the group
Definition at line 251 of file ur_moveit_plugin.h.
robot_model::JointModelGroup* ur_kinematics::URKinematicsPlugin::joint_model_group_ [private] |
Definition at line 264 of file ur_moveit_plugin.h.
Definition at line 277 of file ur_moveit_plugin.h.
Store information for the forward kinematics solver
Definition at line 247 of file ur_moveit_plugin.h.
Definition at line 278 of file ur_moveit_plugin.h.
double ur_kinematics::URKinematicsPlugin::max_solver_iterations_ [private] |
Definition at line 265 of file ur_moveit_plugin.h.
std::vector<kdl_kinematics_plugin::JointMimic> ur_kinematics::URKinematicsPlugin::mimic_joints_ [private] |
Definition at line 267 of file ur_moveit_plugin.h.
Definition at line 259 of file ur_moveit_plugin.h.
bool ur_kinematics::URKinematicsPlugin::position_ik_ [private] |
Definition at line 263 of file ur_moveit_plugin.h.
random_numbers::RandomNumberGenerator ur_kinematics::URKinematicsPlugin::random_number_generator_ [mutable, private] |
Joint limits
Definition at line 253 of file ur_moveit_plugin.h.
std::vector<unsigned int> ur_kinematics::URKinematicsPlugin::redundant_joints_map_index_ [private] |
Definition at line 260 of file ur_moveit_plugin.h.
robot_model::RobotModelPtr ur_kinematics::URKinematicsPlugin::robot_model_ [private] |
Definition at line 255 of file ur_moveit_plugin.h.
robot_state::RobotStatePtr ur_kinematics::URKinematicsPlugin::state_ [private] |
Definition at line 257 of file ur_moveit_plugin.h.
robot_state::RobotStatePtr ur_kinematics::URKinematicsPlugin::state_2_ [private] |
Definition at line 257 of file ur_moveit_plugin.h.
int ur_kinematics::URKinematicsPlugin::ur_joint_inds_start_ [private] |
Definition at line 272 of file ur_moveit_plugin.h.
std::vector<std::string> ur_kinematics::URKinematicsPlugin::ur_joint_names_ [private] |
Definition at line 270 of file ur_moveit_plugin.h.
std::vector<std::string> ur_kinematics::URKinematicsPlugin::ur_link_names_ [private] |
Definition at line 271 of file ur_moveit_plugin.h.