{"id":24221594,"url":"https://github.com/michdo93/robotcar","last_synced_at":"2025-07-29T17:15:45.193Z","repository":{"id":135032777,"uuid":"280898854","full_name":"Michdo93/robotcar","owner":"Michdo93","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-22T13:45:16.000Z","size":18306,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T00:45:31.892Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Michdo93.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-19T15:52:05.000Z","updated_at":"2021-06-22T13:45:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"b42abb04-bf5a-426e-88e3-e0414860c40a","html_url":"https://github.com/Michdo93/robotcar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Michdo93/robotcar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michdo93%2Frobotcar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michdo93%2Frobotcar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michdo93%2Frobotcar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michdo93%2Frobotcar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Michdo93","download_url":"https://codeload.github.com/Michdo93/robotcar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michdo93%2Frobotcar/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267724002,"owners_count":24134260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-14T06:19:39.041Z","updated_at":"2025-07-29T17:15:45.161Z","avatar_url":"https://github.com/Michdo93.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# robotcar\n\n## Develop and test Advanced Driver Assistance Systems (ADAS) with the robotcar using Python, ROS, OpenCV and TensorFlow\n\n![robotcar](pictures/robotcar.jpg \"RobotCar\")\n\n## 1 Project Information\n=====================\n\nProject of the [Faculty of Computer Science](https://www.hs-furtwangen.de/en/faculties/computer-science/) of the [Furtwangen University](https://www.hs-furtwangen.de/en/) inside the master degree [Mobile Systems](https://www.hs-furtwangen.de/en/programmes/mobile-systems-master/).\n\nPart of the master thesis \"Entwicklung einer erweiterbaren Simulationsplattform für Fahrerassistenzfunktionen am Beispiel von Python, ROS, OpenCV und TensorFlow\"\n\nDeveloper: Michael Christian Dörflinger\n\nSupervisiors:\n\n- [Prof. Dr. Steffen Thiel](https://www.hs-furtwangen.de/personen/profil/75-steffenthiel/)\n- [Ingo Maindorfer](https://www.hs-furtwangen.de/personen/profil/1707-ingomaindorfer/)\n\nThe development of driver assistance functions is extensive and expensive. Virtual simulations significantly improve the development process, but do not reflect the reality of vehicle actuators and sensors. Development under physically real conditions is therefore indispensable. The thesis will investigate how such a simulation platform can be implemented using a small robot car, taking into account the expandability of new sensor technology and driver assistance functions.\n\n## 2 Hardware\n=====================\n\n![robotcar](pictures/roboterauto.png \"Robotcar block schema\")\n\n(Not the actual used components because you can get it cheaper.)\n\n| Quantity | Modul | Article | Estimated price (per piece) |\n|--------- | ------| --------| ----------------------------|\n| 1 | chassis | [4WD RC Smart Car Chassis](https://www.elecrow.com/4wd-smart-car-robot-chassis-for-arduino-servo-steering.html) | 40,00€ |\n| 1 | chassis | [20x20 cm perforated plate](https://smile.amazon.de/dp/B00QAGIXLG/ref=pe_3044161_185740101_TE_item) | 2,50€ |\n| 1 | chassis | [mounting kit raspberry pi](https://www.amazon.de/gp/product/B07G5HM9ZT/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8\u0026psc=1) | 12,00€ |\n| 1 | onboard computer | [Raspberry Pi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/?resellerType=home\u0026variant=raspberry-pi-4-model-b-8gb) | 77,50€ |\n| 1 | onboard computer | [Raspberry Pi cooler](https://www.amazon.de/gp/product/B07JGNF5F8/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8\u0026psc=1) | 8,99€ |\n| 1 | onboard computer | [Raspberry Pi stacking header](https://www.amazon.de/gp/product/B07NTH2RZX/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8\u0026psc=1) | 10,35€ |\n| 1 | onboard computer | [Raspberry Pi port doubler](https://www.amazon.de/gp/product/B07GPPZ7TB/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8\u0026psc=1) | 7,23€ |\n| 1 | co-processor | [Coral Edge TPU USB accelerator](https://www.mouser.de/ProductDetail/Coral/G950-06809-01?qs=u16ybLDytRbcxxqFKdbhgQ%3D%3D\u0026vip=1\u0026gclid=CjwKCAiA7939BRBMEiwA-hX5J7SCRvcS0FLpI7EGL1z0iKYdMWKdEDGNVP10fhpuVj-wnjDSk8_xyRoCXKIQAvD_BwE) | 74,50€ |\n| 1 | storage medium | [tf card class 10 64gb](https://www.amazon.de/Intenso-Micro-Class-Speicherkarte-SD-Adapter/dp/B00FMB9A30/ref=sr_1_4?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91\u0026dchild=1\u0026keywords=tf%2Bclass%2B10%2B64gb\u0026qid=1605913236\u0026quartzVehicle=1522-1061\u0026replacementKeywords=class%2B10%2B64gb\u0026sr=8-4\u0026th=1) | 5,99€ |\n| 1 | motor controller | [L298N H-Bridge](https://www.amazon.de/Br%C3%BCcke-Treiberplatine-Schrittmotor-Stepper-Controller/dp/B07PRXMH9P/ref=sr_1_2_sspa?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91\u0026dchild=1\u0026keywords=L298N\u0026qid=1605913516\u0026s=ce-de\u0026sr=1-2-spons\u0026psc=1\u0026spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExQzdOVkYyQlJDM1EwJmVuY3J5cHRlZElkPUEwNjUyNTU5MlRVSjJPR0cyQVEwVyZlbmNyeXB0ZWRBZElkPUEwMTkwMzM0NlEwSlQzMFc1QU00JndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==) | 5,89€ |\n| 1 | servo controller | [PCA9685 16 Channel Servo Controller](https://www.amazon.de/gp/product/B06XSFFXQY/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8\u0026psc=1) | 6,89€ |\n| 1 | step down converter | [Dual USB 9V/12V/24V/36V to 5V Converter DC-DC 3A Step Down Power Module](https://www.amazon.de/dp/B0768D2NYH?tag=ingmstap-21\u0026linkCode=ogi\u0026th=1\u0026psc=1) | 8,26€ |\n| x | battery | [11.1 V LiPo](https://www.amazon.de/Lipo-11-1800mAh-25C-3S-1P/dp/B009H497IG/ref=sr_1_2?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91\u0026dchild=1\u0026keywords=lipo+11.1v+1800mAh+25c\u0026qid=1605912549\u0026sr=8-2) | 27,19€ |\n| 1 | power supply unit | [universal power supply unit](https://www.reichelt.de/de/de/universal-schaltnetzteil-36-w-5-15-v-3000-ma-mw-3h36gs-p89789.html?r=1) | 13,20€ |\n| 1 | power supply unit | [Deans T plug](https://www.amazon.de/gp/product/B07FND44XC/ref=ppx_yo_dt_b_asin_title_o07_s01?ie=UTF8\u0026psc=1) | 10,80€ |\n| 1 | power supply unit | [dc female terminal block adapter](https://www.amazon.de/gp/product/B00E8CURKO/ref=ppx_yo_dt_b_asin_title_o07_s01?ie=UTF8\u0026psc=1) | 2,00€ |\n| 1 | camera | [MakerHawk Raspberry Pi camera IR Fisheye wide angle 150-160 degrees 5MP OV5647](https://www.amazon.de/gp/product/B07DRH5Y5S/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8\u0026psc=1) | 27,99 |\n| 1 | camera | [pan-tilt-bracket](https://www.amazon.de/dp/B079H3WY7T?tag=ingmstap-21\u0026linkCode=ogi\u0026th=1\u0026psc=1) |  |\n| 1 | camera | [passive cooler](https://www.amazon.de/gp/product/B06XWFG7Q7/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8\u0026psc=1) | 3,99€ |\n| 1 | camera | [flat ribbon cable](https://www.amazon.de/gp/product/B075PBTQPG/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8\u0026psc=1) | 5,29€ |\n| 1 | imu | [Raspberry Pi Sense HAT](https://www.amazon.de/dp/B014T2IHQ8/ref=dp_prsubs_1) | 37,63€ |\n| 2 | time-of-flight | [VL53L1X](https://www.amazon.de/gp/product/B07DM2TKKL/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8\u0026psc=1) | 17,65€ |\n| 2 | ultrasonic | [Parallax Ping)))](https://www.amazon.de/Parallax-Ping-Ultrasonic-Distance-Sensor/dp/B004SRTM0K/ref=sr_1_1?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91\u0026dchild=1\u0026keywords=parallax+ultrasonic\u0026qid=1605913993\u0026sr=8-1) | 39,00€ |\n| 4 | ultrasonic | [HC-SR04](https://www.amazon.de/gp/product/B07KPJNLSS/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8\u0026psc=1) | 8,00€ |\n| 1 | ultrasonic | [330 Ohm resistor](https://www.amazon.de/gp/product/B00YW3E2LO/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8\u0026psc=1) | 6,37€ |\n| 1 | ultrasonic | [470 Ohm resistor](https://www.amazon.de/gp/product/B00YW4DTRG/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8\u0026psc=1) | 6,49€ |\n| 2 | infrared | [GP2Y0A02YK0F](https://www.amazon.de/SENSOR-DISTANCE-ANALOGUE-GP2Y0A02YK0F-SHARP/dp/B018COQRAC/ref=sr_1_1?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91\u0026dchild=1\u0026keywords=GP2Y0A02YK0F+sharp\u0026qid=1605987062\u0026s=ce-de\u0026sr=1-1) | 12,28€ |\n| 1 | infrared | [breadboard](https://www.pollin.de/p/acrylplatte-und-breadboard-fuer-rpi-b-2b-3b-3b-810982) | 4,50€ |\n| 1 | infrared | [MCP3008 A/D-Converter](https://de.rs-online.com/web/p/a-d-wandler/6696064/) | 2,00€ |\n| 1 | gps | [EZ-0048 GPS-Modul](https://www.amazon.de/USB-USB-Port-GPS-Modul-Raspberry-EZ-0048/dp/B07L9VZFZD) | 38,50€ |\n| 1 | i2c | [6 Port Grove I2C-Hub](https://www.robotshop.com/de/de/grove-i2c-hub-6-port.html?gclid=Cj0KCQiAkuP9BRCkARIsAKGLE8XOw5ILNanURA4TTg_egSyDX-QGtdQO4QljIMgeD9OuXtUTQ8oGYEcaAlaxEALw_wcB) | 1,47€ |\n| 1 | display | [I2C OLED 128 x 64 Pixel 0,96 Zoll](https://www.amazon.de/gp/product/B074N9VLZX/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8\u0026psc=1) | 11,99€ |\n| 1 | wire | [jump wires (F2F, F2M and M2M)](https://www.amazon.de/AZDelivery-Jumper-Arduino-Raspberry-Breadboard/dp/B07KFPXN44/ref=sr_1_2_sspa?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91\u0026crid=S8CEKQOZL6A6\u0026dchild=1\u0026keywords=jumper+kabel\u0026qid=1605986389\u0026quartzVehicle=21-720\u0026replacementKeywords=kabel\u0026sprefix=jumper+kabe%2Caps%2C203\u0026sr=8-2-spons\u0026psc=1\u0026spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEzVEJWNUhUMUg3SEg2JmVuY3J5cHRlZElkPUEwNzYxNDk3Mk9FWUJJUzRZTlZGViZlbmNyeXB0ZWRBZElkPUEwNzgzODI4SVpUNFRZUzVWTTQ5JndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==) | 4,66€ |\n| 1 | wire | [4 Pin Female Jumper to Grove](https://www.amazon.de/dp/B01AD62W56?tag=ingmstap-21\u0026linkCode=ogi\u0026th=1\u0026psc=1) | 7,90€ |\n| 1 | wire | [usb litz wire](https://www.reichelt.de/usb-2-0-kabel-a-stecker-auf-2x-offene-kabelenden-delock-85250-p203116.html?\u0026trstct=pos_2\u0026nbc=1) | 2,52€ |\n| 1 | wire | [two-core copper cable](https://www.pollin.de/p/zwillingslitze-2x-0-14-mm2-rot-schwarz-10-m-561804) | 1,90€ |\n\nAt the beginning the chassis is simply assembled according to building instructions. [Here](https://www.elecrow.com/4wd-smart-car-robot-chassis-for-arduino-servo-steering.html) you can find the install instructions and install videos. Then solder cables for plus and minus on the motor. To use the toggle switch, it makes sense to solder the cables from the battery before they go to the motor driver. The following picture shows how the cables are connected to the motor driver.\n\n![robotcar](pictures/Motortreiber.PNG \"Wiring motor controller\")\n\nFrom the battery or motor driver, the cables go next to the Step Down Converter.\n\n![robotcar](pictures/Step_Down_Converter.PNG \"Wiring step down converter\")\n\nThe Step Down Converter reduces the voltage for the pegboard and the Raspberry Pi. This allows the motor to be supplied independently from other consumers and always receives sufficient power. The Raspberry Pi is connected to the Step Down Converter via a USB-C cable. The plug-in board uses a USB stranded cable, where male plugs are soldered to the jumper cable.\n\n![robotcar](pictures/RPi_Pins.PNG \"Wiring RPi\")\n\nPlease note that a ribbon cable of the Raspberry Pi has already been plugged into the CSI slot. In addition, the cooler has been attached and the stacking headers. The port doubler was connected via spacers and the Sense HAT was attached to it. This means that not the pins of the RPi are used but the pins of the port-doubler.\n\nThe USB slots of the Raspberry Pi are occupied as follows:\n\n![robotcar](pictures/RPi_USB.PNG \"Wiring RPi USB\")\n\nFor the GPS module this means the following cabling:\n\n![robotcar](pictures/RPi_GPS.PNG \"Wiring GPS\")\n\nAt Raspberry Pi, the I2C bus is extended via an I2C hub as follows:\n\n![robotcar](pictures/I2C_Hub.PNG \"Wiring I2C hub\")\n\nFor the servo controller this means the following cabling:\n\n![robotcar](pictures/Servotreiber.PNG \"Wiring servo controller\")\n\nThe rest is connected via the breadboard:\n\n![robotcar](pictures/Steckbrett.PNG \"Wiring breadboard\")\n\nThe MCP3008 located on the breadboard is assigned as follows:\n\n![robotcar](pictures/Wandler.PNG \"Wiring MCP3008\")\n\nIt uses the SPI bus of the Raspberry Pi\n\nA more detailed diagram for the robot car wiring can be found in Roboterauto.vpd\n\n## 3 Software\n=====================\n\nAt first download and flash [Debian Buster](https://www.raspberrypi.org/downloads/raspberry-pi-os/) on a Micro SD Card.\n\nAfter that we will start our Raspberry Pi and open the terminal. A good start is at first:\n\n```bash\n$ sudo apt-get update -y \u0026\u0026 apt-get upgrade -y\n$ sudo rpi-update\n```\n\nWe begin with changing the interface options:\n\n```bash\n$ sudo raspi-config\n```\n\nThen select `5 Interfacing Options` and press enter. There you have to go to different submenus. As example `P1 Camera`. You also have to press enter. For enabling you have to select `Yes` and press enter.\n\nYou have to enable following interfacing options:\n* P1 Camera\n* P2 SSH\n* P3 VNC\n* P4 SPI\n* P5 I2C\n* P6 Serial\n\nAfter that we can use the RPi via SSH or VNC headless. You can check the ip address with `ifconfig`. Then you can reboot with `sudo reboot` if you want and log in via SSH.\n\nYou can connect from a linux terminal to headless started Raspberry Pi via `ssh\u003cusername\u003e@ip_address` then you have to enter the password and press enter.\n\nIf you want to connect via VNC you have install as example the [Real VNC Viewer](https://www.realvnc.com/de/connect/download/viewer/) on your computer. On the Raspberry Pi you have o change the `/boot/config.txt` file as example with `sudo nano /boot/config.txt`. Inside this file you can use settings like the following that if the raspberry pi starts without any display headless, the gui can be used external like VNC does:\n\n```bash\nframebuffer_width=1280\nframebuffer_height=1024\nhdmi_force_hotplug=1\n#dtoverlay=vc4-fkms-v3d\n```\n\nAfter that you can choose if you want to use SSH or VNC.\n\n### 3.1 ROS Melodic\n#### 3.1.1 Installation\n\nFind more under\n\n- [ROS Melodic on Raspberry Pi 4 Debian Buster + RPLIDAR A1M8](https://www.instructables.com/id/ROS-Melodic-on-Raspberry-Pi-4-RPLIDAR/)\n- [ROSberryPi: Installing ROS Melodic on the Raspberry Pi](http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Melodic%20on%20the%20Raspberry%20Pi)\n- [ROSberryPi: Installing ROS Kinetic on the Raspberry Pi](http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Kinetic%20on%20the%20Raspberry%20Pi)\n\n##### 3.1.1.1 Prerequisites\n\nThese instructions assume that Raspbian Buster is being used as the OS on the Raspberry Pi 4 Model B.\n\n###### 3.1.1.1.1 Setup ROS Repositories\n\nFirst install repository key:\n```bash\n$ sudo sh -c 'echo \"deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main\" \u003e /etc/apt/sources.list.d/ros-latest.list'\n$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654\n```\n\nNow, make sure your Debian package index is up-to-date:\n\n```bash\n$ sudo apt-get update\n$ sudo apt-get upgrade\n```\n\n###### 3.1.1.1.2 Install Bootstrap Dependencies\n\n```bash\n$ sudo apt install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake\n```\n\n###### 3.1.1.1.3 Initializing rosdep\n\n```bash\n$ sudo rosdep init\n$ rosdep update\n```\n\n##### 3.1.1.2. Installation\n\nNow, we will download and build ROS Melodic.\n\n###### 3.1.1.2.1 Create a catkin Workspace\n\nIn order to build the core packages, you will need a catkin workspace. Create one now:\n\n```bash\n$ mkdir -p ~/ros_catkin_ws\n$ cd ~/ros_catkin_ws\n```\n\nDesktop Install: includes GUI tools, such as rqt, rviz, and robot-generic libraries. Might be better choice for beginners to ROS.\n\n```bash\n$ rosinstall_generator desktop --rosdistro melodic --deps --wet-only --tar \u003e melodic-desktop-wet.rosinstall\n$ wstool init -j8 src melodic-desktop-wet.rosinstall\n```\n\nThis will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.\n\n###### 3.1.1.2.2 Resolve Dependencies\n\nBefore you can build your catkin workspace, you need to make sure that you have all the required dependencies. We use the rosdep tool for this.\n\nResolving Dependencies with rosdep\nThe dependencies should be resolved by running rosdep:\n\n```bash\n$ cd ~/ros_catkin_ws\n$ rosdep install -y --from-paths src --ignore-src --rosdistro melodic -r --os=debian:buster\n```\n\nThis will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.\n\nThe --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.\n\nAfter a while rosdep will finish installing system dependencies and you can continue.\n\n###### 3.1.1.2.3 Building the catkin Workspace\n\nOnce you have completed downloading the packages and have resolved the dependencies, you are ready to build the catkin packages.\n\nInvoke catkin_make_isolated:\n\n```bash\n$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic -j8\n```\n\nNow ROS should be installed! Remember to source the new installation. Source the setup.bash in the ~/.bashrc, so that ROS environment variables are automatically added to your bash session every time a new shell is launched:\n\n```bash\n$ echo \"source /opt/ros/melodic/setup.bash\" \u003e\u003e ~/.bashrc\n```\n\n#### 3.1.2 Update ROS Packages\n\nFind more under http://wiki.ros.org/melodic/Installation/Source\n\n```bash\ncd ~/ros_catkin_ws/\n```\n\nTo update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.\n\n```bash\n$ mv -i melodic-desktop-full.rosinstall melodic-desktop-full.rosinstall.old\n$ rosinstall_generator desktop_full --rosdistro melodic --deps --tar \u003e melodic-desktop-full.rosinstall\n```\n\nThen, compare the new rosinstall file to the old version to see which packages will be updated:\n\n```bash\n$ diff -u melodic-desktop-full.rosinstall melodic-desktop-full.rosinstall.old\n```\n\nIf you're satisfied with these changes, incorporate the new rosinstall file into the workspace and update your workspace:\n\n```bash\n$ vcs import src \u003c melodic-desktop-full.rosinstall\n```\n\nNow that the workspace is up to date with the latest sources, rebuild it:\n\n```bash\nsudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic -j8\n```\n\nOnce your workspace has been rebuilt, you should source the setup files again:\n\n```bash\n$ source /opt/ros/melodic/setup.bash\n```\n\nOr just reload the ~/.bashrc file:\n\n```bash\n$ source ~/.bashrc\n```\n\n#### 3.1.3 Adding released ROS Packages\n\nYou may add additional packages to the installed ros workspace that have been released into the ros ecosystem. First, a new rosinstall file must be created including the new packages (Note, this can also be done at the initial install). For example, if we have installed ros_comm, but want to add ros_control and joystick_drivers, the command would be:\n\n```bash\n$ cd ~/ros_catkin_ws\n$ rosinstall_generator ros_comm ros_control joystick_drivers --rosdistro melodic --deps --wet-only --tar \u003e melodic-custom_ros.rosinstall\n```\n\nYou may keep listing as many ROS packages as you'd like separated by spaces.\n\n\nNext, update the workspace with wstool:\n\n```bash\n$ wstool merge -t src melodic-custom_ros.rosinstall\n$ wstool update -j8 -t src\n```\n\nAfter updating the workspace, you may want to run rosdep to install any new dependencies that are required:\n\n```bash\n$ rosdep install --from-paths src --ignore-src --rosdistro melodic -y -r --os=debian:buster\n```\n\nFinally, now that the workspace is up to date and dependencies are satisfied, rebuild the workspace:\n\n```bash\n$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic -j8\n```\n\nOnce your workspace has been rebuilt, you should source the setup files again:\n\n```bash\n$ source /opt/ros/melodic/setup.bash\n```\n\nOr just reload the ~/.bashrc file:\n\n```bash\n$ source ~/.bashrc\n```\n\n#### 3.1.3.1 Adding raspicam_node Package\n\nDon`t follow the [raspicam_node installation guide](https://github.com/UbiquityRobotics/raspicam_node) because the [raspicam_node](https://github.com/UbiquityRobotics/raspicam_node) was built for the kinetic distribution. You have to use the new build [raspica_node](https://github.com/Michdo93/raspicam_node). For the melodic distribution you have to do the following workaround:\n\nThe original node is primarily supported on ROS Kinetic, and Ubuntu 16.04. This instructions are made for ROS Melodic and Raspbian Buster. So we'll have to build it from source.\n\nMake sure that your user is in the `video` group by running `groups|grep video`. If not type following in your command line: `sudo usermod -a -G video \u003cusername\u003e`\n\nNow install following dependecies for Python:\n\n```\nsudo -H pip install -U pygithub\nsudo -H pip install -U pygithub3\nsudo -H pip install -U chainercv\n```\n\nYou have first to install pygithub because pygithub 3 couldn't be found if not.\n\nGo to your ros_catkin_ws `cd ~/ros_catkin_ws/`.\n\nAfter that we have to use the rosinstall_generator to add some new ROS Packages.\n\n```\nrosinstall_generator compressed_image_transport --rosdistro melodic --deps --wet-only --tar \u003e melodic-compressed_image_transport-wet.rosinstall\n\nrosinstall_generator camera_info_manager --rosdistro melodic --deps --wet-only --tar \u003e melodic-camera_info_manager-wet.rosinstall\n\nrosinstall_generator dynamic_reconfigure --rosdistro melodic --deps --wet-only --tar \u003e melodic-dynamic_reconfigure-wet.rosinstall\n```\n\nThen we have to merge it to our current ROS installation.\n\n```\nwstool merge -t src melodic-compressed_image_transport-wet.rosinstall\nwstool merge -t src melodic-camera_info_manager-wet.rosinstall\nwstool merge -t src melodic-dynamic_reconfigure-wet.rosinstall\n```\n\nAnd then we have to update it with `wstool update -t src`\n\nThen you have to install the rosdeps again:\n\n```\nrosdep install --from-paths src --ignore-src --rosdistro melodic -y -r\n```\n\nNow we can run the build process again with:\n\n```\nsudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic\n```\n\nGo to your catkin_ws with `cd ~/catkin_ws/src`\n\nDownload the source for this node by running\n\n`git clone https://github.com/Michdo93/raspicam_node.git`\n\nNormally you should skip the follwing part with updating the rosdep:\n\n------------------------------------------------------------------------------------------\n\nThere are some dependencies that are not recognized by ros, so you need to create the file `/etc/ros/rosdep/sources.list.d/30-ubiquity.list` and add this to it.\n```\nyaml https://raw.githubusercontent.com/UbiquityRobotics/rosdep/master/raspberry-pi.yaml\n```\n\nThen run `rosdep update`.\n\n------------------------------------------------------------------------------------------\n\nIf skipping this part does not work try to install it like in the description above or to install it with the apt-package manager like this:\n\n```bash\nsudo apt-get install libraspberrypi0\nsudo apt-get install libraspberrypi-dev\nsudo apt-get install libpigpio-dev\nsudo apt-get install libpigpiod-if-dev\n```\n\nNormally on a Raspberry Pi with a Raspbian OS this packages should be installed by default.\n\nInstall the ros dependencies,\n\n```\ncd ~/catkin_ws\nrosdep install --from-paths src --ignore-src --rosdistro=melodic -y\n```\n\nCompile the code with `catkin_make`.\n\nLater we will do some special configuration stuff that we can use ROS under Python 3 and that the RobotCar can find its needed control computer respectively operating computer.\n\n### 3.2 Install ROS Melodic on a operating computer\n\nFor the control computer or operating computer a virtual machine is recommended. Here you can install Ubuntu like [Ubuntu Bionic Beaver](https://releases.ubuntu.com/18.04/). Then you can install ROS like in the following [instruction}(http://wiki.ros.org/melodic/Installation/Ubuntu). It's much easier.\n\n#### 3.2.1 Configure your Ubuntu repositories\nConfigure your Ubuntu repositories to allow \"restricted,\" \"universe,\" and \"multiverse.\" You can [follow the Ubuntu guide](https://help.ubuntu.com/community/Repositories/Ubuntu) for instructions on doing this.\n\n#### 3.2.2 Setup your sources.list\nSetup your computer to accept software from packages.ros.org.\n\n```\nsudo sh -c 'echo \"deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main\" \u003e /etc/apt/sources.list.d/ros-latest.list'\n```\n\n#### 3.2.3 Set up your keys\n\n```\nsudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654\n```\n\nIf you experience issues connecting to the keyserver, you can try substituting hkp://pgp.mit.edu:80 or hkp://keyserver.ubuntu.com:80 in the previous command.\n\nAlternatively, you can use curl instead of the apt-key command, which can be helpful if you are behind a proxy server:\n\n```\ncurl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get\u0026search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -\n```\n\n#### 3.2.4 Installation\nFirst, make sure your Debian package index is up-to-date:\n\n```\nsudo apt update\n```\n\nThere are many different libraries and tools in ROS. We provided four default configurations to get you started. You can also install ROS packages individually.\n\nIn case of problems with the next step, you can use following repositories instead of the ones mentioned above ros-shadow-fixed\n\nDesktop-Full Install: (Recommended) : ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception\n\n```\nsudo apt install ros-melodic-desktop-full\n```\n\n#### 3.2.5 Environment setup\nIt's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:\n\n```\necho \"source /opt/ros/melodic/setup.bash\" \u003e\u003e ~/.bashrc\nsource ~/.bashrc\n```\n\nIf you have more than one ROS distribution installed, ~/.bashrc must only source the setup.bash for the version you are currently using.\n\nIf you just want to change the environment of your current shell, instead of the above you can type:\n\n```\nsource /opt/ros/melodic/setup.bash\n```\n\nIf you use zsh instead of bash you need to run the following commands to set up your shell:\n\n```\necho \"source /opt/ros/melodic/setup.zsh\" \u003e\u003e ~/.zshrc\nsource ~/.zshrc\n```\n\n#### 3.2.6 Dependencies for building packages\nUp to now you have installed what you need to run the core ROS packages. To create and manage your own ROS workspaces, there are various tools and requirements that are distributed separately. For example, rosinstall is a frequently used command-line tool that enables you to easily download many source trees for ROS packages with one command.\n\nTo install this tool and other dependencies for building ROS packages, run:\n\n```\nsudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential\n```\n\n##### 3.2.6.1 Initialize rosdep\nBefore you can use many ROS tools, you will need to initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS. If you have not yet installed rosdep, do so as follows.\n\n```\nsudo apt install python-rosdep\n```\n\nWith the following, you can initialize rosdep.\n\n```\nsudo rosdep init\nrosdep update\n```\n\n### 3.3 Install and configuring the Samba Server\n\nIt is recommended to integrate the robot car as network drive at the operating PC. The Samba server is installed for this purpose. Some precautions must be taken for both the server and the client. Logically, the robot car provides the server.\n\n#### 3.3.1 Samba Server\n\nOn the Robotcar execute a terminal and install samba with:\n\n```\nsudo apt-get install samba samba-common-bin\n```\n\nAfter that you have to change die configuration file with `sudo nano /etc/samba/smb.conf`. For example, if you want to share the whole RobotCar, you must share /home/pi off the user pi. An example could look like this:\n\n```\n[global]\nnetbios name = Pi\nserver string = The RobotCar File System\nworkgroup = WORKGROUP\n\n[HOMEPI]\npath = /home/pi\ncomment = No comment\nbrowsable = yes\nwritable = Yes\ncreate mask = 0777\ndirectory mask = 0777\npublic = no\n```\n\nThen you have to set a samba password with `sudo smbpasswd -a \u003cusername\u003e`. So for the given example with the user pi `sudo smbpasswd -a pi`. You have to enter a password and press enter. As example the RobotCar uses `robotcar` as samba password.\n\nThen you have to restart the samba service with `sudo /etc/init.d/smbd restart`.\n\n#### 3.3.2 Samba Client\n\nOn the operating computer or control computer you have to open a terminal and install following:\n\n```\nsudo apt-get install cifs-utils\n```\n\nFor mouting the network drive you have to create a folder like with `sudo mkdir /mnt/RobotCar`. Then you can mount it with:\n\n```\nsudo mount -t cifs -o username=\u003cusername\u003e,password=\u003csamba password\u003e,uid=1000 //\u003chostname\u003e/\u003cfolder\u003e /mnt/RobotCar/\n```\n\nAs example with:\n\n```\nsudo mount -t cifs -o username=pi,password=robotcar,uid=1000 //robotcar/robotcar /mnt/RobotCar/\n```\n\nIf you loose the network connection it could be that you have redone the last step. After that it is possible to use as example [Visual Studio Code](https://code.visualstudio.com/docs/setup/linux) from your operating computer or control computer to change files on the RobotCar. \n\n### 3.4 Python and other installations\n\n#### 3.4.1 Python installations\n\nNormally Python should be installed on Raspbian. You can check it with `python3 --version`. If not you have to do following:\n\n```\n$ sudo apt-get update\n$ sudo apt-get install python3.7\n```\n\nFor Raspbian a Python library for using the GPIO Pins should be installed. If not, you can install it with:\n\n```\nsudo apt-get install python-rpi.gpio\n```\n\nIf you want to use pip you have to install it with:\n\n```\nsudo apt-get install python-pip\nsudo apt-get install python3-pip\n```\n\nAs example you can install via pip3 following:\n\n```\npip3 install readchar\npip3 install flask\n```\n\nThe readchar library could be used to read the input from the keyboard. The flask web framework could be used that the RobotCar as example could be used as a webserver. This could be helpful to control the RobotCar if you want to create a corresponding program.\n\n#### 3.4.2 Camera installations\n\nIf you want to create a test picture you could use:\n\n```\nraspistill -o testbild.jpg\n```\n\nThe picture testbild.jpg should be created in your current folder.\n\nIf you want to create a simple video of 20 seconds in the h264 codec you could run:\n\n```\nraspivid -o testvideo.h264 -t 20000\n```\n\nThe picture testvideo.h264 should be created in your current folder.\n\nFor using the raspicam without ROS you can install Cheese with:\n\n```\nsudo apt-get install cheese\n```\n\nMaybe a helpful installation could be he mjpg-streamer. It allows us to show a movie stream from the camera via a web based url. So you can see what the camera sees. This could be helpful to conrol the Robotcar.\n\nAt first you have to install following packages:\n\n```\nsudo apt-get install libjpeg8-dev\nsudo apt-get install cmake\n```\n\nThe you have to go to `cd /opt/` and download it with:\n\n```\nsudo wget https://custom-build-robots.com/mjpg-streamer.zip\n```\n\nAfter that you have to unzip the archive and open the unzipped folder and build the mjpg-streamer:\n\n```\ncd /opt/\nsudo unzip mjpg-streamer.zip\ncd mjpg-streamer\nsudo make\nsudo make install\n```\n\nThen you have to load the kernel module for Video4Linux driver version 2 (v4l2) with `sudo modprobe bcm2835-v4l2`.\n\nYou can check it with `sudo lsmod` or with `sudo nano /etc/modules`:\n\n```\ni2c-dev\nbcm2835-v4l2\n```\n\nThe we have to finde the Device name of the camera with `ls /dev/vid*`. This could be as example `/dev/video0`.\n\nTo configure the mjpg-streamer change it with `nano /opt/mjpg-streamer/start.sh` and extend the following line\n\n```\n./mjpg_streamer -i \"./input_uvc.so\" -o \"./output_http.so -w ./www\"\n```\n\nwith\n\n```\n./mjpg_streamer -i \"./input_uvc.so\" -d /dev/video0 -r 800x640 -f 25 -o \"./output_http.so -w ./www\" \n```\n\nSo you added the device video0 with resolution 800x640 and framerate 25.\n\nThe go to `cd /opt/mjpg-streamer/` enter `sudo modprobe bcm2835-v4l2` and restart it with `sudo sh ./start.sh`.\n\nNow you can see it under `http://\u003cip address of the robotcar\u003e:8080`\n\nThat it runs on every startup you have to copy it to `/etc/init.d` with `sudo cp /opt/mjpg-streamer.sh /etc/init.d/mjpg-streamer.sh`.\n\nThen change the execution permissions with `sudo chmod +x /etc/init.d/mjpg-streamer.sh`.\n\nEnter in rc.d for auto start\n\n```\nsudo update-rc.d mjpg-streamer.sh defaults\n```\n\nSign out again (dont do it, if you want it to run after the startup.)\n\n```\nsudo update-rc.d mjpg-streamer.sh remove\n```\n\nCheck if started\n\n```\nsudo reboot\nsystemctl list-units -t service\n```\n\nStart manually\n\n```\nsudo service mjpg-streamer.sh start\n```\n\nStop\n\n```\nsudo service mjpg-streamer.sh stop\n```\n\nRestart\n\n```\nsudo service mjpg-streamer.sh restart\n```\n\n#### 3.4.3 NTP client\n\nThe time can be synchronized via an NTP server using the NTP client. This can be installed as follows:\n\n```\nsudo apt-get install ntp\nsudo dpkg-reconfigure tzdata\n```\n\nThen you set the-timezone as example to Europe/Berlin with:\n\n```\nsudo timedatectl set-timezone Europe/Berlin\nsudo /etc/init.d/ntp restart\n```\n\nYou can check the time synchronization with:\n\n```\ndate\n```\n\nMaybe there are multiple NTP servers available. To check if it only uses one server you can run:\n\n```\nntpg -pn\n```\n\nIf there are more than one NTP server you can change it with `nano /etc/ntp.conf`:\n\n```\n# SHM 0\nserver 127.127.28.0\nfudge 127.127.28.0 refid GPSa\n# SHM 1\nserver 127.127.28.1\nfudge 127.127.28.1 refid GPSp\n```\n\nIn the given example you can delete one entry. After that you have to restart it again and check again if there is only one server:\n\n```\nsudo /etc/init.d/ntp restart\nntpq -pn\n```\n\n#### 3.4.4 I2C\n\nWe need the I2C bus of the raspberry pi. After enabling it we have to instal it with:\n\n```\nsudo apt-get install i2c-tools\nsudo apt-get install python-smbus\n```\n\nTo check if it is working and if connected devices could be found you can run:\n\n```\ni2cdetect -y 1\n```\n\n#### 3.4.5 GPS\n\nThe necessary GPS programs such as the Python libraries, the gpsd daemon server and the xGPS program are all installed on your Raspberry Pi together with the following command:\n\n```\nsudo apt-get install gpsd gpsd-clients python-gps\nsudo apt-get install python-gi-cairo\n```\n\nFurther informations you can found [here](https://wiki.52pi.com/index.php/USB-Port-GPS_Module_SKU:EZ-0048).\n\nEnable it: `sudo systemctl enable gpsd.socket`\nStart it: `sudo systemctl start gpsd.socket`\nRestart it: `sudo systemctl restart gpsd.socket`\nCheck status: `sudo systemctl status gpsd.socket`\n\nModify the \"DEVICE\" parameter according to the name of serial port in /dev folder. It is usually named \"/dev/ttyUSB0\" if you connect it to Raspberry Pi via USB cable.\n\n```\nsudo nano /etc/default/gpsd\n```\n\nAs example you can see something like this:\n\n```\n# Default settings for the gpsd init script and the hotplug wrapper.\n\n# Start the gpsd daemon automatically at boot time\nSTART_DAEMON=\"true\"\n\n# Use USB hotplugging to add new USB devices automatically to the daemon\nUSBAUTO=\"true\"\n\n# Devices gpsd should collect to at boot time.\n# They need to be read/writeable, either by user gpsd or the group dialout.\nDEVICES=\"/dev/ttyUSB0\"\n\n# Other options you want to pass to gpsd\nGPSD_OPTIONS=\"-F /var/run/gpsd.sock\"\n```\n\nThe restart the service with `sudo systemctl restart gpsd.socket`\n\nFinally, use this command to get information from GPS module:\n\n```\nsudo cgps -s\n```\n\nStart the gpsd server daemon with the following command in the terminal window:\n\n```\nsudo gpsd -b /dev/ttyACM0 -F /var/run/gpsd.sock -G\n```\n\nYou could test the gps with the gps-test.py file inside robotcar/test:\n\n```\nsudo python3 gps-test.py\n```\n\n#### 3.4.6 Sense HAT\n\nIn order to be able to calibrate the magnetometer of the Raspberry Pi Sense HAT later, you must install the Octave programme. Octave is an interactive scripting language which can be used to solve problems from numerical mathematics together with the Raspberry Pi Sense HAT, e.g. calculating the local magnetic field of the earth.\n\n```\nsudo apt-get install octave\n```\n\nFurther informations to the Sense HAT you can found [in the API](https://pythonhosted.org/sense-hat/). You have to install and restart the Sense HAT with following commands:\n\n```\nsudo apt-get install sense-hat\nsudo reboot\n```\n\nThe magnetometer must be calibrated for the respective place of use, since the earth's magnetic field is location-dependent and there may also be interference from the environment. You can do it with:\n\n```\ncd /usr/share/librtimulib-utils/RTEllipsoidFit\nsudo RTIMULibCal\n```\n\nThen you have to press \u003ckbd\u003em\u003c/kbd\u003e for `calibrate Magnetometer`.\n\nThen roll, turn and tilt the RobotCar as described.\nRepeat the various movements alternately until the numbers in the terminal window no longer change. The sequence of the turn, tilt and roll movements is irrelevant. If the numbers remain the same, calibration is complete and by entering the letter \u003ckbd\u003eS\u003c/kbd\u003e you save the recorded data in the configuration file RTIMULib.ini. Then press \u003ckbd\u003eX\u003c/kbd\u003e to exit the RTIMULibCal program.\n\nTo do this, press key \u003ckbd\u003eA\u003c/kbd\u003e, follow the description displayed and calibrate the accelerometer in the same steps as you did for the magnetometer.\nCreates `/usr/share/librtimulib-utils/RTEllipsoidFit/RTIMULib.ini`. Copy it with `cp /usr/share/librtimulib-utils/RTEllipsoidFit/ /etc/RTIMULib.ini`.\nThe RTIMULib.ini file is expected by the Sense-HAT-API in the `/etc/` folder. If you use the Sense-HAT-API in a Python program that also uses the magnetometer and accelerometer, the RTIMULib.ini file is read from there.\n\nThe Raspberry-Pi-Sense-HAT-API creates a copy of the file RTIMULib.ini in the folder `/home/pi/.config/sense_hat`. Always delete the RTIMULib.ini file there when you have performed a new calibration.\n\nThe program display updates every 0.1 seconds and shows you how much the orientation of the robot car deviates from the north. By turning the robot car, you can orient it towards the south.\n\n#### 3.4.7 Additional text editor like Code-OSS\n\nCode OSS is nearly the same as Visual Studio Code. It could be installed as alternative text editor on the Raspberry Pi like following:\n\n```\nwget https://packagecloud.io/headmelted/codebuilds/gpgkey -O - | sudo apt-key add\ncurl -L https://code.headmelted.com/installers/apt.sh | sudo bash\n```\n\nIf this does not work try it with:\n\n```\nwget -o - https://packagecloud.io/headmelted/codebuilds/gpgkey| sudo apt-key add -\nsudo apt-get install code-oss=1.29.0-1539702286\n```\n\nYou can open and edit a Python program with `code-oss \u003cfilename.py\u003e` like `code-oss main.py`.\n\n### OpenCV and TensorFlow inside virtualenv\n\nIn order to share ROS, OpenCV and TensorFlow, a virtual environment must be created using Python 3. Unfortunately, the Edge TPU only works with Python 3, which means TensorFlow. ROS, on the other hand, only works under Python 2, but with a workaround it also works under Python 3. OpenCV can be run under Python 2 and Python 3 just like TensorFlow. However, the Edge TPU is required as a co-processor for TensorFlow, otherwise the performance would be insufficient.\n\nFirst of all we install a few packages to resolve dependencies:\n\n```\nsudo apt-get install libhdf5-dev -y \u0026\u0026 sudo apt-get install libhdf5-serial-dev -y \u0026\u0026 sudo apt-get install tflibatlas-base-dev -y \u0026\u0026 sudo apt-get install libjasper-dev -y \u0026\u0026 sudo apt-get install libqtgui4 -y \u0026\u0026 sudo apt-get install libqt4-test -y\n```\n\nOpenCV cannot be used in one of the 4 versions due to ROS. Therefore we install it in the following version:\n\n```\npip3 install opencv-python==3.4.3.18\n```\n\nAfter that we install with `pip3 install matplotlib` matplotlib.\n\nWe can check the installation with:\n\n```\npython3 -c \"import cv2\"\npython3 -c \"import numpy\"\npython3 -c \"import matplotlib\"\n```\n\nThen we install the Edge TPU driver:\n\n```\necho \"deb https://packages.cloud.google.com/apt coral-edgetpu-stable main\" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list\ncurl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add –\nsudo apt-get update\nsudo apt-get install libedgetpu1-std\nsudo apt-get install libedgetpu1-max\nsudo apt-get install python3-edgetpu\n```\n\nThis would allow OpenCV and TensorFlow to be used outside a virtual environment. So you can run or test programs separately.\n\nIn the next step we install virtualenv and the virtualenvwrapper:\n\n```\nsudo pip install virtualenv virtualenvwrapper==4.8.4\n```\n\nIn the `.bashrc` file we add something like this:\n\n```\n# virtualenv and virtualenvwrapper\nexport WORKON_HOME=$HOME/.virtualenvs\nexport VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.7\nsource /usr/local/bin/virtualenvwrapper.sh\nworkon robotcar\n```\n\nThen we create our virtualenv called robotcar:\n\n```\nmkvirtualenv robotcar -p python3\n```\n\nYou can check the installation with:\n\n```\ncd ~/.virtualenvs/coral/lib/python3.7/site-packages\nln -s /usr/lib/python3/dist-packages/edgetpu/ edgetpu\n```\n\nThen you have to activate the virtualenv with:\n\n```\nworkon robotcar\n```\n\nNow you can use pip instead of pip3 or python instead of python3 because the virtualenv runs only under Python 3.\n\nAfterwards some more packages have to be installed...\n\n```\npip install \"picamera[array]\"\npip install opencv-python==3.4.3.18\npip install matplotlib\npip install imutils\npip install tensorflow==2.0.0\npip install keras –no-use-pep517\npip install pillow\npip install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_armv7l.whl\n```\n\nThen we have to create a folder where we want to install TensorFlow Lite (tflite). It's the mobile Version of TensorFlow whiche are used on the TPU.\n\n```\nmkdir coral \u0026\u0026 cd coral\ngit clone https://github.com/google-coral/tflite.git\ncd tflite/python/examples/classification\nbash install_requirements.sh\n```\n\nYou can test this installation with:\n\n```\npython3 classify_image.py \\\n--model models/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \\\n--labels models/inat_bird_labels.txt \\\n--input images/parrot.jpg\n```\n\n## 4 Simulation Platform\n=====================\n\nThe simulation platform uses four differents software modules which also needs further catkin packages.\n\n|   Software Module  |    System   |      Description       |\n|------------------- | ------------|------------------------|\n| [robotcar](https://github.com/Michdo93/robotcar) | RobotCar | The robotcar module provides all drivers for actors and sensors. Also it provides all needed Libraries and configurations. Filters like the kalman filter are also provided. Programs for configuring and resetting the sensors are available as well as for testing the motor and controller. Service files for systemd and start-up are also available. This software module implements the functionality of the robot car. |\n| [robotcar-pkg](https://github.com/Michdo93/robotcar-pkg) | RobotCar | Via the ROS Publisher-Subscriber pattern, the robotcar-pkg enables the exchange of information. Publishers provide the information to ADAS and via subscriber an ADAS can intervene in the driving of the robot car. This software module therefore enables the necessary communication for the functionality. |\n| [robotcar_controller](https://github.com/Michdo93/robotcar_controller) | control computer respectively operating computer | The controller forwards appropriate control commands to the robot car, which should make it possible to move the robot car purposefully. For this purpose, primarily the motor and the steering are controlled. An extension, for example to move the camera or switch ADAS on and off, would be conceivable in the future. |\n| [robotcar_msgs](https://github.com/Michdo93/robotcar_msgs) | Robotcar and control computer respectively operating computer | The robotcar_msgs extend the ROS message types with custom message types for complete communication. For new ADAS these may have to be extended. On every computer that wants to participate in the communication, these must be installed additionally. |\n\nFurther packages:\n\n* With the [beginner_tutorials](https://github.com/Michdo93/beginner_tutorials) you can learn the basic concepts of the RobotCar.\n* With the [robotcar_subscriber](https://github.com/Michdo93/robotcar_subscriber) you can subscribe different informations from the RobotCar. It could be used as blue print for ADAS.\n* With the [robotcar_sensorfusion_examples](https://github.com/Michdo93/robotcar_sensorfusion_examples) you can learn how to use as example a simple kalman filter for sensor fusion. It could be used as blue print for ADAS.\n* The [std_header_msgs](https://github.com/Michdo93/std_header_msgs) could be used as example for sensor fusion because the sensor fusion needs timestamps which are missing in the [std_msgs](http://docs.ros.org/en/melodic/api/std_msgs/html/index-msg.html) from ROS.\n* The [raspicam_node](https://github.com/Michdo93/raspicam_node) is needed to use the raspicam with ROS. So the robot car definitely needs this package.\n* The [raspicam_node_saver](https://github.com/Michdo93/raspicam_node_saver) is needed to save frames from the [raspicam_node](https://github.com/Michdo93/raspicam_node) as individual JPEG frames or as avi video. It can therefore be used, for example, to record training data for machine learning.\n* The [robotcar_plotter](https://github.com/Michdo93/robotcar_plotter) shows various curves for sensor information or diagrams for the position and orientation of the RobotCar, e.g. compass or 3D gyroscope, etc.\n\n### 4.1 Configuration\n\n#### 4.1.1 Configurations on the operating computer\n\nAfter the installation of the necessary software and frameworks, basic precautions have to be taken for the simulation platform so that the operating computer and RobotCar can find each other in the network, ROS can be used accordingly in the command line and the virtual environment OpenCV and TensorFlow, as well as other packages can be integrated. For this purpose, the virtual environment is started and each terminal window executes it automatically.\n\nSo we edit our terminal configuration with sudo ~/.bashrc:\n\n```\nexport WORKON_HOME=$HOME/.virtualenvs\nexport VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3\nsource /usr/local/bin/virtualenvwrapper.sh\n\nworkon coral\n\nsource /opt/ros/melodic/setup.bash\nsource /home/ros/catkin_ws/devel/setup.bash\n. ~/catkin_ws/devel/setup.bash\n\nexport ROS_HOSTNAME=\"$(hostname -f)\"\nexport ROS_MASTER_URI=http://\"$(hostname -f)\":11311\nexport ROS_IP=\"$(hostname -I | awk '{print $1;}')\"\nexport ROS_PYTHON_VERSION=3\n```\n\nAs example it works on a virtualenv named coral.\n\n#### 4.1.2 Configurations on the RobotCar\n\nThe same applies to the robot car as to the operating computer. There are a few small changes.\n\nSo we edit our terminal configuration with sudo ~/.bashrc:\n\n```\n# virtualenv and virtualenvwrapper\nexport WORKON_HOME=$HOME/.virtualenvs\nexport VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3\nsource /usr/local/bin/virtualenvwrapper.sh\n\n#workon robotcar\nsource $WORKON_HOME/robotcar/bin/activate\n\n#export PATH=/usr/bin/python2.7:$PATH\n\nsource /opt/ros/melodic/setup.bash\nsource /home/pi/catkin_ws/devel/setup.bash\n\n\nexport ROS_HOSTNAME=\"$(hostname -f)\"\nexport MASTER_URI_NAME=ros-melodic-master\nexport ROS_MASTER_URI=http://$MASTER_URI_NAME:11311\n#export ROS_MASTER_URI=http://141.28.75.144:11311\nexport ROS_IP=\"$(hostname -I | awk '{print $1;}')\"\n```\n\nYou work on a virtualenv called robotcar.\n\nIf multiple RobotCars are available you have to [change the hostname](https://tunethepi.de/hostname-am-raspberry-pi-aendern/).\n\n### 4.2 Installation\n\n#### 4.2.1 Installations on the operating computer\n\nYou have to go into the src folder of your catkin workspace with `cd ~/catkin_ws/src` and clone following repositories:\n\n```\ngit clone https://github.com/Michdo93/robotcar_controller.git\ngit clone https://github.com/Michdo93/robotcar_msgs.git\ngit clone https://github.com/Michdo93/beginner_tutorials.git\ngit clone https://github.com/Michdo93/robotcar_subscriber.git\ngit clone https://github.com/Michdo93/robotcar_sensorfusion_examples.git\n```\n\n#### 4.2.2 Installations on the RobotCar\n\nAt first we want to clone this repository. For this we go to the root directory with `cd ~` and clone it with:\n\n```\nhttps://github.com/Michdo93/robotcar.git\n```\n\nThen we have to install the necessary libraries. So we go `/robotcar/lib` with `cd robotcar/lib`. You have to make sure that you are inside of the virtualenv. If not you have to enter `workon robotcar`.\n\nAt first we began with the [MCP3008 library](https://github.com/adafruit/Adafruit_Python_MCP3008/):\n\n```\ncd Adafruit_Python_MCP3008\nsudo python setup.py install\n```\n\nAfter that we have to install the [Adafruit_Python_SSD1306 library](https://github.com/adafruit/Adafruit_Python_SSD1306/):\n\n```\ncd ../Adafruit_Python_SSD1306\nsudo python setup.py install\n```\n\nThen we install the [piVirtualWire library](https://github.com/DzikuVx/piVirtualWire/):\n\n```\ncd ../piVirtualWire\nsudo apt-get install pigpio\nsudo systemctl start pigpiod\nsudo systemctl enable pigpiod\n```\n\nThe we want to install the [vl53l1x-python library](https://github.com/pimoroni/vl53l1x-python/) for our Time-of-Flight sensors:\n\n```\ncd ../vl53l1x-python\nsudo python setup.py install\n```\n\nAt least we install an older version of the [Adafruit_Python_PCA9685 library](https://github.com/adafruit/Adafruit_Python_PCA9685):\n\n```\ncd ../Adafruit_Python_PCA9685-master\nsudo python setup.py install\n```\n\nAfter that we create the startup of the robotcar. We could go to `/robotcar/startup`. You have to execute:\n\n```\nsudo cp ~/robotcar/startup/robotcar.service /etc/systemd/system/robotcar.service\nsudo cp ~/robotcar/startup/clear.service /etc/systemd/system/clear.service\n\ncd /etc/systemd/system/\n\nsudo systemctl enable robotcar.service\nsudo systemctl enable clear.service\n```\n\nYou can control the service files with:\n\n```\nsudo systemctl start robotcar.service\nsudo systemctl stop robotcar.service\nsudo systemctl enable robotcar.service\nsudo systemctl disable robotcar.service\n\nsudo systemctl start clear.service\nsudo systemctl stop clear.service\nsudo systemctl enable clear.service\nsudo systemctl disable clear.service\n```\n\nThe service files switch off the LEDs of the Sense HAT, resolve the I2C conflict of both ToF sensors and show on the OLED display the host name, IP address and the user name of the robot car where the files clear.py, vl53l1x.py and robot.py are executed at system startup.\n\nNext, we go into the src directory of the Catkin workspace with cd ~/catkin_ws/src and clone all necessary repositories:\n\n```\ngit clone https://github.com/Michdo93/robotcar-pkg.git\ngit clone https://github.com/Michdo93/robotcar_msgs.git\ngit clone https://github.com/Michdo93/beginner_tutorials.git\ngit clone https://github.com/Michdo93/robotcar_subscriber.git\ngit clone https://github.com/Michdo93/robotcar_sensorfusion_examples.git\ngit clone https://github.com/Michdo93/std_header_msgs.git\n```\n\nThe [raspicam_node](https://github.com/Michdo93/raspicam_node) should be installed during the ROS installation. If not you can clone it with:\n\n```\nhttps://github.com/Michdo93/raspicam_node.git\n```\n\nNow everything should be installed.\n\nAs last step you can configurate the servos of the steering and pan-tilt-bracket by running (inside the robotcar folder):\n\n```\npython configurate_servos.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichdo93%2Frobotcar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichdo93%2Frobotcar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichdo93%2Frobotcar/lists"}