Skip to content

[Proposal] Interpolate segment-by-segment while preserving each keyframe boundary #343

Description

@matafela

Proposal

Interpolate segment-by-segment while preserving each keyframe boundary, or explicitly insert exact keyframes into the sampled output. Also validate that sample_interval can accommodate all required keyframes.

Better implement a new interpolate_with_distance (embodichain/lab/sim/utility/action_utils.py) that interpolate segment-by-segment.

Motivation

Multi-waypoint trajectories do not guarantee exact visits to intermediate waypoints

  • embodichain/lab/sim/atomic_actions/trajectory.py:336
  • embodichain/lab/sim/atomic_actions/trajectory.py:360

The implementation passes all keyframes to interpolate_with_distance() and resamples the entire path to a fixed count. That preserves path order, but it does not guarantee intermediate waypoints appear as emitted trajectory samples. For example, keyframes [0, 1, 3] with 5 samples become [0, 0.75, 1.5, 2.25, 3], so waypoint 1 is skipped. This conflicts with the new “visits every waypoint” API contract and can miss clearance/safety waypoints.

Additional context

Checklist

  • I have checked that there is no similar issue in the repo (required)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions