Skip to content

Commit 71c4779

Browse files
committed
test: verify mass_matrix_rnea and forward_dynamics_rnea match optimized versions
1 parent c9a88a8 commit 71c4779

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

test/runtests.jl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,34 @@ Aqua.test_all(ModernRoboticsBook)
10231023
)
10241024
end
10251025

1026+
@testset "textbook algorithms match optimized versions" begin
1027+
robot = load_robot(joinpath(models_dir, "3dof_textbook.json"))
1028+
1029+
q = [0.1, 0.1, 0.1]
1030+
dq = [0.1, 0.2, 0.3]
1031+
tau = [0.5, 0.6, 0.7]
1032+
g = [0.0, 0.0, -9.8]
1033+
Ftip = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
1034+
1035+
@test mass_matrix_rnea(
1036+
q,
1037+
robot.link_frames,
1038+
robot.spatial_inertias,
1039+
robot.screw_axes_space,
1040+
) mass_matrix_crba(robot, q)
1041+
1042+
@test forward_dynamics_rnea(
1043+
q,
1044+
dq,
1045+
tau,
1046+
g,
1047+
Ftip,
1048+
robot.link_frames,
1049+
robot.spatial_inertias,
1050+
robot.screw_axes_space,
1051+
) forward_dynamics_crba(robot, q, dq, tau; gravity = g, tip_wrench = Ftip)
1052+
end
1053+
10261054
@testset "load UR5 model" begin
10271055
robot = load_robot(joinpath(models_dir, "ur5.json"))
10281056
@test robot.name == "ur5"

0 commit comments

Comments
 (0)