Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #84 from jimcadden/patch_3-29
Browse files Browse the repository at this point in the history
Update config for Rpi & virtual twin
  • Loading branch information
MichaelClifford authored Mar 29, 2022
2 parents 156a84d + e1a6bc1 commit 18dd137
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 36 deletions.
64 changes: 34 additions & 30 deletions apps/donkeycars/default_car/myconfig.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
# """
# My CAR CONFIG

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

# If desired, all config overrides can be specified here.
# The update operation will not touch this file.
# """
# import os

import os

#
# #PATHS
# CAR_PATH = PACKAGE_PATH = os.path.dirname(os.path.realpath(__file__))
# DATA_PATH = os.path.join(CAR_PATH, 'data')
# MODELS_PATH = os.path.join(CAR_PATH, 'models')
CAR_PATH = PACKAGE_PATH = os.path.dirname(os.path.realpath(__file__))
DATA_PATH = os.path.join(CAR_PATH, "data")
MODELS_PATH = os.path.join(CAR_PATH, "models")
#
# #VEHICLE
# DRIVE_LOOP_HZ = 20 # the vehicle loop will pause if faster than this speed.
# MAX_LOOPS = None # the vehicle loop can abort after this many iterations, when given a positive integer.
#
# #CAMERA
# CAMERA_TYPE = "PICAM" # (PICAM|WEBCAM|CVCAM|CSIC|V4L|D435|MOCK|IMAGE_LIST)
# IMAGE_W = 160
# IMAGE_H = 128
# IMAGE_DEPTH = 3 # default RGB=3, make 1 for mono
IMAGE_W = 160
IMAGE_H = 120
IMAGE_DEPTH = 3 # default RGB=3, make 1 for mono
# CAMERA_FRAMERATE = DRIVE_LOOP_HZ
CAMERA_VFLIP = True
CAMERA_HFLIP = True
# CAMERA_VFLIP = False
# CAMERA_HFLIP = False
# # For CSIC camera - If the camera is mounted in a rotated position, changing the below parameter will correct the output frame orientation
# CSIC_CAM_GSTREAMER_FLIP_PARM = 0 # (0 => none , 4 => Flip horizontally, 6 => Flip vertically)
#
Expand All @@ -47,20 +51,20 @@
# DRIVE_TRAIN_TYPE = "SERVO_ESC" # SERVO_ESC|DC_STEER_THROTTLE|DC_TWO_WHEEL|DC_TWO_WHEEL_L298N|SERVO_HBRIDGE_PWM|PIGPIO_PWM|MM1|MOCK
#
# #STEERING
STEERING_CHANNEL = 0 # channel on the 9685 pwm board 0-15
STEERING_LEFT_PWM = 525 # pwm value for full left steering
STEERING_RIGHT_PWM = 225 # pwm value for full right steering
# STEERING_CHANNEL = 1 #channel on the 9685 pwm board 0-15
# STEERING_LEFT_PWM = 460 #pwm value for full left steering
# STEERING_RIGHT_PWM = 290 #pwm value for full right steering
#
# #STEERING FOR PIGPIO_PWM
# STEERING_PWM_PIN = 13 #Pin numbering according to Broadcom numbers
# STEERING_PWM_FREQ = 50 #Frequency for PWM
# STEERING_PWM_INVERTED = False #If PWM needs to be inverted
#
# #THROTTLE
THROTTLE_CHANNEL = 1 # channel on the 9685 pwm board 0-15
THROTTLE_FORWARD_PWM = 400 # pwm value for max forward throttle
THROTTLE_STOPPED_PWM = 370 # pwm value for no movement
THROTTLE_REVERSE_PWM = 325 # pwm value for max reverse throttle
# THROTTLE_CHANNEL = 0 #channel on the 9685 pwm board 0-15
# THROTTLE_FORWARD_PWM = 500 #pwm value for max forward throttle
# THROTTLE_STOPPED_PWM = 370 #pwm value for no movement
# THROTTLE_REVERSE_PWM = 220 #pwm value for max reverse throttle
#
# #THROTTLE FOR PIGPIO_PWM
# THROTTLE_PWM_PIN = 18 #Pin numbering according to Broadcom numbers
Expand Down Expand Up @@ -122,16 +126,16 @@
# #line parameter --type to the python manage.py train and drive commands.
# # tensorflow models: (linear|categorical|tflite_linear|tensorrt_linear)
# # pytorch models: (resnet18)
DEFAULT_MODEL_TYPE = "categorical"
# DEFAULT_MODEL_TYPE = 'linear'
# BATCH_SIZE = 128 #how many records to use when doing one pass of gradient decent. Use a smaller number if your gpu is running out of memory.
# TRAIN_TEST_SPLIT = 0.8 #what percent of records to use for training. the remaining used for validation.
# MAX_EPOCHS = 100 #how many times to visit all records of your data
MAX_EPOCHS = 3 # how many times to visit all records of your data
# SHOW_PLOT = True #would you like to see a pop up display of final loss?
# VERBOSE_TRAIN = True #would you like to see a progress bar with text during training?
# USE_EARLY_STOP = True #would you like to stop the training if we see it's not improving fit?
# EARLY_STOP_PATIENCE = 5 #how many epochs to wait before no improvement
# MIN_DELTA = .0005 #early stop will want this much loss change before calling it improved.
# PRINT_MODEL_SUMMARY = True #print layers and weights to stdout
PRINT_MODEL_SUMMARY = True # print layers and weights to stdout
# OPTIMIZER = None #adam, sgd, rmsprop, etc.. None accepts default
# LEARNING_RATE = 0.001 #only used when OPTIMIZER specified
# LEARNING_RATE_DECAY = 0.0 #only used when OPTIMIZER specified
Expand Down Expand Up @@ -159,11 +163,11 @@
#
# #WEB CONTROL
# WEB_CONTROL_PORT = int(os.getenv("WEB_CONTROL_PORT", 8887)) # which port to listen on when making a web controller
# WEB_INIT_MODE = "local" # which control mode to start in. one of user|local_angle|local. Setting local will start in ai mode.
WEB_INIT_MODE = "local"
#
# #JOYSTICK
# USE_JOYSTICK_AS_DEFAULT = False #when starting the manage.py, when True, will not require a --js option to use the joystick
JOYSTICK_MAX_THROTTLE = 1.0 # this scalar is multiplied with the -1 to 1 throttle value to limit the maximum throttle. This can help if you drop the controller or just don't need the full speed available.
# JOYSTICK_MAX_THROTTLE = 0.5 #this scalar is multiplied with the -1 to 1 throttle value to limit the maximum throttle. This can help if you drop the controller or just don't need the full speed available.
# JOYSTICK_STEERING_SCALE = 1.0 #some people want a steering that is less sensitve. This scalar is multiplied with the steering -1 to 1. It can be negative to reverse dir.
# AUTO_RECORD_ON_THROTTLE = True #if true, we will record whenever throttle is not zero. if false, you must manually toggle recording with some other trigger. Usually circle button on joystick.
# CONTROLLER_TYPE = 'xbox' #(ps3|ps4|xbox|nimbus|wiiu|F710|rc3|MM1|custom) custom will run the my_joystick.py controller written by the `donkey createjs` command
Expand Down Expand Up @@ -230,9 +234,7 @@
#
# #RECORD OPTIONS
# RECORD_DURING_AI = False #normally we do not record during ai mode. Set this to true to get image and steering records for your Ai. Be careful not to use them to train.
AUTO_CREATE_NEW_TUB = (
True # create a new tub (tub_YY_MM_DD) directory when recording or append records to data directory directly
)
# AUTO_CREATE_NEW_TUB = False #create a new tub (tub_YY_MM_DD) directory when recording or append records to data directory directly
#
# #LED
# HAVE_RGB_LED = False #do you have an RGB LED like https://www.amazon.com/dp/B07BNRZWNF
Expand Down Expand Up @@ -291,15 +293,17 @@
# #This enables that, and sets the path to the simualator and the environment.
# #You will want to download the simulator binary from: https://github.com/tawnkramer/donkey_gym/releases/download/v18.9/DonkeySimLinux.zip
# #then extract that and modify DONKEY_SIM_PATH.
# DONKEY_GYM = False
# DONKEY_SIM_PATH = "path to sim" #"/home/tkramer/projects/sdsandbox/sdsim/build/DonkeySimLinux/donkey_sim.x86_64" when racing on virtual-race-league use "remote", or user "remote" when you want to start the sim manually first.
# DONKEY_GYM_ENV_NAME = "donkey-generated-track-v0" # ("donkey-generated-track-v0"|"donkey-generated-roads-v0"|"donkey-warehouse-v0"|"donkey-avc-sparkfun-v0")
# GYM_CONF = { "body_style" : "donkey", "body_rgb" : (128, 128, 128), "car_name" : "car", "font_size" : 100} # body style(donkey|bare|car01) body rgb 0-255
DONKEY_GYM = True
DONKEY_SIM_PATH = "remote" # "/home/tkramer/projects/sdsandbox/sdsim/build/DonkeySimLinux/donkey_sim.x86_64" when racing on virtual-race-league use "remote", or user "remote" when you want to start the sim manually first.
DONKEY_GYM_ENV_NAME = "donkey-generated-track-v0" # ("donkey-generated-track-v0"|"donkey-generated-roads-v0"|"donkey-warehouse-v0"|"donkey-avc-sparkfun-v0")
GYM_CONF = {"body_style": "donkey", "font_size": 20} # body style(donkey|bare|car01) body rgb 0-255
GYM_CONF["car_name"] = "v-twin"
GYM_CONF["body_rgb"] = (255, 0, 0)
# GYM_CONF["racer_name"] = "Your Name"
# GYM_CONF["country"] = "Place"
# GYM_CONF["bio"] = "I race robots."
#
# SIM_HOST = "127.0.0.1" # when racing on virtual-race-league use host "trainmydonkey.com"
SIM_HOST = "ec2-54-158-84-85.compute-1.amazonaws.com"
# SIM_ARTIFICIAL_LATENCY = 0 # this is the millisecond latency in controls. Can use useful in emulating the delay when useing a remote server. values of 100 to 400 probably reasonable.
#
# # Save info from Simulator (pln)
Expand All @@ -318,7 +322,7 @@
# AI_LAUNCH_KEEP_ENABLED = False # when False ( default) you will need to hit the AI_LAUNCH_ENABLE_BUTTON for each use. This is safest. When this True, is active on each trip into "local" ai mode.
#
# #Scale the output of the throttle of the ai pilot for all model types.
AI_THROTTLE_MULT = 1.65 # this multiplier will scale every throttle value for all output from NN models
AI_THROTTLE_MULT = 1.5 # this multiplier will scale every throttle value for all output from NN models
#
# #Path following
# PATH_FILENAME = "donkey_path.pkl" # the path will be saved to this filename
Expand Down
9 changes: 3 additions & 6 deletions apps/donkeycars/default_car/rpi-myconfig.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# """
# My CAR CONFIG

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

# If desired, all config overrides can be specified here.
# The update operation will not touch this file.
# """

# import os
#
# #PATHS
Expand All @@ -26,7 +23,7 @@
# IMAGE_DEPTH = 3 # default RGB=3, make 1 for mono
# CAMERA_FRAMERATE = DRIVE_LOOP_HZ
CAMERA_VFLIP = True
# CAMERA_HFLIP = True
CAMERA_HFLIP = True
# # For CSIC camera - If the camera is mounted in a rotated position, changing the below parameter will correct the output frame orientation
# CSIC_CAM_GSTREAMER_FLIP_PARM = 0 # (0 => none , 4 => Flip horizontally, 6 => Flip vertically)
#
Expand Down Expand Up @@ -125,7 +122,7 @@
# #line parameter --type to the python manage.py train and drive commands.
# # tensorflow models: (linear|categorical|tflite_linear|tensorrt_linear)
# # pytorch models: (resnet18)
# DEFAULT_MODEL_TYPE = 'linear'
DEFAULT_MODEL_TYPE = "categorical"
# BATCH_SIZE = 128 #how many records to use when doing one pass of gradient decent. Use a smaller number if your gpu is running out of memory.
# TRAIN_TEST_SPLIT = 0.8 #what percent of records to use for training. the remaining used for validation.
# MAX_EPOCHS = 100 #how many times to visit all records of your data
Expand Down Expand Up @@ -321,7 +318,7 @@
# AI_LAUNCH_KEEP_ENABLED = False # when False ( default) you will need to hit the AI_LAUNCH_ENABLE_BUTTON for each use. This is safest. When this True, is active on each trip into "local" ai mode.
#
# #Scale the output of the throttle of the ai pilot for all model types.
AI_THROTTLE_MULT = 0.85 # this multiplier will scale every throttle value for all output from NN models
AI_THROTTLE_MULT = 1.65 # this multiplier will scale every throttle value for all output from NN models
#
# #Path following
# PATH_FILENAME = "donkey_path.pkl" # the path will be saved to this filename
Expand Down

0 comments on commit 18dd137

Please sign in to comment.