Difference between revisions of "Self Driving RC Car/2020"

From BITPlan Wiki
Jump to navigation Jump to search
Line 175: Line 175:
 
targetHost=10.9.8.7
 
targetHost=10.9.8.7
 
targetUser=pi
 
targetUser=pi
 +
# carserver configuration
 +
carserver.port=8080
 
</source>
 
</source>
 
The deploy script as a help option that shows how it can be used:
 
The deploy script as a help option that shows how it can be used:
 
<source lang='bash'>
 
<source lang='bash'>
./deploy.sh -h
+
deploy.sh [-a|-d|-h|-m|-s]
deploy.sh [-d|-h|-m|-s]
 
  
 +
  -a |--autostart        : configure the remotecar app to autostart on reboot
 
   -d |--debug            : debug this script
 
   -d |--debug            : debug this script
 
   -m |--maven            : run maven install
 
   -m |--maven            : run maven install
 
   -h |--help              : show this usage
 
   -h |--help              : show this usage
   -s |--start            : deploy and start duke-farm fat jar
+
   -s |--start            : deploy and start remotecar (duke) fat jar
 
</source>
 
</source>
 
* <nowiki>deploy -m</nowiki> will create the duke-farm fat jar
 
* <nowiki>deploy -m</nowiki> will create the duke-farm fat jar
 
* <nowiki>deploy -s</nowiki> will send the jar to your PI using rsync and start it
 
* <nowiki>deploy -s</nowiki> will send the jar to your PI using rsync and start it
 +
* <nowiki>deploy -a</nowiki> will create an autostart configuration that restarts the client on reboot see https://github.com/rc-dukes/dukes/issues/26
  
 
= First Experiments =
 
= First Experiments =

Revision as of 19:04, 26 June 2019

[edit]

[edit]

Parts-List as Excel File

# picture part example sources documents ~ price
1 RC Car Chassis 2019-06-07.jpeg 1:10 RC Car chassis
  1. 1:10 elektro tourenwagen chassis ARR
  2. TAMIYA 57986" 1:10 RC TT-02-Chassis First Try On-Road 
  1. de/en/fr/nl
  2. Tamiya 57986
70 €
2 SpeedControl 2019-06-06.jpg Speed Control Modelcraft Carbon Series Speed Control "20 Turns" de/en/fr/nl 21 €
3 RC Car Servo 2019-06-06.jpg RC-Car servo  
  1. RC-Car servo 4519
  2. Carson 500502036 - Servo CS-6 - 6 kg/JR-Stecker
de/en 10 €
4 TopFuel-LiPo-25C-ECO-X-1300mAh-3S-21300341 b 0.JPG 
  1. TopFuel LiPo 25C-ECO-X 1300mAh 3S 
  2. NiMH 7.2V 3500 mAh
  16 €
5 Absima CB 1S BatteryCharger 2019-06-06.jpg Battery Charger
  1. Ansmann NiMH Charger
27 €
6 713LX1Z383L. SL1500 .jpg Raspberry PI 3 B+ Raspberry PI 3 B+ en  35 €
7 81UBu4aoQHL. SL1500 .jpg  microSD Card SanDisk 16 GB 7 €
8 61Z5yEYfnAL. SL1426 .jpg Raspberry PI Camera 1080 p Camera Module 23 €
9  41smcErJNjL.jpg DC/DC Converter 12 V-> 5V 12 V->5 V Converter Module    7 €
10 31pzC7A3D3L.jpg Micro USB Connector Delock USB 2.0 Micro USB   6 €
        Total  199 €
a 71AYEqpWHcL. SL1500 .jpg Breadbord Kit MB102 Breadbord Kit 7 €
b 714Ep9LpwoL. SL1200 .jpg Ulrasound Sensor 5 x HC-SR04 + Cables 10 €
[edit]

DCC-DCC converter

To run the Raspberry PI from the 7.4 Volt Battery of the car the DC-DC converter has to be soldered into the voltage supply chain.

Camera mount

Servo and LED

RcCarWiring2019-06-22.png

[edit]

For a start a 3D Printed case for the Raspberry PI was used:

2094b280ac54121f9dad5fc172b1a3eb_preview_featured.jpg 081727802f13879a77f4b8bfbd0277d1_preview_featured.jpg

RaspberryWithCaseIMG 0025.JPG

[edit]

Raspbian

Raspbian Stretch with desktop and recommended software

  1. Download Zip File from https://www.raspberrypi.org/downloads/raspbian/
  2. Create SD Card as described in https://www.raspberrypi.org/documentation/installation/installing-images/
  3. Insert SD Card into Raspberry PI
  4. Connect Keyboard, Mouse, HDMI-Monitor and 5 Volt Mini USB (2.5 Amps recommended)
  5. Setup Country, pi user password etc. and connect to your WIFI network - after the setup you'll be asked to restart your pi

WebCam Interface

cd /usr/local/src
sudo git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git
cd RPi_Cam_Web_Interface/
./install.sh

WebCamInterface2019-06-21.png

In case of error

A message like:

#mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
sh: 1: /var/www/html/macros/error_hard.sh: Permission denied

Indicates that you might have a cabling problem.

In case of success

http://<yourpi>/html should show the cam interface: RpiCamControl2019-06-21.png

Servo Interface - Servoblaster

wf@pibee:~ $ cd /usr/local/src
wf@pibee:/usr/local/src $ sudo git clone https://github.com/srcshelton/servoblaster
cd servoblaster
sudo make install
sudo reboot

OpenJDK

sudo apt-get install openjdk-8-jdk

Screen

sudo apt-get install screen
[edit]

Tested on

  1. Mac OS 10.13.6 High Sierra with macports 2.5.4
  2. Ubuntu 18.04.2 LTS

OpenCV

MacOS

If you'd like to generally use OpenCV you can get it e.g. from the macports project:

sudo port install opencv +java
ls /opt/local/share/OpenCV/java
libopencv_java343.dylib opencv-343.jar

For your convenience you'll find these two files in the lib directory.

Ubuntu 18

You might want to use scripts/opencvubuntu to download the 75 MByte libopencv_java343.so and install the backports libjasper libraries that are not published with Ubuntu 18 by default. You'll find some other links in the script that might also give you hints on how to proceed if you have another environment or different needs. You might want to create an Issue if you run into trouble.

Windows

Help Wanted -please file an issue if you want to things running on Windows.

[edit]

Deploying to your Raspberry is done by compiling e.g. on a laptop and then transferring the results to your PI.

You need to configure your targetHost and targetUser in a file ~/dukes/dukes.ini

Example Configuration

#
# rc-dukes configuration file
# see https://github.com/rc-dukes/dukes
#
targetHost=10.9.8.7
targetUser=pi
# carserver configuration
carserver.port=8080

The deploy script as a help option that shows how it can be used:

deploy.sh [-a|-d|-h|-m|-s]

  -a |--autostart         : configure the remotecar app to autostart on reboot
  -d |--debug             : debug this script
  -m |--maven             : run maven install
  -h |--help              : show this usage
  -s |--start             : deploy and start remotecar (duke) fat jar
  • deploy -m will create the duke-farm fat jar
  • deploy -s will send the jar to your PI using rsync and start it
  • deploy -a will create an autostart configuration that restarts the client on reboot see https://github.com/rc-dukes/dukes/issues/26