Class Obstacle

Class Documentation

class Obstacle

Public Functions

Obstacle(double x, double y, double size, double theta)
bool operator==(const Obstacle &other) const

Constructs an Obstacle object represed as a square with a center, size, and orientation.

Initializes the square’s center coordinates (cartesian), side length, and orientation angle. The corner coordinates of the square are precomputed based on the given parameters.

Parameters:
  • x – X-coordinate of the square’s center.

  • y – Y-coordinate of the square’s center.

  • size – Length of the square’s side.

  • theta – Orientation of the square in radians (angle from the x-axis).

double squared_dist(const Obstacle &obstacle) const

Public Members

double center_x
double center_y
double size
double theta

Size of obstacle.

int id

Orientation angle (in radian) relative to the x-axis.

std::pair<double, double> point_1
std::pair<double, double> point_2
std::pair<double, double> point_3
std::pair<double, double> point_4

Public Static Attributes

static int current_id