Add optional acausal low-pass filtering for joint velocities in AMPLoader and angle wrapping in velocity calculation#29
Draft
GiulioRomualdi wants to merge 2 commits into
Draft
Add optional acausal low-pass filtering for joint velocities in AMPLoader and angle wrapping in velocity calculation#29GiulioRomualdi wants to merge 2 commits into
GiulioRomualdi wants to merge 2 commits into
Conversation
…ader and angle wrapping in velocity calculation
…or improved performance and memory efficiency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the
AMPLoaderclass inamp_rsl_rl/utils/motion_loader.pyto 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
_compute_raw_derivativemethod 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]load_datais updated to use angular difference handling, and base velocities explicitly specify whether angular handling is needed. [1] [2]Optional acausal low-pass filtering
vel_filter_cutoff_hzparameter to theAMPLoaderconstructor, allowing users to specify a cutoff frequency for filtering velocities. [1] [2]_lowpass_acausalmethod using a 2nd-order Butterworth filter and zero-phase filtering (filtfilt), and applied it to all velocity signals inload_dataif the cutoff is set. This helps suppress high-frequency noise in both joint and base velocities. [1] [2]Dependency update
butterandfiltfiltfromscipy.signalto support the new filtering functionality.