Coverage for src/robotics_numpy/kinematics/__init__.py: 16%

32 statements  

« prev     ^ index     » next       coverage.py v7.9.2, created at 2025-07-14 16:02 +0200

1""" 

2Kinematics module for robotics-numpy 

3 

4This module provides robot kinematics functionality including: 

5- Forward kinematics using DH parameters 

6- Inverse kinematics (numerical and analytical methods) 

7- Jacobian computation (geometric and analytical) 

8- Velocity and acceleration kinematics 

9 

10The module is designed to be lightweight and fast, using only NumPy. 

11""" 

12 

13from .forward import ( 

14 fkine_dh, 

15 fkine_dh_all, 

16 fkine_dh_partial, 

17 fkine_dh_batch, 

18 link_poses, 

19 joint_axes, 

20 validate_joint_config, 

21 fkine_performance_test, 

22 fkine_6dof, 

23 fkine_planar, 

24) 

25 

26# Inverse kinematics will be implemented in Phase 2.1 

27# from .inverse import ( 

28# ikine_lm, 

29# ikine_newton, 

30# ikine_numerical, 

31# ) 

32 

33# Jacobian computation implemented in Phase 2.2 

34from .jacobian import ( 

35 tr2jac, 

36 jacobe, 

37 jacob0, 

38 manipulability, 

39 joint_velocity_ellipsoid, 

40) 

41 

42__all__ = [ 

43 # Forward kinematics 

44 "fkine_dh", 

45 "fkine_dh_all", 

46 "fkine_dh_partial", 

47 "fkine_dh_batch", 

48 "link_poses", 

49 "joint_axes", 

50 "validate_joint_config", 

51 "fkine_performance_test", 

52 "fkine_6dof", 

53 "fkine_planar", 

54 # Coming in Phase 2.1 

55 # "ikine_lm", 

56 # "ikine_newton", 

57 # "ikine_numerical", 

58 # Jacobian computation 

59 "tr2jac", 

60 "jacobe", 

61 "jacob0", 

62 "manipulability", 

63 "joint_velocity_ellipsoid", 

64] 

65 

66# Version for Phase 2 

67_KINEMATICS_VERSION = "0.2.0-dev" 

68 

69 

70def about_kinematics() -> None: 

71 """Print information about kinematics module.""" 

72 print("Robotics NumPy - Kinematics Module") 

73 print("==================================") 

74 print() 

75 print("Features implemented:") 

76 print(" ✅ Forward kinematics using DH parameters") 

77 print(" ✅ Batch forward kinematics computation") 

78 print(" ✅ Partial chain kinematics") 

79 print(" ✅ Link pose computation") 

80 print(" ✅ Joint axis computation") 

81 print(" ✅ Configuration validation") 

82 print(" ✅ Performance testing utilities") 

83 print() 

84 print("Coming soon in Phase 2:") 

85 print(" 🚧 Numerical inverse kinematics (LM, Newton-Raphson)") 

86 print(" 🚧 Analytical inverse kinematics for specific robots") 

87 print(" ✅ Geometric and analytical Jacobian computation") 

88 print(" 🚧 Velocity and acceleration kinematics") 

89 print(" 🚧 Singularity analysis") 

90 print() 

91 print("Usage examples:") 

92 print(" >>> from robotics_numpy.kinematics import fkine_dh") 

93 print(" >>> from robotics_numpy.models import Stanford") 

94 print(" >>> robot = Stanford()") 

95 print(" >>> T = robot.fkine([0, 0, 0, 0, 0, 0])") 

96 print(" >>> poses = robot.fkine_all([0, 0, 0, 0, 0, 0])") 

97 print(" >>> J = robot.jacob0([0, 0, 0, 0, 0, 0])") 

98 print(" >>> m = robot.manipulability([0, 0, 0, 0, 0, 0])")