SurgSim::Testing Namespace Reference

## Namespaces

| Cube

## Classes

class | MockInputComponent
| A MockInputComponent allows Components to test connections with devices without using an instance of DeviceInterface (and then an InputManager to connect the device with the InputComponent, etc). More...
struct | MockInputOutput
class | MockPhysicsManager
| Testing class used to publicly expose PhysicsManager's protected member functions. More...

## Functions

SurgSim::Math::RigidTransform3d | interpolatePose (const Vector3d &startAngles, const Vector3d &endAngles, const Vector3d &startPosition, const Vector3d &endPosition, const double &t)
template<>
SurgSim::Math::Quaterniond | interpolate (const SurgSim::Math::Quaterniond &start, const SurgSim::Math::Quaterniond &end, const double &t)
template<>
SurgSim::Math::RigidTransform3d | interpolate (const SurgSim::Math::RigidTransform3d &start, const SurgSim::Math::RigidTransform3d &end, const double &t)
template<class T >
T | interpolate (const T &start, const T &end, const double &t)
| Does a linear interpolation between the start and the end dependent on t. More...
template<class T >
T | interpolate (const std::pair< T, T > &values, const double &t)
template<>
SurgSim::Math::Quaterniond | interpolate< SurgSim::Math::Quaterniond > (const SurgSim::Math::Quaterniond &start, const SurgSim::Math::Quaterniond &end, const double &t)
| Specialized template to call the correct function for Quaterniond, might be superfluous, delegates to the eigen interpolation function for Quaterniond. More...
template<>
SurgSim::Math::RigidTransform3d | interpolate< SurgSim::Math::RigidTransform3d > (const SurgSim::Math::RigidTransform3d &start, const SurgSim::Math::RigidTransform3d &end, const double &t)
| Specialized template to call the correct function for RigidTransform3d, might be superfluous, delegates to the eigen interpolation function for RigidTransform3d. More...
SurgSim::Math::RigidTransform3d | interpolatePose (const SurgSim::Math::Vector3d &startAngles, const SurgSim::Math::Vector3d &endAngles, const SurgSim::Math::Vector3d &startPosition, const SurgSim::Math::Vector3d &endPosition, const double &t)
| Does a linear interpolation on a pose, given Vector3d for angles and positions. More...
template<class Container >
bool | doesContain (const Container &container, const typename Container::value_type &value)
| Predicate to use to test whether a container contains a certain element. More...

## Function Documentation

## doesContain()

template<class Container >

bool SurgSim::Testing::doesContain | ( | const Container & | container,
|  | const typename Container::value_type & | value
| ) |  |

Predicate to use to test whether a container contains a certain element.

Template Parameters

  Container | type, can usually be deduced

Parameters

  container | the container to be tested
  value | the value to check for

Returns
  true when the container contains the given value

Note
  for maps the value type is std::pair<key, mapped_type>

## interpolate() [1/4]

template<class T >

T SurgSim::Testing::interpolate | ( | const T & | start,
|  | const T & | end,
|  | const double & | t
| ) |  |

Does a linear interpolation between the start and the end dependent on t.

Template Parameters

  T | The type of value to be interpolated.

Parameters

  start | The start value.
  end | The end value.
  t | The percentage for the interpolation.

Returns
  the interpolated value.

## interpolate() [2/4]

template<class T >

T SurgSim::Testing::interpolate | ( | const std::pair< T, T > & | values,
|  | const double & | t
| ) |  |

## interpolate() [3/4]

template<>

SurgSim::Math::Quaterniond SurgSim::Testing::interpolate | ( | const SurgSim::Math::Quaterniond & | start,
|  | const SurgSim::Math::Quaterniond & | end,
|  | const double & | t
| ) |  |

## interpolate() [4/4]

template<>

SurgSim::Math::RigidTransform3d SurgSim::Testing::interpolate | ( | const SurgSim::Math::RigidTransform3d & | start,
|  | const SurgSim::Math::RigidTransform3d & | end,
|  | const double & | t
| ) |  |

## interpolate< SurgSim::Math::Quaterniond >()

template<>

SurgSim::Math::Quaterniond SurgSim::Testing::interpolate< SurgSim::Math::Quaterniond > | ( | const SurgSim::Math::Quaterniond & | start,
|  | const SurgSim::Math::Quaterniond & | end,
|  | const double & | t
| ) |  |

Specialized template to call the correct function for Quaterniond, might be superfluous, delegates to the eigen interpolation function for Quaterniond.

Parameters

  start | The start quaternion.
  end | The end quaternion.
  t | The percentage for the interpolation.

Returns
  the interpolated quaternion.

## interpolate< SurgSim::Math::RigidTransform3d >()

template<>

SurgSim::Math::RigidTransform3d SurgSim::Testing::interpolate< SurgSim::Math::RigidTransform3d > | ( | const SurgSim::Math::RigidTransform3d & | start,
|  | const SurgSim::Math::RigidTransform3d & | end,
|  | const double & | t
| ) |  |

Specialized template to call the correct function for RigidTransform3d, might be superfluous, delegates to the eigen interpolation function for RigidTransform3d.

Parameters

  start | The start quaternion.
  end | The end quaternion.
  t | The percentage for the interpolation.

Returns
  the interpolated RigidTransform3d.

## interpolatePose() [1/2]

SurgSim::Math::RigidTransform3d SurgSim::Testing::interpolatePose | ( | const Vector3d & | startAngles,
|  | const Vector3d & | endAngles,
|  | const Vector3d & | startPosition,
|  | const Vector3d & | endPosition,
|  | const double & | t
| ) |  |

## interpolatePose() [2/2]

SurgSim::Math::RigidTransform3d SurgSim::Testing::interpolatePose | ( | const SurgSim::Math::Vector3d & | startAngles,
|  | const SurgSim::Math::Vector3d & | endAngles,
|  | const SurgSim::Math::Vector3d & | startPosition,
|  | const SurgSim::Math::Vector3d & | endPosition,
|  | const double & | t
| ) |  |

Does a linear interpolation on a pose, given Vector3d for angles and positions.

The angles around the X, Y and Z axis are being passed in a Vector3d for a terser expression.

Parameters

  startAngles | The start angles in the order X/Y/Z angle axis value in radians.
  endAngles | The end angles in the order X/Y/Z angle axis value in radians.
  startPosition | The start position.
  endPosition | The end position.
  t | The percentage for the interpolation.

Returns
  The transform gained by interpolating and assembling the rotation and position values.