@@ -1760,11 +1760,28 @@ class MultibodyPlant final : public internal::MultibodyTreeSystem<T> {
17601760 // / @param[in] model_instance (optional) the index of the model instance to
17611761 // / which `joint_type` is to be applied.
17621762 // / @throws std::exception if called after Finalize().
1763- // / @see GetBaseBodyJointType(), Finalize()
1763+ // / @see GetBaseBodyJointType(), SetCombineWeldedBodies(), Finalize()
17641764 void SetBaseBodyJointType (
17651765 BaseBodyJointType joint_type,
17661766 std::optional<ModelInstanceIndex> model_instance = {});
17671767
1768+ // / Controls whether welded-together RigidBody elements are to be combined
1769+ // / into a single composite mobilized body in the generated model. If so,
1770+ // / the Weld joints will not appear in the post-Finalize() model and there
1771+ // / will be fewer bodies and joints in the generated model than in the user's
1772+ // / specification. Results for the original RigidBody elements can still be
1773+ // / obtained by name or BodyIndex, but no results (in particular, no reaction
1774+ // / forces) are available for the unmodeled Weld joints.
1775+ // /
1776+ // / You can set this globally or on a per-model instance basis.
1777+ // /
1778+ // / The default for Drake is _not_ to combine welded RigidBody elements.
1779+ // /
1780+ // / @throws std::exception if called after Finalize().
1781+ // / @see GetCombineWeldedBodies(), SetBaseBodyJointType(), Finalize()
1782+ void SetCombineWeldedBodies (
1783+ bool combine, std::optional<ModelInstanceIndex> model_instance = {});
1784+
17681785 // / Returns the currently-set choice for base body joint type, either for
17691786 // / the global setting or for a specific model instance if provided.
17701787 // / If a model instance is provided for which no explicit choice has been
@@ -1773,10 +1790,23 @@ class MultibodyPlant final : public internal::MultibodyTreeSystem<T> {
17731790 // / This can be called any time -- pre-finalize it returns the joint type
17741791 // / that will be used by Finalize(); post-finalize it returns the joint type
17751792 // / that _was_ used if there were any base bodies in need of a joint.
1776- // / @see SetBaseBodyJointType(), Finalize()
1793+ // / @see SetBaseBodyJointType(), GetCombineWeldedBodies(), Finalize()
17771794 BaseBodyJointType GetBaseBodyJointType (
17781795 std::optional<ModelInstanceIndex> model_instance = {}) const ;
17791796
1797+ // / Returns the currently-set choice for whether welded-together bodies
1798+ // / should be combined or modeled separately, either for the global setting
1799+ // / or for a specific model instance. If a model instance is provided for
1800+ // / which no explicit choice was made, the global setting is returned. Any
1801+ // / model instance index is acceptable here; if not recognized then the global
1802+ // / setting is returned. This can be called any time -- pre-finalize it
1803+ // / returns the setting that will be used by Finalize(); post-finalize it
1804+ // / returns the setting that _was_ used if there were any welded-together
1805+ // / bodies.
1806+ // / @see SetCombineWeldedBodies(), GetBaseBodyJointType(), Finalize()
1807+ bool GetCombineWeldedBodies (
1808+ std::optional<ModelInstanceIndex> model_instance = {}) const ;
1809+
17801810 // / This method must be called after all elements in the model (joints,
17811811 // / bodies, force elements, constraints, etc.) are added and before any
17821812 // / computations are performed.
0 commit comments