Skip to content

Conversation

@Giulero
Copy link
Collaborator

@Giulero Giulero commented Oct 2, 2025

This PR introduces the implementation of the Articulated Body Algorithm.

Copilot summary

Articulated-Body Algorithm (ABA) Implementation

  • Added a complete implementation of the ABA for floating-base forward dynamics in src/adam/core/rbd_algorithms.py, supporting batched inputs, external wrenches, and both velocity representations. This enables efficient computation of joint and base accelerations for robots.
  • Added corresponding ABA wrapper methods to the CasADi (src/adam/casadi/computations.py) and JAX (src/adam/jax/computations.py) computation classes, along with symbolic function support for CasADi. [1] [2]

Matrix Algebra API Extensions

  • Introduced new matrix algebra methods (inv, solve, mtimes, expand_dims) to the spatial math abstract base class (src/adam/core/spatial_math.py) and implemented them for Array API, CasADi, and JAX backends. This provides a uniform interface for matrix inversion, solving linear systems, multiplication, and dimension expansion. [1] [2] [3] [4]

Minor Code and Docstring Cleanups

  • Standardized docstring formatting (e.g., replacing curly apostrophes) and clarified comments in several places for consistency and readability. [1] [2]
  • Minor logic simplification in the Jacobian computation and removal of unnecessary blank lines. [1] [2]

Small API Consistency Fixes

  • Fixed a parameter naming inconsistency in the spatial math vxs method, changing c to s for clarity and consistency across the codebase. [1] [2]

References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]


📚 Documentation preview 📚: https://adam-docs--138.org.readthedocs.build/en/138/

@Giulero Giulero requested a review from Copilot October 2, 2025 13:01
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

This PR implements the Articulated Body Algorithm (ABA) for efficient floating-base forward dynamics computation in the ADAM robotics library, adding complete support across all backends with corresponding test coverage.

  • Added comprehensive ABA implementation in the core RBD algorithms with batched input support and external wrench handling
  • Extended spatial math APIs with new matrix operations (inv, solve, mtimes, expand_dims) required for ABA across all backends
  • Added extensive test coverage for ABA functionality across NumPy, JAX, PyTorch, and CasADi backends

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/adam/core/rbd_algorithms.py Core ABA implementation with floating-base dynamics, external wrenches support, and batch processing
src/adam/core/spatial_math.py Added abstract methods for inv, solve, mtimes operations and fixed parameter naming in vxs method
src/adam/core/array_api_math.py Implemented new matrix operations for Array API backend
src/adam/casadi/casadi_like.py Added CasADi-specific implementations of new matrix operations
src/adam/casadi/computations.py Added ABA wrapper method and symbolic function support for CasADi
src/adam/jax/jax_like.py JAX-specific solve implementation handling batched operations correctly
src/adam/jax/computations.py Added JAX ABA wrapper method
src/adam/pytorch/torch_like.py PyTorch-specific solve override to avoid array_api_compat issues
src/adam/pytorch/computations.py Added PyTorch ABA wrapper method
src/adam/pytorch/computation_batch.py Added batched PyTorch ABA wrapper method
src/adam/numpy/computations.py Added NumPy ABA wrapper method
tests/*.py Comprehensive test coverage for ABA across all backends with validation against equations of motion

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Giulero Giulero requested review from Copilot and xela-95 October 2, 2025 14:02
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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Giulero Giulero requested a review from Copilot October 2, 2025 14:11
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

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Giulero Giulero requested a review from traversaro October 3, 2025 06:56
Copy link
Contributor

@xela-95 xela-95 left a comment

Choose a reason for hiding this comment

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

Thanks @Giulero ! It looks good to me :)

@Giulero
Copy link
Collaborator Author

Giulero commented Oct 7, 2025

Tests are passing! Merging!
Thanks :)

@Giulero Giulero merged commit 1cc4f75 into main Oct 7, 2025
13 checks passed
@Giulero Giulero deleted the aba branch October 7, 2025 10:20
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.

3 participants