Class MPCEuclidianDistance
Defined in File mpc_casadi.hpp
Class Documentation
-
class MPCEuclidianDistance
Public Functions
-
void set_up(const float &distance_weight, const float &race_line_d_weight, const float &border_weight, const float &steering_smoothness_weight, const float &speed_smoothness_weight, const float &low_speed_weight, const float &high_theta_dot_weight, const float &opponent_distance_weight, const float &total_time_weight, const float &opp_radius, const float &walls_cost_weight, const float ¢ripetal_weight, const float &go_fast_weight)
Constructor for the FrenetOptimalTrajectory class. Initializes parameters for calculating the optimal trajectory in Frenet coordinates.
- Parameters:
distance_weight – Weight for distance from target point.
race_line_d_weight – Weight for lateral displacement error.
border_weight – Weight for distance from border.
steering_smoothness_weight – Weight for high steering change.
speed_smoothness_weight – Weight for high accelerations.
low_speed_weight – Weight for low speeds.
high_theta_dot_weight – Weight for low speeds.
total_time_weight – Weight for total time.
-
std::tuple<std::vector<std::pair<double, double>>, std::vector<std::tuple<double, double, double>>, std::vector<std::pair<double, double>>, std::pair<double, double>> solve_one_iteration(std::tuple<double, double, double, double, double> start_state, std::vector<std::tuple<double, double, double>> target_state, std::tuple<double, double, double, double> opponent_pos, bool has_opp, bool force_initialization)
-
void set_max_speed(float max_speed)
-
void problem_definition(bool has_opp)
-
void set_initialization(std::vector<std::pair<double, double>> controls, std::vector<std::tuple<double, double, double>> state)
Public Members
-
int HORIZON = 10
-
double STEP_SIZE = 0.1
-
double MAX_SPEED = 10.0
-
double MIN_SPEED_GAIN = 0.5
-
double MAX_SPEED_GAIN = 4.0
-
double DELTA_THETA_LIMIT = 0.8
-
casadi::MX distance_function = casadi::MX(0)
-
casadi::MX steering_smoothness_cost = casadi::MX(0)
-
casadi::MX opponent_distance_cost = casadi::MX(0)
-
casadi::MX walls_cost = casadi::MX(0)
-
casadi::MX centripetal_cost = casadi::MX(0)
-
casadi::MX go_fast_cost = casadi::MX(0)
-
casadi::MX speed_smoothness_cost = casadi::MX(0)
-
bool use_gaussian_
-
void set_up(const float &distance_weight, const float &race_line_d_weight, const float &border_weight, const float &steering_smoothness_weight, const float &speed_smoothness_weight, const float &low_speed_weight, const float &high_theta_dot_weight, const float &opponent_distance_weight, const float &total_time_weight, const float &opp_radius, const float &walls_cost_weight, const float ¢ripetal_weight, const float &go_fast_weight)