Thunderbots Project
Loading...
Searching...
No Matches
AngleMap Class Reference

#include <angle_map.h>

Public Member Functions

 AngleMap (Angle top_angle, Angle bottom_angle, size_t reserved_num_obstacles=1)
 
 AngleMap (AngleSegment angle_seg, size_t max_num_obstacles)
 
const AngleSegmentgetAngleSegment () const
 
void addNonViableAngleSegment (AngleSegment &obstacle_angle_seg)
 
AngleSegment getBiggestViableAngleSegment ()
 

Detailed Description

Represents an AngleMap that is confined to a top and bottom angle, with angles described as going from pi -> 0 -> -pi

NOTE: If we have two angle segments: a = 0 -> 45 b = 90 -> 180

These two get added to the map

Now we have another angle segment: c = 45 -> 90

If c gets added to the map it will only merge with one of a or b, not both. Merging with the one that was placed in the map first

The map will still have two angle segments even though it should only have one since they all overlap. Sorting before hand solves this so they'll all be in an incremental order

Constructor & Destructor Documentation

◆ AngleMap() [1/2]

AngleMap ( Angle  top_angle,
Angle  bottom_angle,
size_t  reserved_num_obstacles = 1 
)

Constructs an AngleMap with a specified top angle, bottom angle, and max number of possible occupied AngleSegments within this map

Parameters
top_anglethe top angle (most positive) of the AngleSegment this map occupies
bottom_anglethe bottom angle (most negative) of the AngleSegment this map occupies
max_num_obstaclesthe max number of possible occupied AngleSegments within this map

◆ AngleMap() [2/2]

AngleMap ( AngleSegment  angle_seg,
size_t  max_num_obstacles 
)

Constructs an AngleMap with a specified AngleSegment and max number of possible occupied AngleSegments within this map

Parameters
angle_segthe AngleSegment this map occupies
max_num_obstaclesthe max number of possible occupied AngleSegments within this map

Member Function Documentation

◆ addNonViableAngleSegment()

void addNonViableAngleSegment ( AngleSegment obstacle_angle_seg)

Adds an AngleSegment to this map and marks it as occupied

Parameters
angleSegmentthe AngleSegment to mark as occupied

◆ getAngleSegment()

const AngleSegment & getAngleSegment ( ) const

Gets the AngleSegment that this AngleMap occupies

Returns
the AngleSegment that this AngleMap occupies

◆ getBiggestViableAngleSegment()

AngleSegment getBiggestViableAngleSegment ( )

Gets the biggest AngleSegment within the map that isn't occupied

Returns
the biggest AngleSegment within the map that isn't occupied

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