Drake
Drake C++ Documentation
rotation_constraint.h File Reference

## Detailed Description

Functions for reasoning about 3D rotations in a @MathematicalProgram.

There are a number of choices for representing 3D rotations in a mathematical program – many of these choices involve using more than the minimal three parameters and therefore require additional constraints For example:

• the 4 parameters of a quaternion should form a vector with unit length.
• the 9 parameters of a rotation matrix should form a matrix which is orthonormal (R.transpose() = R.inverse()) and det(R)=1.

Unfortunately, in the context of mathematical programming, most of these constraints are non-convex. The methods below include convex relaxations of these non-convex constraints.

#include <string>
#include <tuple>
#include <utility>
#include <vector>
#include "drake/common/eigen_types.h"
#include "drake/solvers/decision_variable.h"
#include "drake/solvers/mathematical_program.h"
Include dependency graph for rotation_constraint.h:

drake

drake::solvers

## Typedefs

typedef uint32_t RollPitchYawLimits

## Enumerations

enum  RollPitchYawLimitOptions {
kNoLimits = 0, kRPYError = 1 << 0, kRoll_NegPI_2_to_PI_2 = 1 << 1, kRoll_0_to_PI = 1 << 2,
kPitch_NegPI_2_to_PI_2 = 1 << 3, kPitch_0_to_PI = 1 << 4, kYaw_NegPI_2_to_PI_2 = 1 << 5, kYaw_0_to_PI = 1 << 6,
kRoll_0_to_PI_2 = (1 << 1) | (1 << 2), kPitch_0_to_PI_2 = (1 << 3) | (1 << 4), kYaw_0_to_PI_2 = (1 << 5) | (1 << 6)
}

## Functions

MatrixDecisionVariable< 3, 3 > NewRotationMatrixVars (MathematicalProgram *prog, const std::string &name="R")
Allocates a 3x3 matrix of decision variables with the trivial bounding box constraint ensuring all elements are [-1,1], and the linear constraint imposing -1 <= trace(R) <= 3. More...

void AddBoundingBoxConstraintsImpliedByRollPitchYawLimits (MathematicalProgram *prog, const Eigen::Ref< const MatrixDecisionVariable< 3, 3 >> &R, RollPitchYawLimits limits=kNoLimits)
Applies very conservative limits on the entries of R for the cases when rotations can be limited (for instance, if you want to search over rotations, but there is an obvious symmetry in the problem so that e.g. More...

void AddRotationMatrixSpectrahedralSdpConstraint (MathematicalProgram *prog, const Eigen::Ref< const MatrixDecisionVariable< 3, 3 >> &R)
Adds constraint (10) from https://arxiv.org/pdf/1403.4914.pdf , which exactly represents the convex hull of all rotation matrices in 3D. More...

void AddRotationMatrixOrthonormalSocpConstraint (MathematicalProgram *prog, const Eigen::Ref< const MatrixDecisionVariable< 3, 3 >> &R)
Adds a set of convex constraints which approximate the set of orthogonal matrices, O(3). More...