Skip to content

Commit 1356375

Browse files
Reorganizing code. Pending items - pure pursuit controller has oscillating velocity, removing unused code for longitudinal planning
1 parent 95419dc commit 1356375

5 files changed

Lines changed: 302 additions & 337 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ share/python-wheels/
3232
.installed.cfg
3333
*.egg
3434
MANIFEST
35+
.idea/
3536

3637
# PyInstaller
3738
# Usually these files are written by a python script from a template
@@ -134,6 +135,7 @@ venv/
134135
ENV/
135136
env.bak/
136137
venv.bak/
138+
*.DS_Store
137139

138140
# Spyder project settings
139141
.spyderproject
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import math
2+
3+
def quad_root(a : float, b : float, c : float) -> float:
4+
x1 = (-b + max(0,(b**2 - 4*a*c))**0.5)/(2*a)
5+
x2 = (-b - max(0,(b**2 - 4*a*c))**0.5)/(2*a)
6+
7+
if math.isnan(x1): x1 = 0
8+
if math.isnan(x2): x2 = 0
9+
10+
valid_roots = [n for n in [x1, x2] if not type(n) is complex]
11+
return valid_roots

0 commit comments

Comments
 (0)