Code Monkey home page Code Monkey logo

autonomous-rc-car's People

Contributors

vignesh1115 avatar vimalvnair avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autonomous-rc-car's Issues

I'm getting runtime error overflow for power

hello sir I'm getting runtime error return 1.0/(1.0 + power(e, -x_value))) overflow with power. I have changed different lamda values but of no use and also i have decreased the size of the resolution.
Can you please help me sir....!!

ImportError: No module named 'scipy'

I am facing this issue :

Traceback (most recent call last):
File "train.py", line 11, in
from scipy.optimize import fmin_l_bfgs_b
ImportError: No module named 'scipy'

ERROR PLEASE HELP

Traceback (most recent call last):
File "/home/pi/interactive_control_train.py", line 6, in
import configuration
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 305, in _custom_import
module = self._original_import(*args, **kw)
ImportError: No module named 'configuration'

Trainingdata

hi, i'm learning this project,and i want to get the training data in this program, because it's too waste time to collect training data with manually operate the car, so do you mind to give your training data or upload the training data?

UnicodeDecodeError while running autonomous.py

I am facing UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 9: ordinal not in range(128) error, I have placed the traned module from this same repo in optimized teta folder

Traceback (most recent call last):
File "autonomous.py", line 92, in
main()
File "autonomous.py", line 89, in main
autonomous_control(model)
File "autonomous.py", line 14, in autonomous_control
predictor = Predictor(model)
File "/home/pi/Desktop/rcar/predict.py", line 23, in init
self._open_model_file(model_file)
File "/home/pi/Desktop/rcar/predict.py", line 27, in _open_model_file
self.model = pickle.load(mod)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 9: ordinal not in range(128)

Some Questions in Autonomous.py file

Hi @vaidy @manishrc i am little confused because i see some lines of codes cycle_count... what is the purpose adding this lines in each directions operations!

kindly 👍
while True:
stream = io.BytesIO()
camera.capture(stream, format='jpeg', use_video_port=True)
direction = predictor.predict(stream)
image_helper.save_image_with_direction(stream, direction)
stream.flush()
if direction == 'forward':
should_brake = True
left_cycle_count = right_cycle_count = 0
forward_cycle_count = reduce_speed(pwm, forward_cycle_count)
motor_driver_helper.set_front_motor_to_idle()
motor_driver_helper.set_forward_mode()
elif direction == 'left':
should_brake = True
forward_cycle_count = right_cycle_count = 0
left_cycle_count = increase_speed_on_turn(pwm, left_cycle_count)
motor_driver_helper.set_left_mode()
motor_driver_helper.set_forward_mode()
elif direction == 'right':
should_brake = True
forward_cycle_count = left_cycle_count = 0
right_cycle_count = increase_speed_on_turn(pwm, right_cycle_count)
motor_driver_helper.set_right_mode()
motor_driver_helper.set_forward_mode()
elif direction == 'reverse':
should_brake = True
motor_driver_helper.set_front_motor_to_idle()
motor_driver_helper.set_reverse_mode()
else:
if should_brake:
print("braking...")
motor_driver_helper.set_reverse_mode()
time.sleep(0.2)
should_brake = False
motor_driver_helper.set_idle_mode()
forward_cycle_count = left_cycle_count = right_cycle_count = 0
motor_driver_helper.change_pwm_duty_cycle(pwm, 100)
print(direction)

ValueError("'arr' does not have a suitable array shape for any mode.") ERROR

We are getting the following error while executing autonomous.py in RPi 3 Model B v1.2

Traceback (most recent call last):
File "autonomous.py", line 92, in
main()
File "autonomous.py", line 89, in main
autonomous_control(model)
File "autonomous.py", line 27, in autonomous_control
direction = predictor.predict(stream)
File "/home/pi/test/mu/multunus/predict.py", line 33, in predict
input_layer_size, number_of_labels, x_value = _convert_stream_to_array(stream)
File "/home/pi/test/mu/multunus/predict.py", line 58, in _convert_stream_to_array
resized_image_array = imresize(image_array, IMAGE_DIMENSIONS)
File "/usr/lib/python3/dist-packages/scipy/misc/pilutil.py", line 421, in imresize
im = toimage(arr, mode=mode)
File "/usr/lib/python3/dist-packages/scipy/misc/pilutil.py", line 238, in toimage
raise ValueError("'arr' does not have a suitable array shape for any mode.")
ValueError: 'arr' does not have a suitable array shape for any mode.

What could the mistake from our side???

Issue in training data set and trained model

I pasted the images u gave from dataset i.e https://s3.amazonaws.com/multunus-machine-learning/autonomous-rc-car-data-set.tar.gz .....but its giving error
-----------------------------start----------------------------------------------------------------
Loading images to array...
/home/pi/Desktop/auto1/sigmoid.py:7: RuntimeWarning: overflow encountered in power
return 1.0/(1.0 + power(e, -x_value))
^CTraceback (most recent call last):
File "train.py", line 116, in
main()
File "train.py", line 109, in main
function_parameters)
File "train.py", line 72, in minimize_cost_function
fprime=gradients_wrapper, args=[function_parameters])
File "/usr/lib/python2.7/dist-packages/scipy/optimize/lbfgsb.py", line 186, in fmin_l_bfgs_b
**opts)
File "/usr/lib/python2.7/dist-packages/scipy/optimize/lbfgsb.py", line 314, in minimize_lbfgsb
f, g = func_and_grad(x)
File "/usr/lib/python2.7/dist-packages/scipy/optimize/lbfgsb.py", line 266, in func_and_grad
g = jac(x, *args)
File "train.py", line 37, in gradients_wrapper
return gradients(gradient_parameters)
File "/home/pi/Desktop/auto1/cost_function.py", line 59, in gradients
hidden_layer_input = numpy.c
[numpy.ones(input_examples_size), x_values].dot(theta_1.T)
File "/usr/lib/python2.7/dist-packages/numpy/lib/index_tricks.py", line 326, in getitem
res = _nx.concatenate(tuple(objs), axis=self.axis)
-----------------------------------------------end-----------------------------------------

Then i got your trained model from https://s3.amazonaws.com/multunus-machine-learning/model_2016-07-20_19-38-07_l0.05_h114.pkl. and then executed it but it still gives error
note: i renamed the downloaded .pkl file as model.pkl
-----------------------------------start----------------------------------------------------
./optimized_thetas/model.pkl

Traceback (most recent call last):
File "autonomous.py", line 92, in
main()
File "autonomous.py", line 89, in main
autonomous_control(model)
File "autonomous.py", line 14, in autonomous_control
predictor = Predictor(model)
File "/home/pi/Desktop/auto1/predict.py", line 23, in init
self._open_model_file(model_file)
File "/home/pi/Desktop/auto1/predict.py", line 28, in _open_model_file
self.thetas = self.model['optimized_theta']
KeyError: 'optimized_theta'
----------------------------------------end----------------------------------------------------
need help in it pls ASAP

camera no video

when python interactive_control_train.py,there's no video from camera ,but images can generate into the folder ,what's wrong?

issue after training data model

I have trained model with following inputs
python train.py 0.1 60
python train.py 0.5 114
python train.py 0.5 90
but car remains idle it doesn't move forward, left, right it just stays idle.....
I'm doing something wrong?
you can download file here

Optimized_thetas Issue

Why getting this error?
FileNotFoundError: No such File or Directory: Optimized_thetas/model_2017-06-3_21-08-44_10.0_h50.pkl

wheel constantly moving backward

whenever I run interactive_control_train.py wheels start moving in backward direction. all other controls works fine but wheels keep moving backward and stops when i press forward button and again start moving when i release forward button

Image for training and prediction have different size?

in predict.py, image stream is cropped before prediction.

def _convert_stream_to_array(stream):
    ...
    image = image.crop((0, PICAMERA_RESOLUTION_HEIGHT / 2, PICAMERA_RESOLUTION_WIDTH, PICAMERA_RESOLUTION_HEIGHT))
    ...

but in train.py, it not do the same step in load_images_to_array, is this a bug?

Plan to add new features

We are implementing the same project, there is another repo here. As that repo uses the HAAR cascade method to detect traffic signals and stops signs but the issue is that repo uses the client-server method which sacrifices the framerate of cam stream and other processing resources . We needed your help to modify the code and add features of detect sign boards and other stuff.

train.py compilation error

Im having an issue when execute the command of "train.py".I have done every procedure accordingly . The error is given below . Please Help ASAP
python version used : python 2.7

pi@AutoCar:~/autonomous-rc-car-master $ python train.py 0.1 60 Loading images to array... Traceback (most recent call last): File "train.py", line 114, in <module> main() File "train.py", line 107, in main (optimized_theta, function_min_value, info_dict) = minimize_cost_function(initial_theta,function_parameters) File "train.py", line 72, in minimize_cost_function fprime=gradients_wrapper, args=[function_parameters]) File "/usr/lib/python2.7/dist-packages/scipy/optimize/lbfgsb.py", line 186, in fmin_l_bfgs_b **opts) File "/usr/lib/python2.7/dist-packages/scipy/optimize/lbfgsb.py", line 314, in _minimize_lbfgsb f, g = func_and_grad(x) File "/usr/lib/python2.7/dist-packages/scipy/optimize/lbfgsb.py", line 265, in func_and_grad f = fun(x, *args) File "/usr/lib/python2.7/dist-packages/scipy/optimize/optimize.py", line 281, in function_wrapper return function(*(wrapper_args + args)) File "train.py", line 32, in cost_function_wrapper return cost_function(cost_function_parameters) File "/home/pi/autonomous-rc-car-master/cost_function.py", line 35, in cost_function regularization_term = (lambda_value/(2.0 * input_examples_size)) * numpy.sum(numpy.power(combined_thetas, 2)) ZeroDivisionError: float division by zero

autonomous.py issue

while running the autonomous.py script it gives an error " UnicodeDecodeError: 'ascii' codec cant decode byte 0x89 in position 9: ordinal not in range(128)?

Thanks in advance.

PyGame is not Working

Why PyGame is not working in my Raspberry PI!?
` while True:
for event in pygame.event.get():
if event.type in {pygame.K_q, pygame.K_ESCAPE}:
print "Bye"
elif event.type in {pygame.KEYDOWN, pygame.KEYUP}:
print "Key pressed"
if event.type == pygame.KEYUP:

                print "UP"`

This is my Sample Code ! Actually it shows in terminal just random texts rather than UP
Thanks in Advance

can't work the motors

in the setup section. The images for training are captured using interactive_control_train.py, the car can't be controlled using the direction arrows..

Getting error in Train.py

Hello,Sir i'm getting error when i run Train.py.
FileNotFoundError:No such File or Directory: Optimized_thetas/model_2017-05-29_21-08-44_10.0_h50.pkl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.