@@ -10983,12 +10983,20 @@ Parameter ``M_BP_E``:
1098310983 // Source: drake/multibody/tree/uniform_gravity_field_element.h
1098410984 const char * doc =
1098510985R"""( This ForceElement allows modeling the effect of a uniform gravity
10986- field as felt by bodies on the surface of the Earth. This gravity
10987- field acts on all bodies in the MultibodyTree model.)""" ;
10986+ field as felt by bodies on the surface of the Earth or elsewhere. This
10987+ gravity field acts on all bodies in the MultibodyPlant except those
10988+ whose ModelInstance has been explicitly excluded.)""" ;
1098810989 // Symbol: drake::multibody::UniformGravityFieldElement::CalcConservativePower
1098910990 struct /* CalcConservativePower */ {
1099010991 // Source: drake/multibody/tree/uniform_gravity_field_element.h
10991- const char * doc = R"""( )""" ;
10992+ const char * doc =
10993+ R"""( Returns gravitational power acting on the system. This is positive
10994+ when gravitational potential energy is decreasing. In terms of the
10995+ generalized gravity forces ``tau_g`` and the generalized velocities
10996+ ``v``, the gravitational power is ``v ⋅ tau_g``.
10997+
10998+ See also:
10999+ CalcGravityGeneralizedForces())""" ;
1099211000 } CalcConservativePower;
1099311001 // Symbol: drake::multibody::UniformGravityFieldElement::CalcGravityGeneralizedForces
1099411002 struct /* CalcGravityGeneralizedForces */ {
@@ -11008,45 +11016,50 @@ generalized forces, like so:
1100811016
1100911017.. code-block:: c++
1101011018
11011- Mv̇ + C(q, v)v = tau_g(q) + tau_app
11019+ M(q)v̇ + C(q, v)v = tau_g(q) + tau_app
1101211020
1101311021.. raw:: html
1101411022
1101511023 </details>
1101611024
11017- where ``tau_app`` includes any other generalized forces applied on the
11018- system.
11025+ where ``tau_app`` are generalized forces generated by any other
11026+ applied spatial forces (i.e., other than gravity forces).
11027+
11028+ Note:
11029+ Given the gravitational potential energy PE(q), the generalized
11030+ force at the iᵗʰ joint degree of freedom is tau_gᵢ = −∂(PE)/∂qᵢ.
1101911031
1102011032Parameter ``context``:
1102111033 The context storing the state of the multibody model to which this
1102211034 element belongs.
1102311035
1102411036Returns:
1102511037 tau_g A vector containing the generalized forces due to this
11026- gravity field force element. The generalized forces are consistent
11027- with the vector of generalized velocities ``v`` for the parent
11028- MultibodyTree model so that the inner product ``v⋅tau_g``
11029- corresponds to the power applied by the gravity forces on the
11030- mechanical system. That is, ``v⋅tau_g > 0`` corresponds to
11031- potential energy going into the system, as either mechanical
11032- kinetic energy, some other potential energy, or heat, and
11033- therefore to a decrease of potential energy.)""" ;
11038+ gravity field force element. The ordering of the generalized
11039+ forces is consistent with the vector of generalized velocities
11040+ ``v`` for the parent MultibodyPlant so that the inner product ``v
11041+ ⋅ tau_g`` is the gravitational power acting on the mechanical
11042+ system. That is, ``v ⋅ tau_g > 0`` corresponds to a decreasing
11043+ gravitational potential energy and hence an increasing kinetic or
11044+ potential energy, work done, or heat.)""" ;
1103411045 } CalcGravityGeneralizedForces;
1103511046 // Symbol: drake::multibody::UniformGravityFieldElement::CalcNonConservativePower
1103611047 struct /* CalcNonConservativePower */ {
1103711048 // Source: drake/multibody/tree/uniform_gravity_field_element.h
11038- const char * doc = R"""( )""" ;
11049+ const char * doc =
11050+ R"""( Returns zero always since gravity is conservative.)""" ;
1103911051 } CalcNonConservativePower;
1104011052 // Symbol: drake::multibody::UniformGravityFieldElement::CalcPotentialEnergy
1104111053 struct /* CalcPotentialEnergy */ {
1104211054 // Source: drake/multibody/tree/uniform_gravity_field_element.h
1104311055 const char * doc =
11044- R"""( Computes the total potential energy of all bodies in the model in this
11045- uniform gravity field. The definition of potential energy allows to
11046- arbitrarily choose the zero energy height. This element takes the zero
11047- energy height to be the same as the world's height. That is, a body
11048- will have zero potential energy when its the height of its center of
11049- mass is at the world's origin.)""" ;
11056+ R"""( Computes the total gravitational potential energy of all bodies in
11057+ this MultibodyPlant except those whose model instance has been
11058+ explicitly excluded from gravity. The definition of potential energy
11059+ allows for an arbitrary choice of zero energy height. This element
11060+ takes the zero energy height to be the same as the World origin
11061+ height. That is, a body will have zero gravitational potential energy
11062+ when the height of the body's center of mass in the World is zero.)""" ;
1105011063 } CalcPotentialEnergy;
1105111064 // Symbol: drake::multibody::UniformGravityFieldElement::DoCalcAndAddForceContribution
1105211065 struct /* DoCalcAndAddForceContribution */ {
@@ -11068,35 +11081,37 @@ mass is at the world's origin.)""";
1106811081 // Source: drake/multibody/tree/uniform_gravity_field_element.h
1106911082 const char * doc_0args =
1107011083R"""( Constructs a uniform gravity field element with a default strength (on
11071- the earth 's surface) and direction (-z).)""" ;
11084+ the Earth 's surface) and direction (-z).)""" ;
1107211085 // Source: drake/multibody/tree/uniform_gravity_field_element.h
1107311086 const char * doc_1args =
11074- R"""( Constructs a uniform gravity field element with a strength given by
11075- the acceleration of gravity vector ``g_W``, expressed in the world
11076- frame W.)""" ;
11087+ R"""( Constructs a uniform gravity field element with a strength and
11088+ direction given by the gravity acceleration vector ``g_W``, expressed
11089+ in the world frame W.)""" ;
1107711090 // Source: drake/multibody/tree/uniform_gravity_field_element.h
1107811091 const char * doc_2args =
11079- R"""( Constructs a uniform gravity field element with a strength given by
11080- the acceleration of gravity vector ``g_W``, expressed in the world
11081- frame W. Gravity is disabled for the set of model instances
11082- ``disabled_model_instances``.)""" ;
11092+ R"""( Constructs a uniform gravity field element with a strength and
11093+ direction given by the gravity acceleration vector ``g_W``, expressed
11094+ in the world frame W. Gravity is disabled for the set of model
11095+ instances ``disabled_model_instances``.
11096+
11097+ See also:
11098+ set_enabled(), is_enabled())""" ;
1108311099 } ctor;
1108411100 // Symbol: drake::multibody::UniformGravityFieldElement::gravity_vector
1108511101 struct /* gravity_vector */ {
1108611102 // Source: drake/multibody/tree/uniform_gravity_field_element.h
1108711103 const char * doc =
11088- R"""( Returns the acceleration of the gravity vector in m/s², expressed in
11089- the world frame W.)""" ;
11104+ R"""( Returns the acceleration of gravity vector in m/s², expressed in the
11105+ world frame W.)""" ;
1109011106 } gravity_vector;
1109111107 // Symbol: drake::multibody::UniformGravityFieldElement::is_enabled
1109211108 struct /* is_enabled */ {
1109311109 // Source: drake/multibody/tree/uniform_gravity_field_element.h
1109411110 const char * doc =
11095- R"""( Returns:
11096- ``True`` iff gravity is enabled for ``model_instance``.
11111+ R"""( Checks whether gravity is enabled for a given model instance.
1109711112
11098- See also :
11099- enable(), disable() .
11113+ Returns :
11114+ ``True`` iff gravity is enabled for ``model_instance`` .
1110011115
1110111116Raises:
1110211117 RuntimeError if the model instance is invalid.
@@ -11109,7 +11124,8 @@ See also:
1110911124 struct /* set_enabled */ {
1111011125 // Source: drake/multibody/tree/uniform_gravity_field_element.h
1111111126 const char * doc =
11112- R"""( Sets is_enabled() for ``model_instance`` to ``is_enabled``.
11127+ R"""( Enables or disables gravity for a given ``model_instance``. Calls to
11128+ this function are only permitted pre-Finalize().
1111311129
1111411130Raises:
1111511131 if the parent model is finalized.
@@ -11125,8 +11141,8 @@ R"""(Sets is_enabled() for ``model_instance`` to ``is_enabled``.
1112511141 struct /* set_gravity_vector */ {
1112611142 // Source: drake/multibody/tree/uniform_gravity_field_element.h
1112711143 const char * doc =
11128- R"""( Sets the acceleration of gravity vector , expressed in the world frame
11129- W in m/s² .)""" ;
11144+ R"""( Sets the gravity acceleration vector (in m/s²) , expressed in the world
11145+ frame W .)""" ;
1113011146 } set_gravity_vector;
1113111147 } UniformGravityFieldElement;
1113211148 // Symbol: drake::multibody::UnitInertia
0 commit comments