fixes
This commit is contained in:
parent
9441662d95
commit
e0156cea73
@ -1 +1 @@
|
|||||||
Subproject commit 89795a10e037c8b55f6e85b2b3e068e8b86a026f
|
Subproject commit 7a1afae0c293c24d90f0af45c4a709d1d663128a
|
12
robot.py
12
robot.py
@ -4,7 +4,7 @@ class Robot:
|
|||||||
# position
|
# position
|
||||||
pos=(1,1.5)
|
pos=(1,1.5)
|
||||||
# orientation
|
# orientation
|
||||||
rot=-1
|
rot=-pi/2
|
||||||
# velocite
|
# velocite
|
||||||
v=0
|
v=0
|
||||||
# velocite angulaire
|
# velocite angulaire
|
||||||
@ -12,7 +12,7 @@ class Robot:
|
|||||||
# velocite des roues (non angulaire)
|
# velocite des roues (non angulaire)
|
||||||
wv=[0,0]
|
wv=[0,0]
|
||||||
# velocite max
|
# velocite max
|
||||||
wmv=0.1
|
wmv=1
|
||||||
# espace entre les deux roues
|
# espace entre les deux roues
|
||||||
l=0.1
|
l=0.1
|
||||||
# time
|
# time
|
||||||
@ -26,9 +26,9 @@ class Robot:
|
|||||||
# position du spot lumineux
|
# position du spot lumineux
|
||||||
light_pos = (9, 1.5)
|
light_pos = (9, 1.5)
|
||||||
# ecart entre les deux photores
|
# ecart entre les deux photores
|
||||||
photores_l = 0.1
|
photores_l = 0.07
|
||||||
# longeur du séparateur entre les photorésistances
|
# longeur du séparateur entre les photorésistances
|
||||||
photores_sep_l = 0.05
|
photores_sep_l = 0.6
|
||||||
# constantes de résistance des photoresistances
|
# constantes de résistance des photoresistances
|
||||||
PHOTORES_LIGHT = 100
|
PHOTORES_LIGHT = 100
|
||||||
PHOTORES_SHADOW = 20000
|
PHOTORES_SHADOW = 20000
|
||||||
@ -70,8 +70,8 @@ class Robot:
|
|||||||
self.pr_l = self.PHOTORES_SHADOW
|
self.pr_l = self.PHOTORES_SHADOW
|
||||||
self.pr_r = self.PHOTORES_LIGHT
|
self.pr_r = self.PHOTORES_LIGHT
|
||||||
|
|
||||||
self.pins[self.pr_l_pin] = int(1024-1024 * self.PHOTORES_BRIDGE/(self.pr_l+self.PHOTORES_BRIDGE))
|
self.pins[self.pr_l_pin] = int(1024 * self.pr_l/(self.pr_l+self.PHOTORES_BRIDGE))
|
||||||
self.pins[self.pr_r_pin] = int(1024-1024 * self.PHOTORES_BRIDGE/(self.pr_r+self.PHOTORES_BRIDGE))
|
self.pins[self.pr_r_pin] = int(1024 * self.pr_r/(self.pr_r+self.PHOTORES_BRIDGE))
|
||||||
|
|
||||||
|
|
||||||
def analogWrite(self, pin, dc):
|
def analogWrite(self, pin, dc):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user