No version for distro humble showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro jazzy showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro kilted showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro rolling showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro ardent showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro bouncy showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro crystal showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro eloquent showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro dashing showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro galactic showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro foxy showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro iron showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
jade

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
indigo

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

No version for distro hydro showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
lunar

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
kinetic

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
melodic

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange

Package symbol

trac_ik_python package from trac_ik repo

trac_ik trac_ik_examples trac_ik_kinematics_plugin trac_ik_lib trac_ik_python

ROS Distro
noetic

Package Summary

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
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

The trac_ik_python package contains a python wrapper using SWIG for trac_ik_lib

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

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

Dependant Packages

Name Deps
trac_ik

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged trac_ik_python at Robotics Stack Exchange