Created
September 23, 2019 13:35
-
-
Save philipptempel/a79bf79355a76900c6dc52b402d2d5a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Create directory
sandbox
and place this content into filekinematics.py
Then just run it.