This page describes how to use classes such as schema::Rotation and schema::Transform to denote stochastic quantities, as a bridge between loading a scenario specification and populating the corresponding math::RigidTransform quantities.
The broader concepts are discussed at Configuring distributions. Here, we cover details related to rotations and transforms in particular.
We'll explain uses of schema::Rotation and schema::Transform using their matching YAML syntax as parsed by yaml::LoadYamlFile.
This shows the syntax for a schema::Rotation.
When no details are given, the default rotation is the identity matrix:
For clarity, you may also specify Identity
variant tag explicitly. This version and the above version have exactly the same effect:
To specify roll, pitch, yaw angles using math::RollPitchYaw conventions, use Rpy
as the variant tag:
To specify a rotation angle and axis in the sense of Eigen::AngleAxis, use AngleAxis
as the variant tag:
You may also use YAML's flow style to fit everything onto a single line. These one-line spellings are the equivalent to those above.
To specify a stochastic rotation sampled from a uniform distribution over SO(3):
The other available representations also accept stochastic distributions for their values:
Or:
For an explanation of !Uniform
, !UniformVector
, and other available options (Gaussian, etc.) for scalar and vector quantities, see Configuring distributions.
This shows the syntax for a schema::Transform. A transform is merely a translation and rotation, optionally with a some given string as a base_frame.
Or:
Either or both of the rotational or translation component can be stochastic:
For an explanation of !Uniform
, !UniformVector
, and other available options (Gaussian, etc.) for scalar and vector quantities, see Configuring distributions.