diff --git a/kuukar.service b/kuukar.service deleted file mode 100644 index b565255..0000000 --- a/kuukar.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -After=network.target -Description=KuuKar Primary Application - -[Service] -Type=idle -User=pi -ExecStart=/usr/bin/python3 /home/pi/kuukar-rpi/app.py - -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/kuukar/kuukar_lcd.py b/kuukar/kuukar_lcd.py index 7af9ab1..bed2bd1 100644 --- a/kuukar/kuukar_lcd.py +++ b/kuukar/kuukar_lcd.py @@ -38,10 +38,8 @@ class lcd: if page == 1 and component_id == 2 and press_type == '01': if self.nextion.get_attribute("aiTG.val"): print("AI Drive Activated") - self.motion.roam_start() else: print("AI Drive Deactivated") - self.motion.roam_stop() elif page == 3: if component_id == 2 and press_type == '00': x = self.nextion.get_attribute("joystick.x") @@ -49,8 +47,7 @@ class lcd: speed = 100 - (y - 60) / (205 - 60) * 200 turn = (x - 5) / (150 - 5) * 200 - 100 print(f"Setting speed to {speed} and turn angle to {turn}") - if not self.motion.is_roaming(): - self.motion.drive_skew(speed,turn) + def _sensor_screen_updator(self): while True: self.nextion.send_command( @@ -60,5 +57,5 @@ class lcd: self.nextion.send_command( f"brightnessTXT.txt=\"{self.sensors.get_brightness_pct()}\"") self.nextion.send_command( - f"sonarTXT.txt=\"{int(self.sensors.sonar_get_distance(2))} / {int(self.sensors.sonar_get_distance(1))} / {int(self.sensors.sonar_get_distance(0))}\"") + f"sonarTXT.txt=\"{int(self.sensors.sonar_get_distance(0))} / {int(self.sensors.sonar_get_distance(1))} / {int(self.sensors.sonar_get_distance(2))}\"") sleep(1) diff --git a/kuukar/kuukar_leds.py b/kuukar/kuukar_leds.py index e819a12..931dfe2 100644 --- a/kuukar/kuukar_leds.py +++ b/kuukar/kuukar_leds.py @@ -18,11 +18,9 @@ class leds: def __init__(self, mcu: telemetrix_rpi_pico.TelemetrixRpiPico) -> None: self.mcu = mcu self.mcu.set_pin_mode_neopixel(LEDS_DATA_PIN, LEDS_NUM) - self.ambient_light = [5, 5, 25] #Keke Image Color - self.__update_leds() def set_headlights(self, state: bool): - self.headlight = state + headlight = True self.__update_leds() def set_left_signal_led(self, state: bool): @@ -42,12 +40,11 @@ class leds: self.__update_leds() def __update_leds(self): - self.mcu.neopixel_fill( - r=self.ambient_light[0], g=self.ambient_light[1], b=self.ambient_light[2]) + self.mcu.neopixel_fill(r=self.ambient_light[0], g=self.ambient_light[1], b=self.ambient_light[2]) if self.headlight: for led in HEADLIGHT_LEDS: self.mcu.neo_pixel_set_value(led, self.headlight * 255, self.headlight * 255, - self.headlight * 255) + self.headlight * 255) if self.left_signal: for led in LEFT_SIGNAL_LEDS: self.mcu.neo_pixel_set_value(led, 255, 0, 0) diff --git a/kuukar/kuukar_motion.py b/kuukar/kuukar_motion.py index 6af9846..376c529 100644 --- a/kuukar/kuukar_motion.py +++ b/kuukar/kuukar_motion.py @@ -60,28 +60,6 @@ class motion: self.motor_write(MOTOR_RL_F, MOTOR_RL_R, speed) self.motor_write(MOTOR_RR_F, MOTOR_RR_R, -speed) - def drive_skew(self, speed: float, dir: float): - if dir > 0: - self.leds.set_right_signal_led(True) - elif dir < 0: - self.leds.set_left_signal_led(True) - - lm_speed = (100+dir/2)*speed/100 - if lm_speed>99: - lm_speed = 99 - elif lm_speed<-99: - lm_speed = -99 - rm_speed = (100-dir/2)*speed/100 - if rm_speed > 99: - rm_speed = 99 - elif rm_speed < -99: - rm_speed = -99; - - self.motor_write(MOTOR_FL_F, MOTOR_FL_R, lm_speed) - self.motor_write(MOTOR_FR_F, MOTOR_FR_R, rm_speed) - self.motor_write(MOTOR_RL_F, MOTOR_RL_R, lm_speed) - self.motor_write(MOTOR_RR_F, MOTOR_RR_R, rm_speed) - def stop(self): self.leds.set_left_signal_led(False) self.leds.set_right_signal_led(False) @@ -94,9 +72,6 @@ class motion: def roam_stop(self): self.roaming = False - def is_roaming(self) -> bool: - return self.roaming - def __roam_looper(self): while True: if self.roaming: diff --git a/rpi_install.sh b/rpi_install.sh deleted file mode 100644 index 55e45f6..0000000 --- a/rpi_install.sh +++ /dev/null @@ -1,6 +0,0 @@ -sudo apt update -sudo apt install python3 python3-pip -pip3 install -r ./requirements.txt -ln -s ./kuukar.service /etc/systemd/system/kuukar.service -sudo systemctl kuukar enable -sudo systemctl kuukar start \ No newline at end of file diff --git a/rpi_update.sh b/rpi_update.sh deleted file mode 100644 index 1f9ff7d..0000000 --- a/rpi_update.sh +++ /dev/null @@ -1,4 +0,0 @@ -git stash -git pull -cp -fv ../kuukar_config.py ./kuukar/kuukar_config.py -service kuukar restart \ No newline at end of file