Skip to content

Comments

Move the factors!#419

Merged
dellaert merged 8 commits intomasterfrom
feature/move_factors
Feb 16, 2026
Merged

Move the factors!#419
dellaert merged 8 commits intomasterfrom
feature/move_factors

Conversation

@dellaert
Copy link
Member

@dellaert dellaert commented Feb 14, 2026

Reorganizes GTDynamics factor headers into subsystem-specific directories (kinematics/dynamics/mechanics/statics), updates call sites to the new include paths, and adds new grouped test suites/targets for those subsystems.

See copilot review for detailed changes.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Reorganizes GTDynamics factor headers into subsystem-specific directories (kinematics/dynamics/mechanics/statics), updates call sites to the new include paths, and adds new grouped test suites/targets for those subsystems.

Changes:

  • Moved/introduced factor headers under gtdynamics/{kinematics,dynamics,mechanics}/ and updated includes across tests and core code.
  • Added CMake plumbing for subsystem-scoped test groups (check.kinematics, check.dynamics, etc.) plus new tests under those groups.
  • Refactored some scenario cost construction to use the new Mechanics helper for adding wrench/torque-related factors.

Reviewed changes

Copilot reviewed 39 out of 54 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/testInequalityConstraint.cpp Update PoseFactor include to new kinematics location.
tests/testIERetractor.cpp Update PoseFactor include to new kinematics location.
tests/testIECartPoleWithFriction.cpp Update PoseFactor include to new kinematics location.
tests/testChain.cpp Update ContactDynamicsMomentFactor include to new dynamics location.
tests/testCartPoleWithFriction.cpp Update PoseFactor include to new kinematics location.
tests/CMakeLists.txt Refactor excludes and add test include directory for root tests.
gtdynamics/utils/Trajectory.h Update PointGoalFactor include to new kinematics location.
gtdynamics/utils/JsonSaver.h Update multiple factor includes to new subsystem locations.
gtdynamics/universal_robot/Joint.cpp Update JointLimitFactor include to new kinematics location.
gtdynamics/statics/tests/testStaticWrenchFactor.cpp Add new unit test for StaticWrenchFactor.
gtdynamics/statics/tests/CMakeLists.txt Add statics test group via gtsamAddTestsGlob.
gtdynamics/statics/CMakeLists.txt Add conditional inclusion of statics tests subdir.
gtdynamics/scenarios/IEQuadrupedUtilsCosts.cpp Switch torque/wrench equivalence factor creation to Mechanics.
gtdynamics/mechanics/tests/testWrenchPlanarFactor.cpp Update include to new mechanics location.
gtdynamics/mechanics/tests/testWrenchEquivalenceFactor.cpp Update include to new mechanics location.
gtdynamics/mechanics/tests/testTorqueFactor.cpp Update include to new mechanics location.
gtdynamics/mechanics/tests/CMakeLists.txt Add mechanics test group via gtsamAddTestsGlob.
gtdynamics/mechanics/WrenchPlanarFactor.h Add/move wrench planar constraint/factor into mechanics module.
gtdynamics/mechanics/WrenchEquivalenceFactor.h Add/move wrench equivalence factor into mechanics module.
gtdynamics/mechanics/TorqueFactor.h Add/move torque factor into mechanics module.
gtdynamics/mechanics/MechanicsSlice.cpp Update includes to new mechanics factor headers.
gtdynamics/mechanics/CMakeLists.txt Add conditional inclusion of mechanics tests subdir.
gtdynamics/kinematics/tests/testTwistFactor.cpp Update include to new kinematics location.
gtdynamics/kinematics/tests/testPoseFactor.cpp Update include to new kinematics location.
gtdynamics/kinematics/tests/testPointGoalFactor.cpp Update include to new kinematics location.
gtdynamics/kinematics/tests/testContactKinematicsTwistFactor.cpp Update include to new kinematics location.
gtdynamics/kinematics/tests/testContactHeightFactor.cpp Update include to new kinematics location.
gtdynamics/kinematics/tests/CMakeLists.txt Add kinematics test group via gtsamAddTestsGlob.
gtdynamics/kinematics/TwistFactor.h Add/move twist factor into kinematics module.
gtdynamics/kinematics/PoseFactor.h Add/move pose factor into kinematics module.
gtdynamics/kinematics/PointGoalFactor.h Add/move point goal factor into kinematics module.
gtdynamics/kinematics/KinematicsSlice.cpp Update includes to new kinematics factor headers.
gtdynamics/kinematics/JointLimitFactor.h Add/move joint limit factor into kinematics module.
gtdynamics/kinematics/ContactKinematicsTwistFactor.h Add/move contact twist constraint/factor into kinematics module.
gtdynamics/kinematics/ContactHeightFactor.h Add/move contact height constraint/factor into kinematics module.
gtdynamics/kinematics/CMakeLists.txt Add conditional inclusion of kinematics tests subdir.
gtdynamics/factors/ObjectiveFactors.h Update PointGoalFactor include to new kinematics location.
gtdynamics/factors/ObjectiveFactors.cpp Update PointGoalFactor include to new kinematics location.
gtdynamics/dynamics/tests/testWrenchFactor.cpp Update include to new dynamics location.
gtdynamics/dynamics/tests/testTwistAccelFactor.cpp Update include to new dynamics location.
gtdynamics/dynamics/tests/testContactKinematicsAccelFactor.cpp Update include to new dynamics location.
gtdynamics/dynamics/tests/testContactDynamicsMomentFactor.cpp Update include to new dynamics location.
gtdynamics/dynamics/tests/testContactDynamicsFrictionConeFactor.cpp Update include to new dynamics location.
gtdynamics/dynamics/tests/CMakeLists.txt Add dynamics test group via gtsamAddTestsGlob.
gtdynamics/dynamics/WrenchFactor.h Add/move wrench balance factor into dynamics module.
gtdynamics/dynamics/TwistAccelFactor.h Add/move twist acceleration factor into dynamics module.
gtdynamics/dynamics/DynamicsSlice.cpp Update includes to new dynamics factor headers.
gtdynamics/dynamics/ContactKinematicsAccelFactor.h Add/move contact acceleration constraint/factor into dynamics module.
gtdynamics/dynamics/ContactDynamicsMomentFactor.h Add/move contact moment constraint/factor into dynamics module.
gtdynamics/dynamics/ContactDynamicsFrictionConeFactor.h Add/move friction cone inequality factor into dynamics module.
gtdynamics/dynamics/ChainDynamicsGraph.h Update includes to new dynamics factor headers.
gtdynamics/dynamics/CMakeLists.txt Add conditional inclusion of dynamics tests subdir.
gtdynamics.i Update wrapped header includes (PoseFactor/WrenchFactor/ContactHeightFactor).
README.md Document grouped test targets and common build/run target patterns.
Comments suppressed due to low confidence (1)

gtdynamics.i:95

  • gtdynamics.i declares a free function gtsam::NoiseModelFactor* WrenchFactor(...), but there is no corresponding C++ definition in the repo (the only WrenchFactor found returns NoiseModelFactor::shared_ptr in gtdynamics/dynamics/WrenchFactor.h). This will break wrapper generation/linking. Either (1) add/restore a C++ overload with this exact signature, or (2) update the interface to wrap the existing shared_ptr-returning function with matching parameter types.
#include <gtdynamics/dynamics/WrenchFactor.h>
gtsam::NoiseModelFactor* WrenchFactor(
    const gtsam::noiseModel::Base *cost_model, const gtdynamics::Link *link,
    const std::vector<gtsam::Key> wrench_keys, int t = 0,
    const std::optional<gtsam::Vector3> &gravity);

@dellaert dellaert marked this pull request as ready for review February 14, 2026 18:51
Copy link
Contributor

@varunagrawal varunagrawal left a comment

Choose a reason for hiding this comment

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

Thank you. Been wanting to do this restructure for a while but it was too much of a breaking change.

@dellaert
Copy link
Member Author

Will merge - will add xmake fix in next PR

@dellaert dellaert merged commit d2303be into master Feb 16, 2026
6 checks passed
@dellaert dellaert deleted the feature/move_factors branch February 16, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants