Skip to content

Conversation

@GiulioRomualdi
Copy link
Collaborator

This pull request enhances the AMPLoader class in amp_rsl_rl/utils/motion_loader.py to support improved velocity computation and optional acausal low-pass filtering. The most significant changes introduce robust handling of angular velocities and an option to filter velocities to reduce noise, which benefits downstream motion modeling and simulation stability.

Velocity computation improvements

  • The _compute_raw_derivative method now correctly handles wrapped angles for angular data, preventing artifacts from jumps across ±π. This is used for joint velocity calculation, ensuring accurate representation of rotational velocities. [1] [2]
  • The joint velocity calculation in load_data is updated to use angular difference handling, and base velocities explicitly specify whether angular handling is needed. [1] [2]

Optional acausal low-pass filtering

  • Added a new vel_filter_cutoff_hz parameter to the AMPLoader constructor, allowing users to specify a cutoff frequency for filtering velocities. [1] [2]
  • Implemented the _lowpass_acausal method using a 2nd-order Butterworth filter and zero-phase filtering (filtfilt), and applied it to all velocity signals in load_data if the cutoff is set. This helps suppress high-frequency noise in both joint and base velocities. [1] [2]

Dependency update

  • Added imports for butter and filtfilt from scipy.signal to support the new filtering functionality.

@GiulioRomualdi GiulioRomualdi marked this pull request as draft September 4, 2025 14:03
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