WPILibC++ 2024.3.2
CoordinateAxis.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <Eigen/Core>
8#include <wpi/SymbolExports.h>
9
10#include "frc/geometry/Pose3d.h"
12
13namespace frc {
14
15/**
16 * A class representing a coordinate system axis within the NWU coordinate
17 * system.
18 */
20 public:
21 /**
22 * Constructs a coordinate system axis within the NWU coordinate system and
23 * normalizes it.
24 *
25 * @param x The x component.
26 * @param y The y component.
27 * @param z The z component.
28 */
29 CoordinateAxis(double x, double y, double z);
30
31 CoordinateAxis(const CoordinateAxis&) = default;
33
36
37 /**
38 * Returns a coordinate axis corresponding to +X in the NWU coordinate system.
39 */
40 static const CoordinateAxis& N();
41
42 /**
43 * Returns a coordinate axis corresponding to -X in the NWU coordinate system.
44 */
45 static const CoordinateAxis& S();
46
47 /**
48 * Returns a coordinate axis corresponding to -Y in the NWU coordinate system.
49 */
50 static const CoordinateAxis& E();
51
52 /**
53 * Returns a coordinate axis corresponding to +Y in the NWU coordinate system.
54 */
55 static const CoordinateAxis& W();
56
57 /**
58 * Returns a coordinate axis corresponding to +Z in the NWU coordinate system.
59 */
60 static const CoordinateAxis& U();
61
62 /**
63 * Returns a coordinate axis corresponding to -Z in the NWU coordinate system.
64 */
65 static const CoordinateAxis& D();
66
67 private:
68 friend class CoordinateSystem;
69
70 Eigen::Vector3d m_axis;
71};
72
73} // namespace frc
#define WPILIB_DLLEXPORT
Definition: SymbolExports.h:36
A class representing a coordinate system axis within the NWU coordinate system.
Definition: CoordinateAxis.h:19
CoordinateAxis(const CoordinateAxis &)=default
static const CoordinateAxis & N()
Returns a coordinate axis corresponding to +X in the NWU coordinate system.
static const CoordinateAxis & D()
Returns a coordinate axis corresponding to -Z in the NWU coordinate system.
CoordinateAxis(CoordinateAxis &&)=default
static const CoordinateAxis & U()
Returns a coordinate axis corresponding to +Z in the NWU coordinate system.
static const CoordinateAxis & S()
Returns a coordinate axis corresponding to -X in the NWU coordinate system.
CoordinateAxis & operator=(CoordinateAxis &&)=default
static const CoordinateAxis & W()
Returns a coordinate axis corresponding to +Y in the NWU coordinate system.
static const CoordinateAxis & E()
Returns a coordinate axis corresponding to -Y in the NWU coordinate system.
CoordinateAxis(double x, double y, double z)
Constructs a coordinate system axis within the NWU coordinate system and normalizes it.
CoordinateAxis & operator=(const CoordinateAxis &)=default
A helper class that converts Pose3d objects between different standard coordinate frames.
Definition: CoordinateSystem.h:20
Definition: AprilTagPoseEstimator.h:15