Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import cdpyr
from sample import robots
import timeit
def main():
# sample robot to use
r = robots.ipanema_cuboid()
# a sample pose to use
pose = cdpyr.motion.Pose()
# our kinematics solver using the pulley-based kinematics
kinsolver = cdpyr.algorithms.kinematics.KinematicsSolver.STANDARD
structmatsolver = cdpyr.algorithms.structurematrix.StructureMatrixSolver
# and solve it
cable_length, cable_direction, unit_direction = kinsolver.backward(robot=r, pose=pose)
# timeit.timeit(
# 'kinsolver.backward(robot=r, pose=pose)',
# globals={
# 'r': r,
# 'pose': pose,
# 'kinsolver': kinsolver
# }
# )
print(cable_length)
print(cable_direction)
print(unit_direction)
if __name__ == "__main__":
main()
@philipptempel

This comment has been minimized.

Copy link
Owner Author

philipptempel commented Sep 23, 2019

Create directory sandbox and place this content into file kinematics.py
Then just run it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.