AutoRCCar icon indicating copy to clipboard operation
AutoRCCar copied to clipboard

Hardwares to use.

Open husyntech opened this issue 6 years ago • 46 comments

Hi, I'd like to try it myself with the same hardwares as you've used. I can't seem to find see anywhere what hardwares are used.

I'm assuming raspberry pi with latest upgraded version would be better option, but would it work with pi 0 w? Also what other components do I need to get started.

husyntech avatar Nov 17 '18 22:11 husyntech

I too would find it helpful to have more information on setting up the hardware. Could this be added to the repo?

edPratt avatar Nov 28 '18 22:11 edPratt

@supaabzz @edPratt Actually raspberry pi just sits on top of the car, there is no wiring between the car and pi. For simplicity, you can even choose not to connect an ultrasonic sensor to the pi. Arduino is connected to the remote controller directly. Since controller may vary, it's hard to say there is a standard way to set up.

For connection diagram/photo, take a look here: Arduino - #61 and #88 Raspberry Pi - #33

hamuchiwa avatar Nov 30 '18 17:11 hamuchiwa

Whether arduino is necessary to capture images or is there any other method to capture image while training. Can anyone also tell the benefits of using arduino

Vishwasnayak avatar Feb 27 '19 10:02 Vishwasnayak

Not really a benefits, if you want to use raspberry pi to control rc car, then you need to add some extra stuff. If you refer how to save an image to file while collecting, you can create a folder named training_images and add the following line to collect_training_data.py after the decoding.

cv2.imwrite('training_images/frame{:>05}.jpg'.format(frame), image)

hamuchiwa avatar Feb 27 '19 20:02 hamuchiwa

Can we capture images through mobile or any such devices instead of using pi camera. One of our faculty member suggested us to capture images in mobile is it possible? Can u please tell about this???

Vishwasnayak avatar Feb 28 '19 01:02 Vishwasnayak

sir can you please tell me the use of using arduino. can we capture images through camera?

On Thu, Feb 28, 2019 at 2:06 AM hamuchiwa [email protected] wrote:

Not really a benefits, if you want to use raspberry pi to control rc car, then you need to add some extra stuff. If you refer how to save an image to file while collecting, you can create a folder named training_images and add the following line to collect_training_data.py after the decoding.

cv2.imwrite('training_images/frame{:>05}.jpg'.format(frame), image)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-468020139, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr59xIRaALp3PJIhczXMVwHGb6miuPks5vRuw9gaJpZM4YnrZ0 .

Vishwasnayak avatar Feb 28 '19 15:02 Vishwasnayak

@Vishwasnayak You can use a usb camera instead of pi camera. Arduino is connected to the remote controller, it has nothing to do with video streaming in this project.

hamuchiwa avatar Feb 28 '19 17:02 hamuchiwa

Thank you sir

On Thu, 28 Feb 2019, 10:55 pm hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak You can use a usb camera instead of pi camera. Arduino is connected to the remote controller, it has nothing to do with video streaming in this project.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-468360932, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr55CUSh2W7UPDvCt7HgI3AcCktiG2ks5vSBD5gaJpZM4YnrZ0 .

Vishwasnayak avatar Mar 01 '19 01:03 Vishwasnayak

Sir is there any necessary to train and test in the same environment or room. My question is if we train(capture images) data in one room and test it in other room, is it possible?? Thank you in advance

On Fri, 1 Mar 2019, 6:29 am Vishwas Nayak, [email protected] wrote:

Thank you sir

On Thu, 28 Feb 2019, 10:55 pm hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak You can use a usb camera instead of pi camera. Arduino is connected to the remote controller, it has nothing to do with video streaming in this project.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-468360932, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr55CUSh2W7UPDvCt7HgI3AcCktiG2ks5vSBD5gaJpZM4YnrZ0 .

Vishwasnayak avatar Mar 11 '19 02:03 Vishwasnayak

@Vishwasnayak Ideally, train on one track and run on another. Train/valid split is included in the model, but it's actually better to do a k-folds cross validation in your case. In that case, make sure to collect a lot of data.

hamuchiwa avatar Mar 11 '19 21:03 hamuchiwa

Thank you sir for your reply. So basically if we train lot of images then its possible to test in any room or environment with the same track? We are training in one room and we are supposed to demonstrate in auditorium, so its possible no sir? Thank you in advance

On Tue, 12 Mar 2019, 2:49 am hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak Ideally, train on one track and run on another. Train/valid split is included in the model, but it's actually better to do a k-folds cross validation in your case. In that case, make sure to collect a lot of data.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-471734201, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr5xuJrptwAgBzvmQmMc-GbhVruMz1ks5vVshagaJpZM4YnrZ0 .

Vishwasnayak avatar Mar 12 '19 00:03 Vishwasnayak

@Vishwasnayak Yes, it's possible. Use more data and a more complex model can help.

hamuchiwa avatar Mar 13 '19 17:03 hamuchiwa

Thank you sir for your reply. To use more complex data are we supposed to change anything in the code?

On Wed, 13 Mar 2019, 11:16 pm hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak Yes, it's possible. Use more data and a more complex model can help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-472532627, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr51bn25m0Gbo4IjzDRRj5MbWE7-W-ks5vWTlzgaJpZM4YnrZ0 .

Vishwasnayak avatar Mar 14 '19 02:03 Vishwasnayak

@Vishwasnayak Yes, add more layers/neurons, or if the neural network model in OpenCV doesn't work for you well, you can try to create a CNN using Tensorflow.

hamuchiwa avatar Mar 14 '19 18:03 hamuchiwa

Thank you sir for your previous reply. Our raspberry pi OS is getting corrupted once in 4 days. Do you have any particular solution for that. I have one more question sir, when we train our car, it goes only in straight track it doesn't take turn. So my question is how many images should we capture to make the car take turn.

On Fri, 15 Mar 2019, 12:00 am hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak Yes, add more layers/neurons, or if the neural network model in OpenCV doesn't work for you well, you can try to create a CNN using Tensorflow.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-473002608, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr53URlhRCNmHEjtvxuy4P7Dxh241-ks5vWpUzgaJpZM4YnrZ0 .

Vishwasnayak avatar Mar 20 '19 08:03 Vishwasnayak

@Vishwasnayak I'm not sure why it's corrupted, maybe try to isolate what's running one by one? Could you also direct future training related questions to #168, and perhaps upload your data? I can do some training with your data, and hope we can figure out where went wrong together.

hamuchiwa avatar Mar 20 '19 14:03 hamuchiwa

Thank you sir for your response. We will send the trained data as soon as possible

On Wed, 20 Mar 2019, 7:37 pm hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak I'm not sure why it's corrupted, maybe try to isolate what's running one by one? Could you also direct future training related questions to #168 https://github.com/hamuchiwa/AutoRCCar/issues/168, and perhaps upload your data? I can do some training with your data, and hope we can figure out where went wrong together.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-474844671, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr5-8Bhzgmr18V-Ptb5vgA2TBu7eUgks5vYkCxgaJpZM4YnrZ0 .

Vishwasnayak avatar Mar 20 '19 14:03 Vishwasnayak

Sir, our car speed is quiet fast. Is it a parameter which affects the edge detection of lane? And we also want to know is there any application or software to read npz file. We are planning to train the car with a distance of lane around 2 meter. So how many times we have to capture the image? Thank you sir in advance.

On Wed, 20 Mar 2019, 7:58 pm Vishwas Nayak, [email protected] wrote:

Thank you sir for your response. We will send the trained data as soon as possible

On Wed, 20 Mar 2019, 7:37 pm hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak I'm not sure why it's corrupted, maybe try to isolate what's running one by one? Could you also direct future training related questions to #168 https://github.com/hamuchiwa/AutoRCCar/issues/168, and perhaps upload your data? I can do some training with your data, and hope we can figure out where went wrong together.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-474844671, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr5-8Bhzgmr18V-Ptb5vgA2TBu7eUgks5vYkCxgaJpZM4YnrZ0 .

Vishwasnayak avatar Mar 22 '19 10:03 Vishwasnayak

@Vishwasnayak If it's too fast, the video streaming couldn't keep up, you need to find a way to slow down the car first before collecting any data. npz fits is created by Numpy, once you start to train the model, it will call load_data function in model.pyto load all npz files. To start collecting images, try to drive on entire track at least two or three times. This video can give you an idea how fast the car runs: https://www.youtube.com/watch?v=KrvvmLEQk8o

hamuchiwa avatar Mar 22 '19 18:03 hamuchiwa

Hi @hamuchiwa ,when I'm trying to read . npy file images after running collect_training_data.py, I'm getting all null images. Can you tell me what must be the problem?

ShwetaLalwani avatar Mar 22 '19 18:03 ShwetaLalwani

@ShwetaLalwani Can you explain a bit more about null image? Are you trying to visualize the data or something else? Images will be reshaped and saved into Numpy array as npz files that will be created in training_data folder.

hamuchiwa avatar Mar 22 '19 18:03 hamuchiwa

@hamuchiwa yes right, I'm trying to open the npz files and look at the images that are captured ... But when I'm opening the images , they are all null (I can't see the path, full image is white). Can you plz help me with this?

ShwetaLalwani avatar Mar 22 '19 18:03 ShwetaLalwani

@ShwetaLalwani Once you loaded data, X_train, X_valid, y_train, y_valid = load_data(input_size, data_path) reshape it back to its original shape, then visualize it.

sample = X_train[0].reshape((120, 320)) # if using whole image, then (240, 320)
plt.imshow(sample, cmap='gray')

hamuchiwa avatar Mar 22 '19 20:03 hamuchiwa

Thank you sir for your previous reply. If there is track with one curve and then straight..then do we need to press the forward key again and again(frame by frame) or continuously can we press the key till there is a straight track?

On Sat, 23 Mar 2019, 1:34 am hamuchiwa, [email protected] wrote:

@ShwetaLalwani https://github.com/ShwetaLalwani Once you loaded data, X_train, X_valid, y_train, y_valid = load_data(input_size, data_path) reshape it back to its original shape, then visualize it.

sample = X_train[0].reshape((120, 320)) # if using whole image, then (240, 320) plt.imshow(sample, cmap='gray')

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-475762167, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr54L7CnDDs_7o0tVntstGPAK8cELEks5vZTdQgaJpZM4YnrZ0 .

Vishwasnayak avatar Mar 23 '19 02:03 Vishwasnayak

@Vishwasnayak Image is saved only when key is pressed, so it's more like tapping keys to move the car. Just drive on the track multiple times, or you could switch off the car and place the car on the track where you think it should be, then press arrow keys to collect while manually moving the car.

hamuchiwa avatar Mar 25 '19 13:03 hamuchiwa

Thank you sir. How to read npz files. Our faculty members want to view the images captured in npz files. How to view that sir?

On Mon, 25 Mar 2019, 7:13 pm hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak Image is saved only when key is pressed, so it's more like tapping keys to move the car. Just drive on the track multiple times, or you could switch off the car and place the car on the track where you think it should be, then press arrow keys to collect while manually moving the car.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476202696, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr5wU_B1OTRo7QTA-ErRCiQOewuwzDks5vaNKTgaJpZM4YnrZ0 .

Vishwasnayak avatar Mar 25 '19 13:03 Vishwasnayak

from numpy import load

data = load('Numpyfilename.npz') lst = data.files for item in lst: print(item) print(data[item])

Use this code to print

On Mon 25 Mar, 2019, 19:16 Vishwasnayak, [email protected] wrote:

Thank you sir. How to read npz files. Our faculty members want to view the images captured in npz files. How to view that sir?

On Mon, 25 Mar 2019, 7:13 pm hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak Image is saved only when key is pressed, so it's more like tapping keys to move the car. Just drive on the track multiple times, or you could switch off the car and place the car on the track where you think it should be, then press arrow keys to collect while manually moving the car.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476202696>, or mute the thread < https://github.com/notifications/unsubscribe-auth/Aizr5wU_B1OTRo7QTA-ErRCiQOewuwzDks5vaNKTgaJpZM4YnrZ0

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476203877, or mute the thread https://github.com/notifications/unsubscribe-auth/AgOJukjPTwtwnRIJHm2cvP2n3jer9SHfks5vaNNCgaJpZM4YnrZ0 .

Gooose1909 avatar Mar 25 '19 13:03 Gooose1909

thank you sir for your response. Can you suggest any methods to control speed of car. As it is not detecting turns and even stop sign.

On Mon, 25 Mar 2019, 7:20 pm Gooose1909, [email protected] wrote:

from numpy import load

data = load('Numpyfilename.npz') lst = data.files for item in lst: print(item) print(data[item])

Use this code to print

On Mon 25 Mar, 2019, 19:16 Vishwasnayak, [email protected] wrote:

Thank you sir. How to read npz files. Our faculty members want to view the images captured in npz files. How to view that sir?

On Mon, 25 Mar 2019, 7:13 pm hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak Image is saved only when key is pressed, so it's more like tapping keys to move the car. Just drive on the track multiple times, or you could switch off the car and place the car on the track where you think it should be, then press arrow keys to collect while manually moving the car.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476202696 , or mute the thread <

https://github.com/notifications/unsubscribe-auth/Aizr5wU_B1OTRo7QTA-ErRCiQOewuwzDks5vaNKTgaJpZM4YnrZ0

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476203877>, or mute the thread < https://github.com/notifications/unsubscribe-auth/AgOJukjPTwtwnRIJHm2cvP2n3jer9SHfks5vaNNCgaJpZM4YnrZ0

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476205317, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr51vfbNJBqBVl9nvHG1RFgyWiyobhks5vaNQNgaJpZM4YnrZ0 .

Vishwasnayak avatar Mar 25 '19 14:03 Vishwasnayak

Actually i made a RC car on my own so i had supplied less voltage to my motor so as to make the car run slowly Which worked for me. Try this method i am not sure though it may work or not

On Mon 25 Mar, 2019, 19:30 Vishwasnayak, [email protected] wrote:

thank you sir for your response. Can you suggest any methods to control speed of car. As it is not detecting turns and even stop sign.

On Mon, 25 Mar 2019, 7:20 pm Gooose1909, [email protected] wrote:

from numpy import load

data = load('Numpyfilename.npz') lst = data.files for item in lst: print(item) print(data[item])

Use this code to print

On Mon 25 Mar, 2019, 19:16 Vishwasnayak, [email protected] wrote:

Thank you sir. How to read npz files. Our faculty members want to view the images captured in npz files. How to view that sir?

On Mon, 25 Mar 2019, 7:13 pm hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak Image is saved only when key is pressed, so it's more like tapping keys to move the car. Just drive on the track multiple times, or you could switch off the car and place the car on the track where you think it should be, then press arrow keys to collect while manually moving the car.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476202696

,

or mute the thread <

https://github.com/notifications/unsubscribe-auth/Aizr5wU_B1OTRo7QTA-ErRCiQOewuwzDks5vaNKTgaJpZM4YnrZ0

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476203877 , or mute the thread <

https://github.com/notifications/unsubscribe-auth/AgOJukjPTwtwnRIJHm2cvP2n3jer9SHfks5vaNNCgaJpZM4YnrZ0

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476205317>, or mute the thread < https://github.com/notifications/unsubscribe-auth/Aizr51vfbNJBqBVl9nvHG1RFgyWiyobhks5vaNQNgaJpZM4YnrZ0

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476210012, or mute the thread https://github.com/notifications/unsubscribe-auth/AgOJuuayzEYXdaQpBZUJbdIzUFJcrYVoks5vaNaRgaJpZM4YnrZ0 .

Gooose1909 avatar Mar 25 '19 14:03 Gooose1909

Thank you sir. We are gibing supply of 3 v of 2 1.5 battery ..sir how did u reduce voltage any suggestion?

On Mon, 25 Mar 2019, 7:33 pm Gooose1909, [email protected] wrote:

Actually i made a RC car on my own so i had supplied less voltage to my motor so as to make the car run slowly Which worked for me. Try this method i am not sure though it may work or not

On Mon 25 Mar, 2019, 19:30 Vishwasnayak, [email protected] wrote:

thank you sir for your response. Can you suggest any methods to control speed of car. As it is not detecting turns and even stop sign.

On Mon, 25 Mar 2019, 7:20 pm Gooose1909, [email protected] wrote:

from numpy import load

data = load('Numpyfilename.npz') lst = data.files for item in lst: print(item) print(data[item])

Use this code to print

On Mon 25 Mar, 2019, 19:16 Vishwasnayak, [email protected] wrote:

Thank you sir. How to read npz files. Our faculty members want to view the images captured in npz files. How to view that sir?

On Mon, 25 Mar 2019, 7:13 pm hamuchiwa, [email protected] wrote:

@Vishwasnayak https://github.com/Vishwasnayak Image is saved only when key is pressed, so it's more like tapping keys to move the car. Just drive on the track multiple times, or you could switch off the car and place the car on the track where you think it should be, then press arrow keys to collect while manually moving the car.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476202696

,

or mute the thread <

https://github.com/notifications/unsubscribe-auth/Aizr5wU_B1OTRo7QTA-ErRCiQOewuwzDks5vaNKTgaJpZM4YnrZ0

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <

https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476203877

,

or mute the thread <

https://github.com/notifications/unsubscribe-auth/AgOJukjPTwtwnRIJHm2cvP2n3jer9SHfks5vaNNCgaJpZM4YnrZ0

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476205317 , or mute the thread <

https://github.com/notifications/unsubscribe-auth/Aizr51vfbNJBqBVl9nvHG1RFgyWiyobhks5vaNQNgaJpZM4YnrZ0

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476210012>, or mute the thread < https://github.com/notifications/unsubscribe-auth/AgOJuuayzEYXdaQpBZUJbdIzUFJcrYVoks5vaNaRgaJpZM4YnrZ0

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/124#issuecomment-476211194, or mute the thread https://github.com/notifications/unsubscribe-auth/Aizr54Avd6UyoMFggN3Spe3u0dA5AVyqks5vaNdDgaJpZM4YnrZ0 .

Vishwasnayak avatar Mar 25 '19 14:03 Vishwasnayak