Conversation
…eleration Signed-off-by: camopel <duanyun@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #825
Description
Adds the centre-of-mass to sensor-mount lever arm to
IMUSensorlinear acceleration.Fixes the remaining half of #735. 6.1.0 correctly moved the differentiation into the world frame, but the velocity being differenced is still the parent body's centre-of-mass velocity rather than the velocity of the sensor mount, so a sensor mounted away from the centre of mass loses the centripetal and tangential acceleration of its own mount point.
Details, verification against
v6.1.0, and a reproduction are in the issue.Change
For a rigid body, the mount velocity is
v_com + omega x rwhereris the world-frame vector from the centre of mass to the sensor. The patch adds that term tovWbefore it is buffered, so the existing world-frame differentiation and the existing rotate-after step both stay exactly as 6.1.0 left them:SensorData::centerOfMassBodycachesphysics:centerOfMassfor the parent body, read inrefreshConfigvia the newrefreshCenterOfMass. Unauthored leaves the origin, which is what USD Physics specifies.sensorPos— already fetched at L785 and previously unused — gives the mount. Their difference is the lever arm, andomega x ris added tovW.The cross product is written out componentwise rather than through a helper:
omni::math::linalghas no cross-product free function used anywhere else in the repository, and I did not want to introduce a dependency on an API I could not find a precedent for.getPrimWorldTransformfailing is treated as "no correction available" rather than as a fatal error, so the reading degrades to current behaviour instead of dropping the sample.Test
test_offset_sensor_measures_its_own_lever_arm, alongside the existingtest_centripetal_acceleration_in_circular_motionand sharing its carousel rig.Two IMUs ride one arm at different radii: one on the body origin, one mounted 0.5 further out. Each must read
omega^2 * ron its own radius, so the outer one reads strictly more.The discriminating assertion is the difference between them:
Both sensors share one centre of mass, so without the correction this difference is exactly
0.0however far apart they are mounted — the test cannot pass on the unpatched code by coincidence. Expected values: hub 8.0, rim 10.0, difference 2.0.The test also pins one physics step per app update and guards the commanded body rate before asserting anything, for the reasons the sibling carousel test documents: under substepping the sensor world transform is refreshed once per update, and with no rotation there is no lever-arm term to measure and every assertion would pass for the wrong reason.
physics:centerOfMassis authored explicitly at the body origin. It would land there unauthored anyway, but the lever arm is measured from that point, so the test states it rather than inheriting a default.Restricted to PhysX with
is_physx_engine(), matching the sibling test: Newton does not carry the body around a world-anchored revolute joint.I have not run the Kit test suite
I do not have a Kit build of this branch, so
test_offset_sensor_measures_its_own_lever_armhas not been executed. The C++ has not been compiled either. The expected magnitudes above are analytic (omega^2 r), and the test is written against the sibling test's established rig and tolerances, but both need a maintainer run before this is trustworthy. Please treat the numbers as predictions rather than measurements.Two things worth a maintainer's eye:
physics:centerOfMassunder a scaled parent. I rotate the centre-of-mass offset by the parent orientation but do not scale it. That matches how the attribute is specified, but a scaled rigid body is worth a second opinion.IRigidBodyDataViewhas no centre-of-mass accessor, so the value comes from USD rather than from the physics view. If PhysX shifts the centre of mass at runtime — an authored change afterrefreshConfig, for instance — the cached value goes stale. AddinggetCenterOfMassHostto the view would be the cleaner fix, but that touchesisaacsim.core.experimental.primsheaders and felt like a larger scope decision than this bug warrants. Happy to follow that route if you prefer it.Scope
Three files, all inside
source/extensions/isaacsim.sensors.experimental.physics/with allowlisted suffixes:plugins/.../ImuSensorImpl.cpppython/tests/test_imu_sensor.pydocs/CHANGELOG.mdNo new dependencies, no vendored code, no third-party material. DCO signed off.