Skip to content

Format prismatic joint limits in DHRobot string output - #718

Open
RoboX2020 wants to merge 2 commits into
petercorke:mainfrom
RoboX2020:prajval/fix/prismatic-display-precision
Open

RoboX2020 wants to merge 2 commits into
petercorke:mainfrom
RoboX2020:prajval/fix/prismatic-display-precision

Conversation

@RoboX2020

Copy link
Copy Markdown

Fixes #711 (the display precision part).

str(robot) printed prismatic joint limits as raw floats, so a limit of 0.30479999999999996 (for example 12 inches converted to metres) showed up with all the float noise in both the standard and modified DH tables. Every other column already goes through format_attr.

This runs the prismatic limits through format_attr as well, so that limit now displays as 0.3048. Only the display changes. Stored limits and dynamics are untouched.

Tests: added tests/test_DHRobot_display.py, which builds a prismatic link with that limit for both PrismaticDH and PrismaticMDH and checks the output. It fails on main and passes with this change. The full test suite (excluding test_blocks.py) passes: 778 passed, 70 skipped.

This does not add the separate .table() API suggested in the issue; that would need some design discussion first.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
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.

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.

Robot repr

1 participant