-
Notifications
You must be signed in to change notification settings - Fork 2
/
init_scen_2.m
97 lines (57 loc) · 1.6 KB
/
init_scen_2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
% THIS SCRIPT INITILIZES THE REQUIRED PARAMETERS
%% Clear workspace
clear;
clc;
%% SAMPLING TIME
%h= 0.1; Crashes into obstacle
h= 0.05;
%% SIMULATION PARAMETERS
% Robot Longitudinal Velocity (m.s^-1)
robot_vel= 1;
% Robot Initial Position
robot_init_pos_path= [0 0]';
%robot_init_pos_sim= robot_init_pos_path;
robot_init_pos_sim= [0 0]';
% Goal point
X_goal= [50 31]';
%X_goal= 50.*[rand() rand()]';
% Initial Yaw Angle
yaw_ang_init= 0;
%% ROBOT MODEL PARAMETERS
% Mass(kg)
mass= 505;
% Yaw mass moment of Inertia(kg.m^2)
I_zz= 808.5;
% Front tyre cornering stiffness(N/deg)
%C_f= 1420;
C_f= 40e3;
% Rear tyre cornering stiffness(N/deg)
%C_r= 1420;
C_r= 40e3;
% Longitudinal distance of front wheel from center of mass(m)
l_f= 0.35;
% Longitudinal distance of back wheels from center of mass(m)
l_r= 0.4125;
%% TRAJECTORY PARAMETERS
% Attractive Potential Constant
k_att= 0.01;
% Repulsive Potential Constant
k_rep= 10;
% Obstacle Radius (Assuming circular obstacle of constant radius) (m)
obs_radius= 1;
% Maximum Longitudinal Velocity
V_MAX= robot_vel*3; % m/sec
% Maximum Longitudinal Deceleration
A_MAX= 0.2; % m/sec^2
% Obstacle Influence Range
rol_not= V_MAX/(2*A_MAX);
% Stopping Criteria
stopping_criteria= 0.001; % Stop when Attractive Potential is at/lower than this value
% Robot Size Alllowance
robot_size_allowance= 1.5; % 150 cm
% Obstacles (sharp corners)
obstacles= [ [14.87 33.28]' [10 8]' [26 12]' [19 19]' [34 23]' ];
% Obstacles (mild corners)
%obstacles= [ [14.87 33.28]' [32 30]' [19 19]' [34.49 17.25]' [27 18]'];
% Maximum number of iterations
max_iterations= 150000;