Robot Principal 26
Documentation du Club Robot INSA Rennes 2026
Chargement...
Recherche...
Aucune correspondance
wb_const.h
Aller à la documentation de ce fichier.
1
7
8#ifndef __WB_CONST_H__
9#define __WB_CONST_H__
10
11#include <Wheeledbase.h>
12
13//Really traveled distance > thought traveled distance -> decrease codewheels radius
14//Really rotated angle > thought rotated angle -> increase axle track
15//Turn right when thinking moving forward -> increase left codewheel radius
16//Turn left when thinking moving forward -> increase right codewheel radius
17
18
19inline Wheeledbase::WBConstants wb_consts = {
20 .LEFTWHEEL_RADIUS = 23.8125,
21 .LEFTWHEEL_CONSTANT = 0.209380534*2,
22 .LEFTWHEEL_MAXPWM = 1.0,
23 .RIGHTWHEEL_RADIUS = 23.8125,
24 .RIGHTWHEEL_CONSTANT = 0.209380534*2,
25 .RIGHTWHEEL_MAXPWM = 1.0,
26 .LEFTCODEWHEEL_COUNTSPERREV = 5000,
27 .RIGHTCODEWHEEL_COUNTSPERREV = 5000,
28 .LEFTCODEWHEEL_RADIUS = 22.734851011,
29 .RIGHTCODEWHEEL_RADIUS = 22.734851011,
30
31 .ODOMETRY_AXLETRACK = 207.5496406,
32 .ODOMETRY_SLIPPAGE = 0,
33
34 .VELOCITYCONTROL_AXLETRACK = 125.0,//201.5
35 .VELOCITYCONTROL_MAXLINACC = 300,
36 .VELOCITYCONTROL_MAXLINDEC = 125,
37 .VELOCITYCONTROL_MAXANGACC = PI/2,
38 .VELOCITYCONTROL_MAXANGDEC = PI/2,
39 .VELOCITYCONTROL_SPINSHUTDOWN = false,
40
41 /*---- LINEAR VELOCITIES PID ----*/
42
43 .LINVELPID_KP = 1.4,
44 .LINVELPID_KI = 2.2,
45 .LINVELPID_KD = 0.01,
46
47 /*
48 .LINVELPID_KP = 1.4,
49 .LINVELPID_KI = 3.2,
50 .LINVELPID_KD = 0,*/
51
52 .LINVELPID_MINOUTPUT = -350,
53 .LINVELPID_MAXOUTPUT = 350,
54
55 /*---- ANGULAR VELOCITIES PID ----*/
56 .ANGVELPID_KP = 3, //.5 3 0.8,
57 .ANGVELPID_KI = 3,//.1 1.5 0.5,
58 .ANGVELPID_KD = 0,
59
60 .ANGVELPID_MINOUTPUT = -2*PI/3,
61 .ANGVELPID_MAXOUTPUT = 2*PI/3,
62
63 /*---- POSITION PID ----*/
64 .POSITIONCONTROL_LINVELKP = 1,
65 .POSITIONCONTROL_ANGVELKP = 1,
66
67 .POSITIONCONTROL_LINVELMAX = 350,
68 .POSITIONCONTROL_ANGVELMAX = PI/2,
69 .POSITIONCONTROL_LINPOSTHRESHOLD = 1,
70 .POSITIONCONTROL_ANGPOSTHRESHOLD = 0.008,
71 .PUREPURSUIT_LOOKAHEAD = 30.0,
72 .PUREPURSUIT_LOOKAHEADBIS = 40.0,
73
74 // Timesteps
75 .ODOMETRY_TIMESTEP = 20e-3,
76 .PID_CONTROLLERS_TIMESTEP = 20e-3,
77 .POSITIONCONTROL_TIMESTEP = 20e-3,
78
79 // DC motors driver
80 .LEFT_MOTOR_EN = PD1,
81 .LEFT_MOTOR_PWM = PC6,
82 .LEFT_MOTOR_DIR = PD3,
83 .RIGHT_MOTOR_EN = PD0,
84 .RIGHT_MOTOR_PWM = PC7,
85 .RIGHT_MOTOR_DIR = PD2,
86 .DRIVER_RESET = PC11,
87 .DRIVER_FAULT = PC12,
88};
89
90#endif // __WB_CONST_H__