Skip to content

Commit

Permalink
tune params
Browse files Browse the repository at this point in the history
  • Loading branch information
hayoung-kim committed Dec 6, 2017
1 parent 74ae350 commit 74eb65d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ int main() {

// TODO: define a path made up of (x,y) points that the car will visit sequentially every .02 seconds
double MPH2mps = 1.0/2.23694;
double max_speed = 45*MPH2mps;
double max_speed = 44*MPH2mps;

int prev_path_size = previous_path_x.size();
step += 1;
Expand All @@ -188,7 +188,7 @@ int main() {
// INITIALIZE PLANNER
vector<Planner> planners;
for (int i=0; i<3; i++) {
double _target_d = 2.0 + 4* i;
double _target_d = 2.0 + 4* i - 0.02;
Planner planner;
MatrixXd s_trajectories(6, 0);
VectorXd s_costs(0);
Expand Down Expand Up @@ -281,8 +281,8 @@ int main() {

// WAYPOINTS SMOOTHING
int _close_way_point_id = ClosestWaypoint(car_x, car_y, map_waypoints_x, map_waypoints_y);
int id_interp_start = _close_way_point_id - 5;
int id_interp_end = _close_way_point_id + 7;
int id_interp_start = _close_way_point_id - 4;
int id_interp_end = _close_way_point_id + 5;
int id_map_last = map_waypoints_x.size();

// cout << "setting a range for interpolate ... " << endl;
Expand Down Expand Up @@ -362,7 +362,7 @@ int main() {
if (planners[i].obstacle_following){
Vehicle target_obstacle = planners[i].target_to_follow;
_ = FollowingTrajectories(s0, s0dot, s0ddot, \
target_obstacle.s, target_obstacle.speed - 0.1, max_speed, \
target_obstacle.s, target_obstacle.speed - 0.2, max_speed, \
planners[i].s_trajectories, planners[i].s_costs);
}
_ = VelocityKeepingTrajectories(s0, s0dot, s0ddot, \
Expand All @@ -383,7 +383,7 @@ int main() {
if (planners[i].obstacle_following){
Vehicle target_obstacle = planners[i].target_to_follow;
_ = FollowingTrajectories(s0, s0dot, s0ddot, \
target_obstacle.s, target_obstacle.speed - 0.1, max_speed, \
target_obstacle.s, target_obstacle.speed - 0.2, max_speed, \
planners[i].s_trajectories, planners[i].s_costs);
}
// keeping
Expand Down Expand Up @@ -432,7 +432,7 @@ int main() {

// collision check
// cout << " [*] checking collision " << i+1 << " ..." << endl;
int max_iter = 100;
int max_iter = 150;
int iters = -1;
if (max_iter >= ntraj) {max_iter = ntraj;}
for (int k=0; k<max_iter; k++) {
Expand Down
4 changes: 2 additions & 2 deletions src/polysolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ int VelocityKeepingTrajectories(double s0, double s0dot, double s0ddot, \
double s1dot, double max_speed, MatrixXd &s_trajectories, VectorXd &s_costs) {

vector<double> ds1dotset;
vector<double> ds1dotcand = {-15.0, -10.0, -5.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0};
vector<double> ds1dotcand = {-15.0, -10.0, -5.0, -3.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0};
vector<double> Tjset = {3.0,3.5,4.0};
double kspeed = 9.0;

Expand All @@ -268,7 +268,7 @@ int VelocityKeepingTrajectories(double s0, double s0dot, double s0ddot, \

int FollowingTrajectories(double s0, double s0dot, double s0ddot, double s_lv0, double s_lv0dot, double max_speed, MatrixXd &s_trajectories, VectorXd &s_costs) {
// tunning parameters : safety distance and CTG param
double dist_safe = 15.0;
double dist_safe = 10.0;
double tau = 1.0; // constant time gap policy parameter

double kspeed = 9.0;
Expand Down

0 comments on commit 74eb65d

Please sign in to comment.