mirror of
https://forge.apps.education.fr/blender-edutech/ropy.git
synced 2024-01-27 08:23:20 +01:00
Supression de l'echo du jumeau numérique
This commit is contained in:
parent
ac9de02490
commit
401af11095
BIN
ropy-31.blend
BIN
ropy-31.blend
Binary file not shown.
BIN
ropy-31.blend1
Normal file
BIN
ropy-31.blend1
Normal file
Binary file not shown.
25
rp_lib.py
25
rp_lib.py
@ -170,9 +170,10 @@ def sound_play (sound):
|
|||||||
|
|
||||||
##
|
##
|
||||||
# Avancer le rover
|
# Avancer le rover
|
||||||
|
# - twins (True|False) : envoi un ordre au jumeau réel
|
||||||
##
|
##
|
||||||
|
|
||||||
def rp_avancer ():
|
def rp_avancer (twins=True):
|
||||||
obj=scene.objects['Rover']
|
obj=scene.objects['Rover']
|
||||||
|
|
||||||
# Pas de mouvement si colision ou objectif
|
# Pas de mouvement si colision ou objectif
|
||||||
@ -213,7 +214,7 @@ def rp_avancer ():
|
|||||||
if debug_mvt:
|
if debug_mvt:
|
||||||
print ("rp_avancer()")
|
print ("rp_avancer()")
|
||||||
scene.objects['Points']['step'] +=1
|
scene.objects['Points']['step'] +=1
|
||||||
if scene.objects['Commands']['twins']:
|
if scene.objects['Commands']['twins'] and twins:
|
||||||
serial_msg = "AV\n"
|
serial_msg = "AV\n"
|
||||||
twins_serial.write(serial_msg.encode()) # Communication série : modele 3d -> carte communication ( arduino | micro:bit )
|
twins_serial.write(serial_msg.encode()) # Communication série : modele 3d -> carte communication ( arduino | micro:bit )
|
||||||
|
|
||||||
@ -292,9 +293,10 @@ def rp_avancer ():
|
|||||||
|
|
||||||
##
|
##
|
||||||
# Reculer le rover
|
# Reculer le rover
|
||||||
|
# - twins (True|False) : envoi un ordre au jumeau réel
|
||||||
##
|
##
|
||||||
|
|
||||||
def rp_reculer ():
|
def rp_reculer (twins=True):
|
||||||
obj=scene.objects['Rover']
|
obj=scene.objects['Rover']
|
||||||
|
|
||||||
# Pas de mouvement si colision ou objectif
|
# Pas de mouvement si colision ou objectif
|
||||||
@ -335,7 +337,7 @@ def rp_reculer ():
|
|||||||
if (debug_mvt):
|
if (debug_mvt):
|
||||||
print ("rp_reculer()")
|
print ("rp_reculer()")
|
||||||
scene.objects['Points']['step'] +=1
|
scene.objects['Points']['step'] +=1
|
||||||
if scene.objects['Commands']['twins']:
|
if scene.objects['Commands']['twins'] and twins:
|
||||||
serial_msg = "RE\n"
|
serial_msg = "RE\n"
|
||||||
twins_serial.write(serial_msg.encode()) # Communication série : modele 3d -> carte communication ( arduino | micro:bit )
|
twins_serial.write(serial_msg.encode()) # Communication série : modele 3d -> carte communication ( arduino | micro:bit )
|
||||||
|
|
||||||
@ -391,9 +393,10 @@ def rp_reculer ():
|
|||||||
|
|
||||||
##
|
##
|
||||||
# Tourner à gauche
|
# Tourner à gauche
|
||||||
|
# - twins (True|False) : envoi un ordre au jumeau réel
|
||||||
##
|
##
|
||||||
|
|
||||||
def rp_gauche ():
|
def rp_gauche (twins=True):
|
||||||
obj=scene.objects['Rover']
|
obj=scene.objects['Rover']
|
||||||
|
|
||||||
# Pas de mouvement si colision ou objectif
|
# Pas de mouvement si colision ou objectif
|
||||||
@ -405,7 +408,7 @@ def rp_gauche ():
|
|||||||
print ("rp_gauche()")
|
print ("rp_gauche()")
|
||||||
scene.objects['Points']['step'] +=1
|
scene.objects['Points']['step'] +=1
|
||||||
step=math.pi/2 # Pas angulaire
|
step=math.pi/2 # Pas angulaire
|
||||||
if scene.objects['Commands']['twins']:
|
if scene.objects['Commands']['twins'] and twins:
|
||||||
serial_msg = "GA\n"
|
serial_msg = "GA\n"
|
||||||
twins_serial.write(serial_msg.encode()) # Communication série : modele 3d -> carte communication ( arduino | micro:bit )
|
twins_serial.write(serial_msg.encode()) # Communication série : modele 3d -> carte communication ( arduino | micro:bit )
|
||||||
|
|
||||||
@ -441,9 +444,10 @@ def rp_gauche ():
|
|||||||
|
|
||||||
##
|
##
|
||||||
# Tourner à droite
|
# Tourner à droite
|
||||||
|
# - twins (True|False) : envoi un ordre au jumeau réel
|
||||||
##
|
##
|
||||||
|
|
||||||
def rp_droite ():
|
def rp_droite (twins=True):
|
||||||
obj=scene.objects['Rover']
|
obj=scene.objects['Rover']
|
||||||
|
|
||||||
# Pas de mouvement si colision ou objectif
|
# Pas de mouvement si colision ou objectif
|
||||||
@ -455,7 +459,7 @@ def rp_droite ():
|
|||||||
print ("rp_droite()")
|
print ("rp_droite()")
|
||||||
scene.objects['Points']['step'] +=1
|
scene.objects['Points']['step'] +=1
|
||||||
step=math.pi/2 # Pas angulaire
|
step=math.pi/2 # Pas angulaire
|
||||||
if scene.objects['Commands']['twins']:
|
if scene.objects['Commands']['twins'] and twins:
|
||||||
serial_msg = "DR\n"
|
serial_msg = "DR\n"
|
||||||
twins_serial.write(serial_msg.encode()) # Communication série : modele 3d -> carte communication ( arduino | micro:bit )
|
twins_serial.write(serial_msg.encode()) # Communication série : modele 3d -> carte communication ( arduino | micro:bit )
|
||||||
|
|
||||||
@ -491,9 +495,10 @@ def rp_droite ():
|
|||||||
|
|
||||||
##
|
##
|
||||||
# Marquer
|
# Marquer
|
||||||
|
# - twins (True|False) : envoi un ordre au jumeau réel
|
||||||
##
|
##
|
||||||
|
|
||||||
def rp_marquer ():
|
def rp_marquer (twins=True):
|
||||||
obj=scene.objects['Rover']
|
obj=scene.objects['Rover']
|
||||||
|
|
||||||
# Pas de mouvement si colision ou objectif
|
# Pas de mouvement si colision ou objectif
|
||||||
@ -512,7 +517,7 @@ def rp_marquer ():
|
|||||||
# Points, console et jumeau numérique
|
# Points, console et jumeau numérique
|
||||||
if (debug_mvt):
|
if (debug_mvt):
|
||||||
print ("rp_marquer() -> balise #"+ str(len(scene.objects['Terrain']['map_tile_beacon'])))
|
print ("rp_marquer() -> balise #"+ str(len(scene.objects['Terrain']['map_tile_beacon'])))
|
||||||
if scene.objects['Commands']['twins']:
|
if scene.objects['Commands']['twins'] and twins:
|
||||||
serial_msg = "MA\n"
|
serial_msg = "MA\n"
|
||||||
twins_serial.write(serial_msg.encode()) # Communication série : modele 3d -> carte communication ( arduino | micro:bit )
|
twins_serial.write(serial_msg.encode()) # Communication série : modele 3d -> carte communication ( arduino | micro:bit )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user