---
# System prepended metadata

title: ADAS Tests on E2O

---

# ADAS Tests on E2O
- Generally we have two type of ADAS feature, one is FCW(Forward Collision Warning) and another is TLW (Traffic Light Warning). Till ***"Running LIDAR and Camera"*** the process is same for FCW and TLW. But after that specific commands needs to be followed.
- FCW uses yolov5 object detection from the package "object_Detection".
- TLW uses yolop for traffic light detection, provided in the package "yolop".


## Systems

|          IP          |   Hostname   | Password  | Used For                         |
|:--------------------:|:------------:|:--------- |:-------------------------------- |
|  nuc@192.168.1.101   | nuc-planner  | nuc       | ROS Master, Localization, Estimation, P&C, Reverse planner, Behavior Tree   |
|  ~~nuc3@192.168.1.201~~  |  ~~nuc3-yolo~~  | ~~nuc3-yolo~~ | ~~RoadPlane estimation~~             |
|  nuc2@192.168.1.200  | nuc2-desktop | nuc3456   | Connected to CAN, runs Ubuntu 18 |
|  nuc@192.168.1.202   |    nuc-pc    | nuc       | Floam and ALiVE Android App      |
| nvidia@192.168.1.203 |    ubuntu    | orin@agx  | GPU - AGX runs yolop model       |
| jetson@192.168.1.204 |    jetson    | jetson    | GPU - Runs YOLOv5, Tracking, Rear Collision Warning |



For adding a new system to E2O, check [this](https://hackmd.io/vAJwMddzSa2sfbOgV2JDZw).

Switch on power supply and all nucs, including  the one near CAN
On nuc-planner
```bash!
roscore
# do not let roscore shutdown till you shutdown the car
# new-terminal
cd alive-dev
# perform necessary git commands
# below uses ssh -X and gives terminal windows to monitor all systems
./top_level_build.bash 
```


## Setting up CAN 
On nuc2-desktop
```bash!
sudo ip link add can0 type can
sudo -S ip link set can0 type can bitrate 500000
sudo -S ip link set can0 up
# green light should blink on the usb can interface connected in the front of the car
```
IF ANY OF THE ABOVE STEPS ERRORS:
1. Plug in the USB properly and retry from top
2. Load systec_can as shown below and retry from top
    ```bash!
    # from https://www.systec-electronic.com/en/company/support/driver
    cd systeccan
    make -j4
    sudo make firmwareinstall
    sudo make modulesinstall
    sudo modprobe systeccan
    ```

## Running CAN
On nuc2-desktop
```bash!
cd alive-dev
rosrun can can_node
# dumps a lot of stuff to terminal
# open new terminal
python src/e2o/scripts/e2o_odom.py
rostopic hz /odom_can
# should be 100
```

## Running LIDAR and Camera
On nuc-planner
```bash!
cd alive-dev/sensor_setup
roslaunch all_sensors.launch platform:=car
```


## Run FCW (Forward Collision Warning):
On Orin-ubuntu

```bash!
# new-terminal
python src/adas_offshoots/scripts/fcw_campus.py

# new-terminal
roslaunch object_detection od_distance_tracking_fcw.launch simulation_state:=false use_sim_time:=false
```


## Run TLW (Traffic Light Warning):
On Orin-ubuntu

```bash!
# new-terminal
roslaunch yolop yolop_tlw.launch simulation_state:=false

# new-terminal
python src/adas_offshoots/scripts/tlw_campus.py

```

## Visualization:
On nuc-planner

```bash!
rviz #[subscribe to /warning_image_topic]
```