Gazebo Physics

API Reference

5.3.2
SpecifyData< Specifications > Class Template Reference

The SpecifyData class allows you to form combinations of data specifications. In other words, you can freely mix invocations to RequireData and ExpectData. Example usage: More...

#include <SpecifyData.hh>

Detailed Description

template<typename... Specifications>
class ignition::physics::SpecifyData< Specifications >

The SpecifyData class allows you to form combinations of data specifications. In other words, you can freely mix invocations to RequireData and ExpectData. Example usage:

using namespace ignition::physics;
using MyInputSpecifications = SpecifyData<
RequireData<
DesiredPositionInput,
DesiredVelocityInput>,
ExpectData<
ExternalForceInput,
ProximitySensorInput,
ForceTorqueSensorInput> >;

This would define a CompositeData which is required to contain a DesiredPositionInput data structure and a DesiredVelocityInput data structure. It is also optimized for ExternalForceInput, ProximitySensorInput, and ForceTorqueSensorInput data structures, but they are optional. Whether a data structure is specified as expected or required, you will be able to get extremely high-speed access to it through an object that has the type of MyInputSpecifications.

Specifications can also be composed together. For example, if there is another specification like:

using ComplianceInputSpecifications = SpecifyData<
RequireData<
ProximitySensorInput,
ComplianceParameters>,
ExpectData<
ForceTorqueSensorInput,
CameraSensorInput> >;

then you can combine these specifications:

using CombinedInputSpecifications = SpecifyData<
MyInputSpecifications,
ComplianceInputSpecifications>;

Note that RequireData takes precedence over ExpectData, so ProximitySensorInput will be promoted to Required when the two specifications are combined.

See also
ExpectData<Expected>
RequireData<Required>

The documentation for this class was generated from the following file:
The SpecifyData class allows you to form combinations of data specifications. In other words,...
Definition: gz/physics/SpecifyData.hh:265
Definition: gz/physics/BoxShape.hh:28