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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Create directory
sandbox
and place this content into filekinematics.py
Then just run it.