Skip to content

Template SDFCollisionErrorFunction on SDF collider type (#1400)#1400

Closed
cdtwigg wants to merge 1 commit into
mainfrom
export-D105199128
Closed

Template SDFCollisionErrorFunction on SDF collider type (#1400)#1400
cdtwigg wants to merge 1 commit into
mainfrom
export-D105199128

Conversation

@cdtwigg
Copy link
Copy Markdown
Contributor

@cdtwigg cdtwigg commented May 15, 2026

Summary:

Add a second template parameter SdfColliderType to SDFCollisionErrorFunctionT, defaulting to SDFColliderT for backward compatibility. This enables the collision error function to work with any collider type that provides the duck-typed interface (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update, isValid).

Changes:

  • sdf_collision_geometry.h: Add wrapper methods to SDFColliderT (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update) that adapt it to the duck-typed interface
  • sdf_collision_error_function.h: Move template method definitions from .cpp to header (required for multi-parameter template instantiation). Replace all direct SDFColliderT member access with duck-typed interface calls
  • sdf_collision_error_function.cpp: Reduced to explicit instantiations only
  • gen_fwd_input.toml: Remove SDFCollisionErrorFunction (multi-param template cannot use gen_fwd; aliases are in the header)

Backward compatibility is preserved: using SDFCollisionErrorFunction = SDFCollisionErrorFunctionT<float> uses the default SDFColliderT.

Reviewed By: cstollmeta

Differential Revision: D105199128

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 15, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 15, 2026

@cdtwigg has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105199128.

@meta-codesync meta-codesync Bot changed the title Template SDFCollisionErrorFunction on SDF collider type Template SDFCollisionErrorFunction on SDF collider type (#1400) May 15, 2026
meta-codesync Bot pushed a commit that referenced this pull request May 15, 2026
Summary:

Add a second template parameter SdfColliderType to SDFCollisionErrorFunctionT, defaulting to SDFColliderT<float> for backward compatibility. This enables the collision error function to work with any collider type that provides the duck-typed interface (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update, isValid).

Changes:
- sdf_collision_geometry.h: Add wrapper methods to SDFColliderT (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update) that adapt it to the duck-typed interface
- sdf_collision_error_function.h: Move template method definitions from .cpp to header (required for multi-parameter template instantiation). Replace all direct SDFColliderT member access with duck-typed interface calls
- sdf_collision_error_function.cpp: Reduced to explicit instantiations only
- gen_fwd_input.toml: Remove SDFCollisionErrorFunction (multi-param template cannot use gen_fwd; aliases are in the header)

Backward compatibility is preserved: `using SDFCollisionErrorFunction = SDFCollisionErrorFunctionT<float>` uses the default SDFColliderT<float>.

Reviewed By: cstollmeta

Differential Revision: D105199128
@meta-codesync meta-codesync Bot force-pushed the export-D105199128 branch from 940a26e to dc3361d Compare May 15, 2026 23:19
meta-codesync Bot pushed a commit that referenced this pull request May 16, 2026
Summary:

Add a second template parameter SdfColliderType to SDFCollisionErrorFunctionT, defaulting to SDFColliderT<float> for backward compatibility. This enables the collision error function to work with any collider type that provides the duck-typed interface (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update, isValid).

Changes:
- sdf_collision_geometry.h: Add wrapper methods to SDFColliderT (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update) that adapt it to the duck-typed interface
- sdf_collision_error_function.h: Move template method definitions from .cpp to header (required for multi-parameter template instantiation). Replace all direct SDFColliderT member access with duck-typed interface calls
- sdf_collision_error_function.cpp: Reduced to explicit instantiations only
- gen_fwd_input.toml: Remove SDFCollisionErrorFunction (multi-param template cannot use gen_fwd; aliases are in the header)

Backward compatibility is preserved: `using SDFCollisionErrorFunction = SDFCollisionErrorFunctionT<float>` uses the default SDFColliderT<float>.

Reviewed By: cstollmeta

Differential Revision: D105199128
@meta-codesync meta-codesync Bot force-pushed the export-D105199128 branch from dc3361d to 2148089 Compare May 16, 2026 05:09
Summary:

Add a second template parameter SdfColliderType to SDFCollisionErrorFunctionT, defaulting to SDFColliderT<float> for backward compatibility. This enables the collision error function to work with any collider type that provides the duck-typed interface (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update, isValid).

Changes:
- sdf_collision_geometry.h: Add wrapper methods to SDFColliderT (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update) that adapt it to the duck-typed interface
- sdf_collision_error_function.h: Move template method definitions from .cpp to header (required for multi-parameter template instantiation). Replace all direct SDFColliderT member access with duck-typed interface calls
- sdf_collision_error_function.cpp: Reduced to explicit instantiations only
- gen_fwd_input.toml: Remove SDFCollisionErrorFunction (multi-param template cannot use gen_fwd; aliases are in the header)

Backward compatibility is preserved: `using SDFCollisionErrorFunction = SDFCollisionErrorFunctionT<float>` uses the default SDFColliderT<float>.

Reviewed By: cstollmeta

Differential Revision: D105199128
@meta-codesync meta-codesync Bot force-pushed the export-D105199128 branch from 2148089 to 99cf4f8 Compare May 16, 2026 05:09
@meta-codesync meta-codesync Bot closed this in c45af0b May 16, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 16, 2026

This pull request has been merged in c45af0b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant