-
Notifications
You must be signed in to change notification settings - Fork 0
Backend #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…rmations (vitesse reelles,vites que voit la camera etc...)
Pour l'instat il n'y a que la recuperation de la vitesse reell vitesse cible
… modif de la classe camera donc en l'etat possible probleme avec les fonctions liées
# Conflicts: # src/HL/Camera.py # uv.lock
…ancement de la voiture
…lidar en temps réel
…lisibilité et plus facile a recupe pour le backend
…t vitesse_demander plus une visualisation de la direction
…voir les ouvrir dans un autre onglet
MatthiasBienvenu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good code quality overall but still I'd like you to fix some stuff
src/HL/actionneur_capteur/Camera.py
Outdated
| self.running = False | ||
| self.controls_car = False | ||
|
|
||
| if ON_START_CAMERA_STREAM: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poorly named constant because it looks like this is a hook or something
| while self.send_running: | ||
| try : | ||
| data = struct.pack('<ff', float(round(self.serveur.programme[self.serveur.last_programme_control].vitesse_d)), float(round(self.serveur.programme[self.serveur.last_programme_control].direction_d))) | ||
| data = struct.pack('<ff', float(round(self.serveur.vitesse_d)), float(round(self.serveur.direction_d))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you round but still send a float ? I would assume that if you rounded at least you could send and int ?
| voltage_lipo = float(getattr(ard, "voltage_lipo", 0.0) or 0.0) if ard else 0.0 | ||
| voltage_nimh = float(getattr(ard, "voltage_nimh", 0.0) or 0.0) if ard else 0.0 | ||
| vitesse_r = float(getattr(ard, "vitesse_r", 0.0) or 0.0) if ard else 0.0 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the "or 0.0" is useless because you put 0.0 in getattr default argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its better i thinks to leave that like that because if somebody change my code or the voltage isnt properly define in the initialisation of the I2C module and give "none" we risk to have a float(none) that will give an typeerror...
|
|
||
| ws.onclose = () => { | ||
| console.warn("Telemetry WS disconnected, retrying..."); | ||
| setTimeout(initTelemetryWS, 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe retry every few seconds when the ws closes to avoid having to reload the page? a little "disconnected" on the ui element could be useful as well
| }; | ||
|
|
||
| ws.onclose = () => { | ||
| console.warn("LIDAR WS disconnected"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe retry every few seconds when the ws closes to avoid having to reload the page? a little "disconnected" on the ui element could be useful as well
Backend de la voiture avec le site pour monitoeer le tout