![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-04-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-04-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | kilted |
Last Updated | 2025-05-20 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | rolling |
Last Updated | 2025-05-20 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-04-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-04-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-04-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-04-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-04-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-04-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-04-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-04-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.7 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | master |
Last Updated | 2025-05-20 |
Dev Status | DEVELOPED |
CI status | Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.7 (2025-05-20)
- drop requirement for obsolete c++ standard to support compiling on newer systems with log4cxx requiring c++17 (#39)
- Contributors: v4hn
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Name | Deps |
---|---|
trac_ik |
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.7 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | master |
Last Updated | 2025-05-20 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.7 (2025-05-20)
- drop requirement for obsolete c++ standard to support compiling on newer systems with log4cxx requiring c++17 (#39)
- Contributors: v4hn
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Name | Deps |
---|---|
trac_ik |
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.7 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | master |
Last Updated | 2025-05-20 |
Dev Status | DEVELOPED |
CI status | Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.7 (2025-05-20)
- drop requirement for obsolete c++ standard to support compiling on newer systems with log4cxx requiring c++17 (#39)
- Contributors: v4hn
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Name | Deps |
---|---|
trac_ik |
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-04-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.7 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | master |
Last Updated | 2025-05-20 |
Dev Status | DEVELOPED |
CI status | Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.7 (2025-05-20)
- drop requirement for obsolete c++ standard to support compiling on newer systems with log4cxx requiring c++17 (#39)
- Contributors: v4hn
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Name | Deps |
---|---|
trac_ik |
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.7 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | master |
Last Updated | 2025-05-20 |
Dev Status | DEVELOPED |
CI status | Continuous Integration : 0 / 0 |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.7 (2025-05-20)
- drop requirement for obsolete c++ standard to support compiling on newer systems with log4cxx requiring c++17 (#39)
- Contributors: v4hn
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Name | Deps |
---|---|
trac_ik |
Launch files
Messages
Services
Plugins
Recent questions tagged trac_ik_python at Robotics Stack Exchange
![]() |
trac_ik_python package from trac_ik repotrac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 1.6.7 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://bitbucket.org/traclabs/trac_ik.git |
VCS Type | git |
VCS Version | master |
Last Updated | 2025-05-20 |
Dev Status | DEVELOPED |
CI status | Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Sam Pfeiffer
- TRACLabs Robotics
Authors
- Sam Pfeiffer
trac_ik_python
Python wrapper for TRAC IK library using SWIG to generate the bindings. Please send any questions to Sam Pfeiffer
Example usage
Upload a robot to the param server:
roslaunch pr2_description upload_pr2.launch
Now you can get IK’s:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3, # X, Y, Z
0.0, 0.0, 0.0, 1.0) # QX, QY, QZ, QW
# Returns:
# (0.537242808640495,
# 0.04673341230604478,
# -0.053508394352190486,
# -1.5099959208163785,
# 2.6007509004432596,
# -1.506431092603137,
# -3.040949079090651)
You can also play with the bounds of the IK call:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
seed_state = [0.0] * ik_solver.number_of_joints
ik_solver.get_ik(seed_state,
0.45, 0.1, 0.3,
0.0, 0.0, 0.0, 1.0,
0.01, 0.01, 0.01, # X, Y, Z bounds
0.1, 0.1, 0.1) # Rotation X, Y, Z bounds
)
# Returns:
# (0.5646018385887146,
# 0.04759637706046231,
# 0.026629718805901908,
# -1.5106828886580062,
# 2.5541685245726535,
# -1.4663448384900402,
# -3.104163452483634)
The coordinate frame of the given poses must be in the base frame, you can check the links/joints being used:
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link")
ik_solver.base_link
# 'torso_lift_link'
ik_solver.tip_link
# 'r_wrist_roll_link'
ik_solver.joint_names
# ('r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint')
ik_solver.link_names
# ('r_shoulder_pan_link', 'r_shoulder_lift_link', 'r_upper_arm_roll_link', 'r_upper_arm_link', 'r_elbow_flex_link', 'r_forearm_roll_link', 'r_forearm_link', 'r_wrist_flex_link', 'r_wrist_roll_link')
You can also initialize the IK from a string containing the URDF (by default it takes it from the /robot_description
parameter in the param server):
#!/usr/bin/env python
from trac_ik_python.trac_ik import IK
# Get your URDF from somewhere
urdf_str = rospy.get_param('/robot_description')
ik_solver = IK("torso_lift_link",
"r_wrist_roll_link",
urdf_string=urdf_str)
File truncated at 100 lines see the full file
Changelog for package trac_ik_python
1.6.7 (2025-05-20)
- drop requirement for obsolete c++ standard to support compiling on newer systems with log4cxx requiring c++17 (#39)
- Contributors: v4hn
1.6.6 (2021-05-05)
- propagated nlopt deps to sat packages
- Contributors: Stephen Hart
1.6.4 (2021-04-29)
- added nlopt depends to traciklib cmake
- Contributors: Stephen Hart
1.6.2 (2021-03-17)
- changed package.xmls to format 3
- Contributors: Stephen Hart
Wiki Tutorials
Dependant Packages
Name | Deps |
---|---|
trac_ik |