Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
698d3d0
Forward pass on first order derivatives
DVolpi256 Oct 23, 2025
9bc3af0
Added a backward pass and changed derivative matrix dimensions.
DVolpi256 Oct 28, 2025
b594f40
Added swapped force product to first order derivative function and ad…
DVolpi256 Oct 31, 2025
64162ef
Tested firstOrderInverseDynamicsDeriviatives with additional lines in…
DVolpi256 Nov 3, 2025
7158c94
Added S_ring terms
DVolpi256 Nov 20, 2025
67839c2
Merge remote-tracking branch 'origin/main' into first_order_derivatives
DVolpi256 Dec 5, 2025
f993b1e
Started attempt to fix memory allocation error when calling ID deriva…
DVolpi256 Dec 5, 2025
412f4e3
Narrowed down the memory-related errors to a problem starting on line…
DVolpi256 Dec 10, 2025
26503ec
build cleanup for debugging
pwensing Dec 10, 2025
2f548bf
Fixes for sizing
pwensing Dec 10, 2025
8202e2d
Less aggressive debug flags
pwensing Dec 10, 2025
49cd0e1
Debugged the rest of the ID derivatives function, and now the test pa…
DVolpi256 Dec 12, 2025
b87f990
Added std::complex<double> support from the complex step branch
DVolpi256 Dec 13, 2025
4f96b30
Made adjustments to test the inverse dynamics derivative function wit…
DVolpi256 Dec 16, 2025
6aedefa
Changed the finite difference to a complex step
DVolpi256 Dec 16, 2025
53901fd
Made separate tests for the inverse dynamics derivatives. One does a …
DVolpi256 Dec 17, 2025
4bf2ca1
Fixed an issue pertaining to gravity propagation. The inverse dynamic…
DVolpi256 Dec 18, 2025
8416cfb
Condensed the ID derivatives forward pass.
DVolpi256 Dec 18, 2025
3555b8e
Added the Mini Cheetah to the finite difference code.
DVolpi256 Dec 18, 2025
163b6d2
streamlined unit test
pwensing Dec 18, 2025
996775e
Merge branch 'anon_func' into first_order_derivatives
pwensing Dec 18, 2025
c104c3f
prototype code
pwensing Dec 18, 2025
4767fbf
prototype code
pwensing Dec 18, 2025
e2bf3ff
Expanded out the framework for a floating base finite difference. It …
DVolpi256 Dec 19, 2025
9ad7776
Fleshed out Lie group complex step and tested with Mini Cheetah.
DVolpi256 Dec 19, 2025
e1bf655
Added comments to ClusterTreeDynamics.cpp documenting necessary gradi…
DVolpi256 Dec 20, 2025
a4d792a
Made fixes to get testInverseDynamicsDerivatives working for the Mini…
DVolpi256 Dec 26, 2025
61cae82
The finite difference step for the Mini Cheetah now works without bre…
DVolpi256 Dec 26, 2025
8ec3fb8
Fix MiniCheetah test with [pos, quat] ordering and revert ClusterTree…
DVolpi256 Dec 26, 2025
62bfeb3
Fix MiniCheetah test to pass without breaking CasADi tests
DVolpi256 Dec 26, 2025
3302850
Fix complex-step configuration ordering and complex conjugation bug
DVolpi256 Dec 26, 2025
97fb0ea
Needed to address how the complex model of the mini cheetah was build…
DVolpi256 Dec 28, 2025
7039079
Made the first steps to add in derivative terms. Joints that have zer…
DVolpi256 Dec 31, 2025
630e19f
Created a revolute pair absolute joint to test a non-zero derivative …
DVolpi256 Jan 1, 2026
eca71ee
Made major progress in getting the MIT Humanoid to pass the inverse d…
DVolpi256 Jan 2, 2026
ab111ec
Implemented derivative term support for all but the generic joint. Wi…
DVolpi256 Jan 4, 2026
41b69ce
Created framework for generic joint derivatives, changed limit on so3…
DVolpi256 Jan 7, 2026
b26369c
Completed the generic joint derivatives and added new tests for finit…
DVolpi256 Jan 7, 2026
b1ab602
Commented out the implicit constraint FDs due to stochastic constrain…
DVolpi256 Jan 7, 2026
c40ae4d
There are now preliminary tests for the planar leg linkage, Tello, an…
DVolpi256 Jan 8, 2026
0c13617
Upped the accuracy on the finite difference and complex step tests. T…
DVolpi256 Jan 8, 2026
11f8f36
Refined tests. Complex step does not seem possible due to Casadi inco…
DVolpi256 Jan 9, 2026
e231b8a
Further refined the Tello tests.
DVolpi256 Jan 9, 2026
1f6b4f7
Fixed memory issues that now allow the Four Bar, Tello, and TelloWith…
DVolpi256 Jan 13, 2026
0b89917
Added a five-point stencil throughout the finite difference code.
DVolpi256 Jan 14, 2026
5995ca0
Polished up the implicit constraint finite difference tests.
DVolpi256 Jan 14, 2026
0e2ae7e
Added benchmarks for firsOrderIDDerivatives() and made adjustments fo…
DVolpi256 Jan 16, 2026
8f56cc8
Made various improvements to increase performance. Will need to do an…
DVolpi256 Jan 17, 2026
67c7843
Added batched operations for additional speed gains and examined the …
DVolpi256 Jan 18, 2026
bdaf9f2
Added robots and adjusted benchmark figure generation for paper, post…
DVolpi256 Mar 19, 2026
a7ae4a9
Added support for Tello complex step test
DVolpi256 Mar 24, 2026
c6bc8df
Finalized complex step test for closed loop constraints
DVolpi256 Mar 24, 2026
adc6310
Improved getSdotqd_q
pwensing Apr 21, 2026
6737d4f
make generic
pwensing Apr 21, 2026
c85dcb2
Adding back in finite diff comparisson code
pwensing Apr 22, 2026
2702f5e
Finite diff verification for getSdotqd_q
pwensing Apr 22, 2026
da1e0f4
clean up
pwensing Apr 22, 2026
f48fda2
whoops -- more cleanup
pwensing Apr 22, 2026
a36c741
Changed how getSq and is handled using jacobian_S_times_b and jacobia…
DVolpi256 Apr 22, 2026
e18b708
fix GenericJoint?
pwensing Apr 22, 2026
32c5427
Attempt at a refactor of GenericJoint for S derivatives. Need to impl…
DVolpi256 Apr 22, 2026
1aa6a6a
Included most recent Kangaroo and Cassie complex step tests.
DVolpi256 Apr 23, 2026
6a362ec
Should restore genericjoint functionality to before yesterday's edits…
DVolpi256 Apr 23, 2026
7056102
small cleanup in lie group addition routine
pwensing Apr 23, 2026
48b011f
Setting up ability to do complex step for states off the constriant m…
pwensing Apr 23, 2026
372311b
Initial q perturbation switched to G method
pwensing Apr 23, 2026
8acac7c
Updated complex step second instance
pwensing Apr 23, 2026
1e3064e
tello derivatives now allow finite diff steps off the constraint mani…
pwensing Apr 23, 2026
632d1ae
Streamline
pwensing Apr 23, 2026
3e045e8
Remove Unused
pwensing Apr 23, 2026
62f32c1
Streamline code
pwensing Apr 23, 2026
45fbcae
Cleanup
pwensing Apr 23, 2026
a40b29e
Errors persist for MIT humanoid, but builds. PlanarLegLinkage derivat…
pwensing Apr 23, 2026
08c66ec
streamline
pwensing Apr 23, 2026
6ba907d
use joint constraint solving
pwensing Apr 23, 2026
2d3903e
helper for randomizing model state
pwensing Apr 23, 2026
cad4c8a
many tests restored
pwensing Apr 23, 2026
73c97ff
Remove direct tests
pwensing Apr 23, 2026
b45833d
cleanup
pwensing Apr 23, 2026
f88a351
cleanup
pwensing Apr 23, 2026
bc284da
refactored out simple tests
pwensing Apr 23, 2026
18faa2d
humanoid passes again
pwensing Apr 24, 2026
c607afc
comment for PlanarLinkage Unit tests
pwensing Apr 24, 2026
f8e70cc
cleanup
pwensing Apr 24, 2026
50adb93
clarifying comment
pwensing Apr 24, 2026
c06717a
Allow random states off manifold -- revisit
pwensing Apr 24, 2026
f5aacbc
restore testRigidBodyDynamicsAlgos
pwensing Apr 24, 2026
c8c535f
add native phi to fix tello constraint handling
pwensing Apr 24, 2026
580bb7a
native_phi issue alerts
pwensing Apr 24, 2026
8a2795b
Streamline further for commonality between simple and complex step tests
pwensing Apr 24, 2026
265718f
Working to simplify the Simple unit tests
pwensing Apr 24, 2026
8755302
Simplified the simple unit test
pwensing Apr 24, 2026
5d7afa4
Cleaned up unit tests
pwensing Apr 24, 2026
f703f58
Oh boy. Four bars fixed.
pwensing Apr 24, 2026
abf33d6
Fail
pwensing Apr 24, 2026
2b1a751
Fix fail -- make sure MITHumanoid samples a feasible state (now that …
pwensing Apr 24, 2026
a889491
ComplexStepTests
pwensing Apr 24, 2026
ab5fca9
This is the 80% complete code for switching getSq() to jacobian AD code.
DVolpi256 Apr 26, 2026
8b0d938
Moved getSq() is now only defaulted to for the revolute triple
DVolpi256 Apr 27, 2026
ace6da9
Fully replaced getSq() terms, added a revolute triple fallback, and w…
DVolpi256 Apr 27, 2026
43d0afe
Adding benchmark breakdown and attempting to fix unnecessary dynamic …
DVolpi256 Apr 28, 2026
5f728d6
Fixed Teleop Arm failure
DVolpi256 Apr 28, 2026
f3bf98d
Updated the loop depth test to test the proper model shape.
DVolpi256 Apr 29, 2026
d6d89bd
Fixed MIT Humanoid (-R) timing problem
DVolpi256 Apr 29, 2026
c0e0fc6
Moved accuracy documentation code into testIDDerivativesComplexStep …
DVolpi256 Apr 30, 2026
2e45f24
Fixed revolute pair w/o rotor
DVolpi256 Apr 30, 2026
e66ae09
Updated benchmarking files to make newest figures. Also expanded the …
DVolpi256 May 2, 2026
aa2e19a
Fix MIT Humanoid
pwensing May 5, 2026
10d694a
fixed testClusterJoints for compatibility with new nq nv with revolut…
pwensing May 5, 2026
6209de1
fix algosDerivatives test
pwensing May 5, 2026
0846b44
WIP -- attempt fix of forwardKinematics test
pwensing May 5, 2026
17ef582
Partial fix for reflected inertia algorithms -- something is still of…
pwensing May 5, 2026
37ec573
Disable RevolutePairChainWithRotor in reflectedinertia tests for now.
pwensing May 5, 2026
7c0e1a4
Fix forward kinematics test
pwensing May 5, 2026
6ae0637
Bye bye mr kangaroo
pwensing May 5, 2026
22814ea
Missed one kangaroo test -- removed
pwensing May 5, 2026
3c46077
Remove benchmarkIDDerivativesAccuracy
pwensing May 5, 2026
9a57649
relax cassie tolerance for non-deterministic unit test
pwensing May 5, 2026
69411ee
deterministic seed for unit tests so tests can catch true regressions…
pwensing May 5, 2026
b1b9779
Fix tello constraint functions (errant integer division)
pwensing May 5, 2026
706e1d6
Remove debug for native_phi
pwensing May 5, 2026
beb4e61
Restore kinematics check vs. Revolute Pair Cluster
pwensing May 5, 2026
6b2fdbd
Patch fix for reflected inertia tests
pwensing May 5, 2026
0955e32
Restore Revolute Pair Chain Reflected inertia test
pwensing May 5, 2026
c314926
Updated the Cassie model to utilize the proper inertias from its MJCF…
DVolpi256 May 5, 2026
d81d585
Fix silent undefined behavior in makeRPWRBodies/makeRPWRJoints sort
pwensing May 5, 2026
1018277
streamline generic joint (remove unused functions)
pwensing May 6, 2026
5a0e15b
candidate jit options
pwensing May 6, 2026
f43543c
Updated Cassie to match the library's handling of four bar mechanisms
DVolpi256 May 6, 2026
ecc5c77
Added breakdown code to benchmarkParallelChainDepth and updated the b…
DVolpi256 May 7, 2026
bea1865
No update articulated body inertias in inverse dynamics derivatives
pwensing May 7, 2026
bb90a6d
Fixed incorrect number of bodies for Cassie and KUKA
DVolpi256 May 20, 2026
e91791c
Removed Tello variants that were no longer in use
DVolpi256 May 20, 2026
7fd398a
Removed unused code in testClusterTreeModel.cpp
DVolpi256 May 20, 2026
075434b
Squashed commit of the following:
pwensing May 20, 2026
ef59e1c
Removed residual usage of phi native and replaced getSq usage in Worl…
DVolpi256 May 21, 2026
0b3bf8c
Removed residual usage of getSq()
DVolpi256 May 21, 2026
634255f
Removed GenericJoint usage of and references to caching
DVolpi256 May 21, 2026
7c755bb
Remove benchmarking divergences from main (profiling instrumentation,…
DVolpi256 May 22, 2026
22647b5
Removed more dead references to getSq() and caching behavior
DVolpi256 May 26, 2026
0fe636d
Removed dead references to Sdotqd_qd_
DVolpi256 May 26, 2026
c2b2a01
Update GenericJoint.h
DVolpi256 May 26, 2026
6a4b44f
q_cache_ is now q_spanning_ to prevent confusion with caching behavior
DVolpi256 May 26, 2026
d34ecc3
Rewrite comments on quaternion normalization
DVolpi256 May 26, 2026
7911966
Removed dead references to transformBlockDiagonalInertiaToWorld
DVolpi256 May 26, 2026
0e34277
Fix comment about return dimensions in getSdotqd_q method
DVolpi256 May 26, 2026
86f6b22
Fixed comment about tolerancing
DVolpi256 May 26, 2026
2c36c2d
Reworded comments for clarity in GenericJoint.cpp
DVolpi256 May 26, 2026
af3a93d
Took out outdated debugging references
DVolpi256 May 26, 2026
819f7b6
Reword comments for clarity on complex conjugation
DVolpi256 May 26, 2026
e097d55
Clean up inverse dynamics derivative tests
DVolpi256 May 26, 2026
a2b8bbf
Restructured fucntions that unnecessarily allocate matrices and moved…
DVolpi256 May 27, 2026
d3c489f
Also moved t1-t4 out of the loop
DVolpi256 May 27, 2026
cec6aac
Made alpha, beta, Sdotqd_q, and the t variables into member variables
DVolpi256 May 27, 2026
0622a26
Amended an out of date comment and removed unneeded overrides
DVolpi256 Jun 1, 2026
21044d1
Refactored updateKinematics to no longer have a large conditional
DVolpi256 Jun 1, 2026
5f32d1a
Revert "unhelpful change to storing blocks separately"
DVolpi256 Jun 1, 2026
5c9f4b9
Reapply "unhelpful change to storing blocks separately"
DVolpi256 Jun 1, 2026
ccb7262
Refactored TeleopArm and TwoLinkChain to rely on cloneToComplex
DVolpi256 Jun 1, 2026
70c8e2a
Took out KUKA LWR header in favor of cloning the URDF double model to…
DVolpi256 Jun 2, 2026
cd57a44
Removed unnecessary EIGEN_MAKE_ALIGNED_OPERATOR_NEW, added throw std:…
DVolpi256 Jun 3, 2026
0a3bf6d
Refactored I_ and Ic_ to be a vectors of 6x6 matrices instead of sing…
DVolpi256 Jun 3, 2026
00487c0
Removed dead code and made clarifying rewrites
DVolpi256 Jun 3, 2026
23649df
Rewrote the ComplexFloatDouble and ComplexFloatInverse classes into E…
DVolpi256 Jun 3, 2026
0c6637a
Revisions for clarity
DVolpi256 Jun 3, 2026
d6d3264
Added clarity and removed GenericImplicit use in RevoluePairWithRotor…
DVolpi256 Jun 4, 2026
3cd9938
Refined a comment in Triple and fixed outdated parts and added noalia…
DVolpi256 Jun 4, 2026
c7588ff
Cleaned up noalias() and eval() usage. Also made some variables membe…
DVolpi256 Jun 4, 2026
91ddb26
std::swap now used for F_out
DVolpi256 Jun 4, 2026
3657255
Clean ups
DVolpi256 Jun 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 36 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 3.13)

project(grbda VERSION 2.1.0)

if(CMAKE_BUILD_TYPE MATCHES Debug)
message(STATUS "Debug build")
add_compile_options(-O0 -g3)
# add_compile_definitions(EIGEN_INITIALIZE_MATRICES_BY_NAN)
endif()

message(STATUS "============= !Generalized Rigid-Body Dynamics Algorithms! =============")

################################################################################
Expand All @@ -18,13 +24,20 @@ option(ASAN "set compile options for Address Sanitizer" OFF)
################################################################################
message(STATUS "======> Find Dependencies")

find_package(Eigen3 REQUIRED)
if(Eigen3_FOUND)
message(STATUS "Eigen3 found")
include_directories(${EIGEN3_INCLUDE_DIR})
include_directories(${EIGEN3_INCLUDE_DIR}/..)

set(EIGEN_LOCAL_PATH "${PROJECT_SOURCE_DIR}/grbda-dependencies/eigen-3.4.0")
if(EXISTS "${EIGEN_LOCAL_PATH}/Eigen/StdVector")
message(STATUS "Using local Eigen at ${EIGEN_LOCAL_PATH}")
include_directories(${EIGEN_LOCAL_PATH})
else()
message(FATAL_ERROR "Eigen3 not found. Please install it or specify its location.")
find_package(Eigen3 REQUIRED)
if(Eigen3_FOUND)
message(STATUS "Eigen3 found via find_package")
include_directories(${EIGEN3_INCLUDE_DIR})
include_directories(${EIGEN3_INCLUDE_DIR}/..)
else()
message(FATAL_ERROR "Eigen3 not found. Please install it or specify its location.")
endif()
endif()

find_package(casadi REQUIRED)
Expand Down Expand Up @@ -72,7 +85,11 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${PROJECT_SOURCE_DIR}/cmake")

set(CMAKE_BUILD_TYPE Release)
# Set default build type if not specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DDEBUG_MODE)
endif()
Expand All @@ -87,14 +104,23 @@ elseif(MARCH_NATIVE)
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -ggdb -Wall \

# Base warning flags for all builds
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -Wall \
-Wextra -Wcast-align -Wdisabled-optimization -Wformat=2 \
-Winit-self -Wmissing-include-dirs -Woverloaded-virtual \
-Wshadow -Wsign-promo -Wno-sign-compare -Wno-unused-const-variable \
-Wno-unused-parameter -Wno-unused-variable -Wno-uninitialized")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -ggdb -std=gnu99 -I.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb -std=gnu99 -I.")

# Optimization flags per build type (don't override Debug's -O0!)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
endif()

if(ASAN)
message(WARNING "ASAN option is deprecated. Use -DCMAKE_BUILD_TYPE=Debug instead.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
endif()

Expand Down Expand Up @@ -170,4 +196,4 @@ endif()
if(BUILD_BENCHMARKS)
message(STATUS "======> Setup Benchmarks ")
add_subdirectory(Benchmarking)
endif()
endif()
11 changes: 10 additions & 1 deletion UnitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Create single executable for all tests
file(GLOB_RECURSE test_sources "*.cpp")

# Tests that provide their own main() — link gtest only (no gmock_main)
set(TESTS_WITH_CUSTOM_MAIN
testInverseDynamicsDerivativesComplexStep
)

# Create a test for each test file
foreach(test_source ${test_sources})
# Extract the file name without the extension
Expand All @@ -10,7 +15,11 @@ foreach(test_source ${test_sources})
add_executable(${test_name} ${test_source})

# Link the necessary libraries
target_link_libraries(${test_name} PRIVATE gtest gmock_main ${PROJECT_NAME})
if(${test_name} IN_LIST TESTS_WITH_CUSTOM_MAIN)
target_link_libraries(${test_name} PRIVATE gtest ${PROJECT_NAME})
else()
target_link_libraries(${test_name} PRIVATE gtest gmock_main ${PROJECT_NAME})
endif()

# Add the test to CTest
add_test(NAME ${test_name} COMMAND ${test_name})
Expand Down
4 changes: 4 additions & 0 deletions UnitTests/googletest-src/googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
# ctest. You can select which tests to run using 'ctest -R regex'.
# For more options, run 'ctest --help'.

if(CMAKE_BUILD_TYPE MATCHES Debug)
add_compile_options(-Wno-maybe-uninitialized)
endif()

# When other libraries are using a shared version of runtime libraries,
# Google Test also has to use one.
option(
Expand Down
4 changes: 2 additions & 2 deletions UnitTests/testClusterJoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ createBiasVelocityCasadiFunction(std::shared_ptr<ClusterJoints::Base<casadi::SX>
casadi::copy(cs_qd_sym, qd_sym);

// Set state and update kinematics
JointState<SX> joint_state(JointCoordinate<SX>(q_sym, false),
JointState<SX> joint_state(JointCoordinate<SX>(q_sym, true),
JointCoordinate<SX>(qd_sym, false));
joint_state.position = TestHelpers::plus(joint->type(), q_sym, dq_sym);
joint_state.position = TestHelpers::plus(joint, q_sym, dq_sym);
joint->updateKinematics(joint_state);

// Differentiate the motion subspace matrix with repsect to q, ∂S/∂dq
Expand Down
12 changes: 8 additions & 4 deletions UnitTests/testClusterTreeModel.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#include "gtest/gtest.h"

#include <complex>
#include <cstdlib>
#include "config.h"

namespace {
struct TestSeedInitializer {
TestSeedInitializer() { std::srand(42); }
} g_test_seed_initializer;
}
#include "grbda/Dynamics/ClusterTreeModel.h"
#include "grbda/Robots/RobotTypes.h"

Expand Down Expand Up @@ -106,10 +114,6 @@ std::vector<URDFvsManualTestData> GetTestRobots()
std::make_shared<RevoluteChainWithRotor<3, double>>(false)});
test_data.push_back({urdf_directory + "mini_cheetah.urdf",
std::make_shared<MiniCheetah<double>>()});
test_data.push_back({urdf_directory + "mit_humanoid_leg.urdf",
std::make_shared<MIT_Humanoid_Leg<double>>()});
test_data.push_back({urdf_directory + "mit_humanoid.urdf",
std::make_shared<MIT_Humanoid<double>>()});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why removing these tests for MITHumanoid ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done very early on in the project. It throws an error caused by a mismatch between the urdf and the manually constructed model if included. It appears that the urdf doesn't appropriately capture the belt constraints of the ankle

return test_data;
}

Expand Down
25 changes: 21 additions & 4 deletions UnitTests/testForwardKinematics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,31 @@ GTEST_TEST(ForwardKinematics, HumanoidModelComparison)
for (int i = 0; i < 20; i++)
{
// Initialize Random States
ModelState<> model_state;
ModelState<> rotor_model_state;
ModelState<> no_rotor_model_state;

for (const auto &cluster : rotor_model.clusters())
{
JointState<> joint_state = cluster->joint_->randomJointState();
model_state.push_back(joint_state);
rotor_model_state.push_back(joint_state);
if( joint_state.position.size() == 4 ) // Revolute Pair with Rotor Joint
{
const DMat<double> conv = cluster->joint_->spanningTreeToIndependentCoordsConversion().cast<double>();
const DVec<double> ind_pos = conv * joint_state.position;

// Revolute Pair State
JointState<> rp_state(JointCoordinate<double>(ind_pos, false),
JointCoordinate<double>(joint_state.velocity, false));

no_rotor_model_state.push_back(rp_state);
}
else
{
no_rotor_model_state.push_back(joint_state);
}
}
rotor_model.setState(model_state);
no_rotor_model.setState(model_state);
rotor_model.setState(rotor_model_state);
no_rotor_model.setState(no_rotor_model_state);

// Forward Kinematics
rotor_model.forwardKinematicsIncludingContactPoints();
Expand Down
Loading