#include <MechanismPositionConfig.hpp>
Where a mechanism is on the robot, for each mechanism's GetPose3d(): where it is mounted, how it is turned there, the plane it moves in, and optionally the mechanism it is mounted on, such as an arm on an elevator's carriage.
Definition MechanismPositionConfig.hpp:31
MechanismPositionConfig & WithRelativePosition(const wpi::math::Translation3d &robotToMechanism)
Definition MechanismPositionConfig.hpp:51
MechanismPositionConfig & WithMovementPlane(Plane plane)
Definition MechanismPositionConfig.hpp:76
◆ Plane
The planes that the mechanism could move in.
| Enumerator |
|---|
| XZ | X-Z plane: forward and up. The default.
|
| YZ | Y-Z plane: left and up.
|
| XY | X-Y plane: forward and left, such as a turret.
|
◆ MechanismPositionConfig()
| yams::mechanisms::config::MechanismPositionConfig::MechanismPositionConfig |
( |
| ) |
|
|
default |
◆ GetMountPose()
| wpi::math::Pose3d yams::mechanisms::config::MechanismPositionConfig::GetMountPose |
( |
| ) |
const |
|
inline |
Where the mechanism is mounted: its parent's pose, or the robot's origin, moved and turned by its relative position.
◆ GetMovementPlane()
| Plane yams::mechanisms::config::MechanismPositionConfig::GetMovementPlane |
( |
| ) |
const |
|
inline |
Get the plane that the mechanism moves in.
◆ GetRelativePosition()
| std::optional< wpi::math::Translation3d > yams::mechanisms::config::MechanismPositionConfig::GetRelativePosition |
( |
| ) |
const |
|
inline |
Get the translation from the robot, or from the parent, to the mechanism, if set.
◆ GetRotatedPose()
| wpi::math::Pose3d yams::mechanisms::config::MechanismPositionConfig::GetRotatedPose |
( |
wpi::units::radian_t |
angle | ) |
const |
|
inline |
The pose of a part that turns about the axis normal to the movement plane, such as an arm or a pivot, at an angle. At 0 it points along +X in the XZ and XY planes, and along +Y in the YZ plane, and a positive angle turns it toward +Z in the XZ and YZ planes, and toward +Y in the XY plane.
- Parameters
-
| angle | The angle it is turned to. |
- Returns
- Its pose: where it is mounted, turned by the angle.
◆ GetTranslatedPose()
| wpi::math::Pose3d yams::mechanisms::config::MechanismPositionConfig::GetTranslatedPose |
( |
wpi::units::meter_t |
distance, |
|
|
wpi::units::radian_t |
angle |
|
) |
| const |
|
inline |
The pose of a part that slides along the movement plane, such as an elevator's carriage.
- Parameters
-
| distance | How far it has slid from where it is mounted. |
| angle | The direction it slides in, in the movement plane: 0 along +X (+Y in the YZ plane), 90 degrees along +Z (+Y in the XY plane). |
- Returns
- Its pose: where it is mounted, moved by the distance, and not turned.
◆ RotationInPlane()
| wpi::math::Rotation3d yams::mechanisms::config::MechanismPositionConfig::RotationInPlane |
( |
wpi::units::radian_t |
angle | ) |
const |
|
inline |
The rotation of a part turned by an angle about the axis normal to the movement plane.
- Parameters
-
- Returns
- The rotation.
◆ WithMovementPlane()
Set the plane that the mechanism moves in.
- Parameters
-
| plane | The plane. Default is the X-Z plane. |
- Returns
- *this for chaining.
◆ WithParent()
| MechanismPositionConfig & yams::mechanisms::config::MechanismPositionConfig::WithParent |
( |
std::function< wpi::math::Pose3d()> |
parentPose | ) |
|
|
inline |
Mount the mechanism on another, such as an arm on an elevator's carriage, so it moves with it. The mechanism's relative position is then from the parent's pose, rather than from the robot.
- Parameters
-
| parentPose | The pose the mechanism is mounted on, such as the elevator's GetPose3d(). |
- Returns
- *this for chaining.
◆ WithRelativePosition() [1/2]
| MechanismPositionConfig & yams::mechanisms::config::MechanismPositionConfig::WithRelativePosition |
( |
const wpi::math::Transform3d & |
robotToMechanism | ) |
|
|
inline |
Set where the mechanism is mounted, relative to the robot, or to its parent, and how it is turned there. The mechanism's pose is worked out from here: an arm's or pivot's axis, an elevator's carriage at zero height, or a flywheel's axle.
- Parameters
-
| robotToMechanism | Transform from the robot, or from its parent, to the mechanism. |
- Returns
- *this for chaining.
◆ WithRelativePosition() [2/2]
| MechanismPositionConfig & yams::mechanisms::config::MechanismPositionConfig::WithRelativePosition |
( |
const wpi::math::Translation3d & |
robotToMechanism | ) |
|
|
inline |
Set where the mechanism is mounted, relative to the robot, or to its parent.
- Parameters
-
| robotToMechanism | Translation from the robot, or from its parent, to the mechanism. |
- Returns
- *this for chaining.
The documentation for this class was generated from the following file: