Skip to content

fix: populate mstraj velocity and acceleration - #706

Open
Doribelove wants to merge 1 commit into
petercorke:mainfrom
Doribelove:codex/mstraj-derivatives
Open

Doribelove wants to merge 1 commit into
petercorke:mainfrom
Doribelove:codex/mstraj-derivatives

Conversation

@Doribelove

Copy link
Copy Markdown
Contributor

Summary

mstraj() returned a Trajectory with positions only, leaving its public qd and qdd properties as None. This change carries the analytic velocity and acceleration from each jtraj polynomial blend into the output, and assigns constant velocity and zero sampled acceleration to each linear segment. It also marks the time-based trajectory as istime=True and documents the returned fields and the instantaneous velocity changes when tacc=0.

The original position, time, arrival and segment metadata remain unchanged. In 50 generated cases, these fields matched upstream main exactly.

Related issue

Fixes #497.

Validation

  • New tests reproduced the None result on upstream main; with the fix, tests/test_trajectory.py and tests/test_tools.py pass: 23 passed, 18 subtests passed on Python 3.12.
  • The six-axis example in None value with variable "qd" and "qdd" in function "mstraj" return #497 now returns finite qd and qdd arrays with the same shape as q.
  • ruff format --check and git diff --check pass. ruff check reports the same 15 pre-existing findings on both upstream main and this branch; this PR adds none.
  • The full repository test command was attempted, but test_BaseRobot.py::test_ets_gripper2 timed out while robot_descriptions fetched the external YuMi model assets. No failure was observed in the trajectory tests.

Checklist

  • PR title follows Conventional Commits.
  • Added tests for blended and unblended multi-axis trajectories.
  • New and changed code uses modern type hints.
  • Updated the function docstring.
  • Limited the change to mstraj and its trajectory tests.

The patch was developed with assistance from OpenAI Codex. The commit is signed off by 李永祺 doribelove@gmail.com.

Collect the analytic derivatives of polynomial blends and the constant
velocity and zero acceleration of linear segments alongside the existing
position samples. Document the returned trajectory fields and cover blended
and unblended paths.

Assisted-by: OpenAI Codex
Signed-off-by: 李永祺 <doribelove@gmail.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (848114b) to head (8c47528).

Files with missing lines Patch % Lines
src/roboticstoolbox/tools/trajectory.py 0.00% 18 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #706   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        143     143           
  Lines      14269   14280   +11     
=====================================
- Misses     14269   14280   +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

None value with variable "qd" and "qdd" in function "mstraj" return

1 participant