Roomba Controller Dashboard 1
A GUI and TCP client application that is used to control a Roomba for Computer Engineering 2880 @ Iowa State
Loading...
Searching...
No Matches
Hole Class Reference

#include <Hole.hpp>

Public Member Functions

 Hole (double X1, double Y1, double X2, double Y2, double holeSize)
 
 Hole (const Pose2D &positionOne, const Pose2D &positionTwo, bool foundHole, const std::vector< Pose2D > &points, double holeSize)
 
 Hole (double x1, double y1, double x2, double y2)
 
 Hole (const Pose2D &positionOne, const Pose2D &positionTwo, double holeSize)
 
std::vector< Pose2DgetSuggestedNodePlacements ()
 
void registerPointsToHole (const Pose2D &positionOne, const Pose2D &positionTwo)
 
Pose2D copyDoOperation (const Pose2D &position) const
 
Pose2D getOneSquareCorner ()
 
Pose2D getSecondSquareCorner ()
 
bool pointCouldBeMemberOfHole (const Pose2D &measurment)
 
bool isFoundHole () const
 
std::vector< HolegetSubHolesCopy () const
 
 Hole ()
 
 Hole (const Hole &hole)
 
 Hole (const Pose2D &initialPoint, double holeSize)
 
void addPoint (const Pose2D &position)
 
bool isInSquare (Pose2D &position) const
 
void offset (const Pose2D &offset)
 
bool lineIntersectsHole (const Pose2D &posOne, const Pose2D &posTwo) const
 

Friends

std::ostream & operator<< (std::ostream &os, const Hole &hole)
 

Detailed Description

A Hole is either a complete square where we know the critical points (two vertices of the square). A Hole could also represent a bunch of points that are all within Square Length * Root(2) of eachother

Definition at line 20 of file Hole.hpp.

Constructor & Destructor Documentation

◆ Hole() [1/7]

Hole::Hole ( double X1,
double Y1,
double X2,
double Y2,
double holeSize )

Make a new hole with the given coordinates

Parameters
X1one corner's X position
Y1one corner's Y position
X2the other corner's X position
Y2the other corner's Y position

Definition at line 110 of file Hole.cpp.

◆ Hole() [2/7]

Hole::Hole ( const Pose2D & positionOne,
const Pose2D & positionTwo,
bool foundHole,
const std::vector< Pose2D > & points,
double holeSize )

Copy constructor for hole

Definition at line 19 of file Hole.cpp.

◆ Hole() [3/7]

Hole::Hole ( double x1,
double y1,
double x2,
double y2 )

Makes a new hole object with the given coordinates

Parameters
x1
y1
x2
y2

Definition at line 449 of file Hole.cpp.

◆ Hole() [4/7]

Hole::Hole ( const Pose2D & positionOne,
const Pose2D & positionTwo,
double holeSize )

Creates a new Hole object

Created by Caleb Kugel on 11/15/2024

Definition at line 9 of file Hole.cpp.

◆ Hole() [5/7]

Hole::Hole ( )

The deafult constructor for a hole.

Definition at line 121 of file Hole.cpp.

◆ Hole() [6/7]

Hole::Hole ( const Hole & hole)

Copy constructor

Definition at line 147 of file Hole.cpp.

◆ Hole() [7/7]

Hole::Hole ( const Pose2D & initialPoint,
double holeSize )
explicit

Makes a new hole and stores the initial measurment

Parameters
initialPointour initial measurment

Definition at line 129 of file Hole.cpp.

Member Function Documentation

◆ addPoint()

void Hole::addPoint ( const Pose2D & position)

Add a point to this hole/chunk. Morphs this object into a found hole if possible

Parameters
positionthe position of the measurment

Definition at line 170 of file Hole.cpp.

◆ copyDoOperation()

Pose2D Hole::copyDoOperation ( const Pose2D & position) const

do the whole operation and copy it into a new object for object collision

Parameters
positionthe Pose2D to apply the big formula
Returns
the result of the operations

Definition at line 43 of file Hole.cpp.

◆ getOneSquareCorner()

Pose2D Hole::getOneSquareCorner ( )
Returns
one of the square's corners

Definition at line 35 of file Hole.cpp.

◆ getSecondSquareCorner()

Pose2D Hole::getSecondSquareCorner ( )
Returns
the second of the square's corners

Definition at line 39 of file Hole.cpp.

◆ getSubHolesCopy()

std::vector< Hole > Hole::getSubHolesCopy ( ) const

get a copy of the holes within holes (measurments)

Returns
a vector of the holes within holes

Definition at line 458 of file Hole.cpp.

◆ getSuggestedNodePlacements()

std::vector< Pose2D > Hole::getSuggestedNodePlacements ( )

Gets a list of suggested node placements, for nodes in the graph. These node placements are guranteed to not conflict with a hole, or it's measurements.

Returns
a list of suggested node placements

Definition at line 56 of file Hole.cpp.

◆ isFoundHole()

bool Hole::isFoundHole ( ) const
inline

whether we have found a hole

Returns
whether we found a hole

Definition at line 115 of file Hole.hpp.

◆ isInSquare()

bool Hole::isInSquare ( Pose2D & position) const

Whether the passed in position is in the square

Parameters
positionthe position to check
Returns
whether that position is in the square

Definition at line 83 of file Hole.cpp.

◆ lineIntersectsHole()

bool Hole::lineIntersectsHole ( const Pose2D & posOne,
const Pose2D & posTwo ) const

Line intersects any hole measurement

Parameters
posOneposition one of the line
posTwoposition two of the line

Definition at line 393 of file Hole.cpp.

◆ offset()

void Hole::offset ( const Pose2D & offset)

Offset all the corners and measurements

Parameters
offsetthe amount to offset by

Definition at line 381 of file Hole.cpp.

◆ pointCouldBeMemberOfHole()

bool Hole::pointCouldBeMemberOfHole ( const Pose2D & measurment)

returns whether a new point could be within the range of this hole.

Parameters
measurmentthe position of the point that may or may not be close to this hole

Definition at line 138 of file Hole.cpp.

◆ registerPointsToHole()

void Hole::registerPointsToHole ( const Pose2D & positionOne,
const Pose2D & positionTwo )

Register the corners of a hole

Parameters
positionOnecorner One
positionTwoCorner Two

Definition at line 306 of file Hole.cpp.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Hole & hole )
friend

Override output stream for printing

Parameters
osoutput stream
holethe hole to print
Returns
the hole printed in the out stream

Definition at line 373 of file Hole.cpp.


The documentation for this class was generated from the following files: