Prioritized Inverse Kinematics ROS library pik_ros
.
The PIK solver gives a solution to the prioritized positional inverse kinematics problem: selecting joint positions that result in optimizing a number of prioritized tasks for different links in the kinematic chain.
In the image bellow you can see examples with following priorities:
spraying_frame
position, shown with a blue spherespraying_frame
approach axis orientation, shown with a blue arrowforearm_link
position, shown with a purple sphere
PIK ROS solver uses sequential prioritized optimization, where PtscEigen
is used for prioritized optimization, and MoveIt
is used for the robot model data and Jacobian calculation.
This project depends on ROS
, MoveIt
and PtscEigen
.
Clone to your catkin workspace and build with
catkin build pik_ros
//Include the library header
#include <PikRos.hpp>
//Construct the Pik object
PikRos::Pik my_pik( nh, //ros node handle
"my_robot_name", //namespace for robot description
"my_joint_model_group_name", //for MoveIt
settings); //PikRos::Settings object
//Define a vector of tasks, with descending priorities
//IkTask constructor takes arguments: (task_type, frame, desired_value)
std::vector<PikRos::IkTask> ik_tasks{
PikRos::IkTask( PikRos::FRAME_POSITION, "spraying_frame", desired_tool_position ),
PikRos::IkTask( PikRos::FRAME_APPROACH_AXIS, "spraying_frame", desired_approach_vector ),
PikRos::IkTask( PikRos::FRAME_POSITION, "forearm_link", desired_elbow_position )
};
// Solve problem
Eigen::VectorXd q = my_pik.solve( ik_tasks, q_initial_guess );
Find the pik_ros
pacakage in your CMakeLists.txt file:
find_package( catkin REQUIRED COMPONENTS
pik_ros
... )
And link the catkin libraries:
target_link_libraries( your_target_name
${catkin_LIBRARIES}
... )
For a complete usage example see kinova_gen3_pik_examples
Priorities are given to the solver as a vector of PikRos::IkTask objects, with descending priorities.
PikRos::IkTaskType describes a particular task type given to the solver. Available task types are:
FRAME_POSITION
- Frame position task, has a value of [x, y, z]^T in metersFRAME_ORIENTATION
- Frame orientation task, has a quaternion value [w, x, y, z]^TFRAME_POSE
- Frame pose task, a combination of FRAME_POSITION and FRAME_ORIENTATION tasksFRAME_APPROACH_AXIS
- Frame approach axis task, has a value of a 3D vector [x, y, z]^T
If you use this code in a scholarly work, please consider citing our paper
:
@misc{https://doi.org/10.48550/arxiv.2307.00302,
doi = {10.48550/ARXIV.2307.00302},
url = {https://arxiv.org/abs/2307.00302},
author = {Vatavuk, Ivo and Kovačić, Zdenko},
keywords = {Robotics (cs.RO), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Constrained Prioritized 3T2R Task Control for Robotic Agricultural Spraying},
publisher = {arXiv},
year = {2023},
copyright = {arXiv.org perpetual, non-exclusive license}
}
Materials in this repository are distributed under the following license:
All software is licensed under the BSD 3-Clause License.