Skip to content

Commit

Permalink
add documentation to Pose class
Browse files Browse the repository at this point in the history
  • Loading branch information
SizzinSeal committed May 28, 2024
1 parent 3f15fd8 commit 64798c6
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
55 changes: 54 additions & 1 deletion include/units/Pose.hpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,71 @@
#include "units/Vector2D.hpp"

namespace units {
/**
* @class Pose
*
* @brief A class that represents a position and orientation in 2D space
*
* This class inherits from V2Position, which is identical to Vector2D<Length>. The only difference here
* is that Pose has an additional member variable, theta, which represents orientation.
*/
class Pose : public V2Position {
protected:
Angle theta;
Angle theta; /** Orientation */
public:
/**
* @brief Construct a new Pose object
*
* This constructor initializes x, y, and orientation to 0
*/
Pose();

/**
* @brief Construct a new Pose object
*
* This constructor initializes x, y to the given values and orientation to 0
*
* @param v position
*/
Pose(V2Position v);

/**
* @brief Construct a new Pose object
*
* @param v position
* @param h orientation
*/
Pose(V2Position v, Angle h);

/**
* @brief Construct a new Pose object
*
* @param nx x position
* @param ny y position
*/
Pose(Length nx, Length ny);

/**
* @brief Construct a new Pose object
*
* @param nx x position
* @param ny y position
* @param nh orientation
*/
Pose(Length nx, Length ny, Angle nh);

/**
* @brief Get the orientation
*
* @return Angle orientation
*/
Angle getTheta();

/**
* @brief Set the orientation
*
* @param h orientation
*/
void setTheta(Angle h);
};
} // namespace units
2 changes: 2 additions & 0 deletions src/units/Pose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ Pose::Pose(V2Position v, Angle h) : V2Position(v), theta(0.0) {}
Pose::Pose(Length nx, Length ny, Angle nh) : V2Position(nx, ny), theta(nh) {}

Angle Pose::getTheta() { return theta; }

void Pose::setTheta(Angle h) { theta = h; }
} // namespace units

0 comments on commit 64798c6

Please sign in to comment.