Skip to content

Include user sensor dimensions in model signature#3308

Open
rajatmohan22 wants to merge 1 commit into
google-deepmind:mainfrom
rajatmohan22:main
Open

Include user sensor dimensions in model signature#3308
rajatmohan22 wants to merge 1 commit into
google-deepmind:mainfrom
rajatmohan22:main

Conversation

@rajatmohan22
Copy link
Copy Markdown

Summary

Fixes #3307.

mjCModel::Signature() currently includes each sensor's type, but not its dimension. For mjSENS_USER, the sensor dim directly affects nsensordata and therefore the compiled model memory layout. This meant two models with different user sensor dimensions could incorrectly share the same model signature.

This PR includes sensor dim in the model signature and adds a regression test for user sensors with different dimensions.

Changes

  • Include sensor.spec.dim when hashing sensors in mjCModel::Signature().
  • Add a regression test verifying that two mjSENS_USER sensors with different dimensions produce different model signatures.

Test

./build-appleld/bin/user_objects_test --gtest_filter=SensorTest.UserSensorDimAffectsModelSignature

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Jun 2, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

User sensor's dim does not change model's signature

1 participant