""" 
CAR CONFIG 

This file is read by your car application's manage.py script to change the car
performance. 

EXMAPLE
-----------
import dk
cfg = dk.load_config(config_path='~/d2/config.py')
print(cfg.CAMERA_RESOLUTION)

"""


import os

#PATHS
CAR_PATH = PACKAGE_PATH = os.path.dirname(os.path.realpath(__file__))
DATA_PATH = "/var/donkeycar"
MODELS_PATH = os.path.join(CAR_PATH, 'models')

#VEHICLE
DRIVE_LOOP_HZ = 20
MAX_LOOPS = 100000

#CAMERA
CAMERA_RESOLUTION = (120, 160) #(height, width)
#CAMERA_RESOLUTION = (120, 160) #(height, width)
CAMERA_FRAMERATE = DRIVE_LOOP_HZ

#STEERING
STEERING_CHANNEL = 1
STEERING_LEFT_PWM = 240
# middle 400
STEERING_RIGHT_PWM = 560

#THROTTLE
THROTTLE_CHANNEL = 0
THROTTLE_FORWARD_PWM = 440
THROTTLE_STOPPED_PWM = 360
THROTTLE_REVERSE_PWM = 310

#TRAINING
BATCH_SIZE = 128
TRAIN_TEST_SPLIT = 0.8

#RCController
RCCONTROLLER_FORWARD_THROTTLE = 100
RCCONTROLLER_STOPPED_THROTTLE = 0
RCCONTROLLER_CENTER_THROTTLE_TOLERANCE_RANGE = 3
RCCONTROLLER_REVERSE_THROTTLE = -100

RCCONTROLLER_LEFT_STEERING = -93
RCCONTROLLER_CENTER_STEERING = 0
RCCONTROLLER_CENTER_STEERING_TOLERANCE_RANGE = 3
RCCONTROLLER_RIGHT_STEERING = 110

#JOYSTICK
USE_JOYSTICK_AS_DEFAULT = False
JOYSTICK_MAX_THROTTLE = 0.5
JOYSTICK_STEERING_SCALE = 1.0
AUTO_RECORD_ON_THROTTLE = True
