Skip to content

Fix joint_limits.yaml generating integer values for double parameters#3716

Open
Med0kin wants to merge 1 commit intomoveit:mainfrom
Med0kin:fix/joint-limits-yaml-double-serialization
Open

Fix joint_limits.yaml generating integer values for double parameters#3716
Med0kin wants to merge 1 commit intomoveit:mainfrom
Med0kin:fix/joint-limits-yaml-double-serialization

Conversation

@Med0kin
Copy link
Copy Markdown

@Med0kin Med0kin commented Mar 30, 2026

Description

When moveit_setup_assistant generates joint_limits.yaml, whole-number limits like 1.0 are written as 1. This causes move_group to crash on startup with:

parameter 'robot_description_planning.joint_limits.joint1.max_velocity' has invalid type: expected [double] got [integer]

This was previously reported in #2776 and previous #2803 attempted to fix this with static_cast<double>, which doesn't affect yaml-cpp's output.

The underlying issue is that yaml-cpp saves C++'s double value like 1.0 as 1, which is valid per YAML spec. It is then read as integer by launch_param_builder. So 1 would be both a int and float, it is just that it's matched as int first.

This fix is clearly a workaround and yaml-cpp already has a feature to enforce adding trailing zeros (jbeder/yaml-cpp#1407), but yet not available in recently released version.

An alternative solution would be to enfore the type in joint_limits.yaml with !!float tags, where !!float 1 would be matched as float.

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.32%. Comparing base (c154f94) to head (99edc87).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3716      +/-   ##
==========================================
+ Coverage   46.22%   46.32%   +0.11%     
==========================================
  Files         726      726              
  Lines       59503    59504       +1     
  Branches     7623     7626       +3     
==========================================
+ Hits        27499    27559      +60     
+ Misses      31836    31779      -57     
+ Partials      168      166       -2     

☔ View full report in Codecov by Sentry.
📢 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.

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.

1 participant