The CornerGuard: Seeing around Corners to Prevent Broadside Collisions
Abstract
:1. Introduction
2. Materials and Methods
2.1. System Overview
2.2. Doppler Effect
2.3. The Reflector
2.4. Procedure
- Programming and integrating the radar sensor. Connect a radar sensor and an OBD device to a laptop computer (Figure 1). Write a Python program to communicate with the radar sensor and OBD via USB communication ports.
- Designing and building the stationary reflector. Secure a flexible aluminum sheet to a hardboard with screws to form the reflective surface, and bend it using paracord as bowstrings to form a arc surface (Figure 2). Secure the surface to a sharpened wooden plank to form a stake.
- Collecting and analyzing data. Record the speeds, distances, and angles of objects detected by the radar sensor in tests. Use an OBD package to constantly read the car’s speed. Compare the reading with the speeds of the objects detected by the radar sensor in the program. Save all data to a text file. If the speed of an object detected by the radar sensor is greater than the instantaneous speed of the car read by the OBD, save the detection data to a separate text file.
3. Results and Discussions
3.1. Range and Blind Spot Assessment
3.2. Simulation Assessment
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Appendix A. Code
- # Script to read out raw target data from RFbeam K-LD7 and speed of car
- $ from OBD2, detect approaching object around corner, and save data
- # to files
- #
- # Author: Victor Xu, Sheng Xu
- # Date: Nov and Dec 2023
- # Python Version: 3#
- # Notes: Use correct COM Port (specifed by port properties
- # in device manager (in Windows) for each serial device
- # and make sure all modules are installed before executing
- import time
- import serial
- import matplotlib.pyplot as plt
- import numpy as np
- import math
- import obd
- import re
- import winsound
- print(’Start tracking!’)
- # specify runtime, data file names
- runtime = 0.5 # minutes
- speederror = -3 # km/h
- dur = 1000 # milisecond, duration of alerting sound
- allobjfile = ’allobj282.txt’ # all objects
- detectedobjfile = ’detectedobj282.txt’ # target object
- # specify correct COM USB ports for serial devices
- COM_Port = ’COM8’ # port for radar sensor
- OBD_Port = ’COM9’ # port for OBD2
- # create serial object with corresponding COM Port and open it
- com_obj=serial.Serial(COM_Port)
- print(com_obj)
- com_obj.baudrate=115200
- com_obj.parity=serial.PARITY_EVEN
- com_obj.stopbits=serial.STOPBITS_ONE
- com_obj.bytesize=serial.EIGHTBITS
- # connect to sensor and set baudrate
- payloadlength = (4).to_bytes(4, byteorder=’little’)
- value = (0).to_bytes(4, byteorder=’little’)
- header = bytes(“INIT”, ’utf-8’)
- cmd_init = header+payloadlength+value
- com_obj.write(cmd_init)
- # get response
- response_init = com_obj.read(9)
- if response_init[8] != 0:
- print(’Error during initialisation for K-LD7’)
- else:
- print(’K-LD7 successfully initialized!’)
- # delay 75ms
- time.sleep(0.075)
- # change to higher baudrate
- com_obj.baudrate = 115200
- # change max speed to 50km/h
- value = (2).to_bytes(4, byteorder=’little’)
- header = bytes(“RSPI”, ’utf-8’)
- cmd_frame = header+payloadlength+value
- com_obj.write(cmd_frame)
- # get response
- response_init = com_obj.read(9)
- if response_init[8] != 0:
- print(’Error: Command not acknowledged’)
- else:
- print(’Max speed successfully set!’)
- # change max range to 100m
- value = (3).to_bytes(4, byteorder=’little’)
- header = bytes(“RRAI”, ’utf-8’)
- cmd_frame = header+payloadlength+value
- com_obj.write(cmd_frame)
- # get response
- response_init = com_obj.read(9)
- if response_init[8] != 0:
- print(’Error: Command not acknowledged’)
- else:
- print(’Max distance successfully set!’)
- # create figure for real-time plotting
- fig = plt.figure(figsize=(10,5))
- plt.ion()
- plt.show()
- starttime=time.time()
- connection = obd.OBD(OBD_Port) # create connection with USB 0
- print(’OBD2 successfully connected!’)
- detobj = open(detectedobjfile,’w’)
- allobj = open(allobjfile,’w’)
- # readout and plot PDAT data continuously
- # for ctr in range(100):
- while 1:
- # request next frame data
- PDAT = (4).to_bytes(4, byteorder=’little’)
- header = bytes(“GNFD”, ’utf-8’)
- cmd_frame = header+payloadlength+PDAT
- com_obj.write(cmd_frame)
- # get acknowledge
- resp_frame = com_obj.read(9)
- if resp_frame[8] != 0:
- print(’Error: Command not acknowledged’)
- # get header
- resp_frame = com_obj.read(4)
- # get payload len
- resp_len = com_obj.read(4)
- # initialize arrays
- distances_x = np.zeros(100)
- distances_y = np.zeros(100)
- speeds = np.zeros(100)
- distances = np.zeros(100)
- angles = np.zeros(100)
- i = 0
- length = resp_len[0]
- # get data, until payloadlen is zero
- while length > 0:
- PDAT_Distance = np.frombuffer(com_obj.read(2), dtype=np.uint16)
- PDAT_Speed = np.frombuffer(com_obj.read(2), dtype=np.int16)/100
- PDAT_Angle = math.radians(np.frombuffer(com_obj.read(2),\
- dtype=np.int16)/100)
- PDAT_Magnitude = np.frombuffer(com_obj.read(2), dtype=np.uint16)
- distances_x[i] = -(PDAT_Distance * math.sin(PDAT_Angle))/100
- distances_y[i] = PDAT_Distance * math.cos(PDAT_Angle)/100
- distances[i] = PDAT_Distance/100
- speeds[i] = PDAT_Speed
- angles[i] = math.degrees(PDAT_Angle)
- i = i + 1
- # subtract stored datalen from payloadlen
- length = length - 8
- # current time
- lapsedtime = time.time()-starttime
- # read car speed from obd and convert it to float
- cmd = obd.commands.SPEED # select an OBD command (sensor)
- response = connection.query(cmd) # send the command,
- # and parse the response
- speedstring = str(response.value)
- print(speedstring) # in km/h
- speedstr=re.findall(r"[-+]?\d*\.?\d+|[-+]?\d+",speedstring)[0]
- carspeed=-float(speedstr)
- print(carspeed)
- # clear figure
- plt.clf()
- # plot speed/distance
- if np.count_nonzero(distances)==0:
- print(lapsedtime,carspeed,0.0,0.0,0.0,sep=’,’,end=’\n’,file=allobj)
- print(lapsedtime,carspeed,0.0,0.0,0.0,sep=’,’,end=’\n’,file=detobj)
- sub1 = plt.subplot(121)
- for j in range(np.count_nonzero(distances)):
- print(lapsedtime,carspeed,speeds[j],distances[j],angles[j],\
- sep=’,’,end=’\n’,file=allobj)
- if speeds[j]<carspeed+speederror:
- print(“Approaching object around corner detected!”)
- freq = 1000
- if distances[j]<5:
- freq = 3000 # Hz, sound frequency
- winsound.Beep(freq,dur)
- print(lapsedtime,carspeed,speeds[j],distances[j],angles[j],\
- sep=’,’,end=’\n’,file=detobj)
- else:
- print(lapsedtime,carspeed,0.0,0.0,0.0,sep=’,’,end=’\n’,\
- file=detobj)
- point_Sub1, = sub1.plot(speeds[j],distances[j],\
- marker=’o’,markersize=15, markerfacecolor=’b’,\
- markeredgecolor=’k’)
- plt.grid(True)
- plt.axis([-75, 75, 0, 100])
- plt.title(’Distance / Speed’)
- plt.xlabel(’Speed [km/h]’)
- plt.ylabel(’Distance [m]’)
- # plot distance/distance
- sub2 = plt.subplot(122)
- for y in range(np.count_nonzero(distances_x)):
- if speeds[y] > 0 :
- point_Sub2, = sub2.plot(distances_x[y], distances_y[y],\
- marker=’o’, markersize=15,markerfacecolor=’g’,\
- markeredgecolor=’k’)
- else:
- point_Sub2, = sub2.plot(distances_x[y], distances_y[y],\
- marker=’o’,markersize=15,markerfacecolor=’r’,\
- markeredgecolor=’k’)
- plt.grid(True)
- plt.axis([-10, 10, 0, 100])
- plt.title(’Distance / Distance \n (Green: Receding, Red: Approaching)’)
- plt.xlabel(’Distance [m]’)
- plt.ylabel(’Distance [m]’)
- # draw no. of targets
- plt.text(0.8, 0.95,’No. of targets: ’ +
- \str(np.count_nonzero(distances)), horizontalalignment=’center’,\
- verticalalignment=’center’, transform = sub2.transAxes)
- # draw figure
- fig.canvas.draw()
- fig.canvas.flush_events()
- # reset arrays
- distances_x = np.zeros(100)
- distances_y = np.zeros(100)
- speeds = np.zeros(100)
- distances = np.zeros(100)
- i = 1
- # exit when time is up
- if lapsedtime>runtime*60: #lapsed time>runtime in minutes
- print(’Trial ends!’)
- break
- # close files
- detobj.close()
- allobj.close()
- # disconnect from sensor
- payloadlength = (0).to_bytes(4, byteorder=’little’)
- header = bytes(“GBYE”, ’utf-8’)
- cmd_frame = header+payloadlength
- com_obj.write(cmd_frame)
- # get response
- response_gbye = com_obj.read(9)
- if response_gbye[8] != 0:
- print(“Error during disconnecting with K-LD7”)
- # close connection to COM port
- com_obj.close()
References
- Kilduff, E. Where Do Broadside Collisions Most Commonly Occur? 2021. Available online: https://emrochandkilduff.com/where-broadside-collisions-occur/ (accessed on 12 June 2024).
- Ahmed, S.K.; Mohammed, M.G.; Abdulqadir, S.O.; El-Kader, R.G.A.; El-Shall, N.A.; Chandran, D.; Rehman, M.E.U.; Dhama, K. Road traffic accidental injuries and deaths: A neglected global health issue. Health Sci. Rep. 2023, 6, e1240. [Google Scholar] [CrossRef]
- Ma, Y.; Anderson, J.; Crouch, S.; Shan, J. Moving Object Detection and Tracking with Doppler LiDar. Remote Sens. 2019, 11, 1154. [Google Scholar] [CrossRef]
- Vivet, D.; Checchin, P.; Chapuis, R.; Faure, P.; Rouveure, R.; Monod, M.O. A mobile ground-based radar sensor for detection and tracking of moving objects. EURASIP J. Adv. Signal Process. 2012, 2012, 45. [Google Scholar] [CrossRef]
- Singh, S.; Liang, Q.; Chen, D.; Sheng, L. Sense through wall human detection using UWB radar. EURASIP J. Wirel. Commun. Netw. 2011, 2011, 20. [Google Scholar] [CrossRef]
- Gennarelli, G.L.; Soldovieri, F. Real-Time Through-Wall Situation Awareness Using a Microwave Doppler Radar Sensor. Remote Sens. 2016, 8, 621. [Google Scholar] [CrossRef]
- Gariepy, G.; Tonolini, F.; Henderson, R.; Leach, J.; Faccio, D. Detection and tracking of moving objects hidden from view. Nat. Photonics 2016, 10, 23–26. [Google Scholar] [CrossRef]
- Chan, S.; Warburton, R.E.; Gariepy, G.; Leach, J.; Faccio, D. Non-line-of-sight tracking of people at long range. Opt. Express 2017, 25, 10109–10117. [Google Scholar] [CrossRef] [PubMed]
- Faccio, D.; Velten, A.; Wetzstein, G. Non-line-of-sight imaging. Nat. Rev. Phys. 2020, 2, 318–327. [Google Scholar] [CrossRef]
- Czajkowski, R.; Murray-Bruce, J. Two-edge-resolved three-dimensional non-line-of-sight imaging with an ordinary camera. Nat. Commun. 2024, 15, 1162. [Google Scholar] [CrossRef] [PubMed]
- Johansson, T.; Örbom, A.; Sume, A.; Rahm, J.; Nilsson, S.; Herberthson, M.; Gustafsson, M.; Andersson, Å. Radar measurements of moving objects around corners in a realistic scene. Proc. SPIE 2014, 9077, 90771Q. [Google Scholar] [CrossRef]
- Yue, S.; He, H.; Cao, P.; Zha, K.; Koizumi, M.; Katabi, D. CornerRadar: RF-Based Indoor Localization Around Corners. Proc. ACM Interact. Mob. Wearable Ubiquitous Technol. 2022, 6, 1–24. [Google Scholar] [CrossRef]
- Wolf, G.; Gasper, E.; Stoke, J.; Kretchman, J.; Anderson, D.; Czuba, N.; Oberoi, S.; Pujji, L.; Lyublinskaya, I.; Ingram, D.; et al. Section 17.4: The Doppler Effect. In College Physics 2e. for AP Courses; OpenStax, Rice University: Houston, TX, USA, 2022; ISBN-13: 978-1-951693-61-9; Available online: https://openstax.org/details/books/college-physics-ap-courses-2e (accessed on 12 June 2024).
- Helliar, R. Measuring Latency from Radar Interfacing to Display. 2024. Available online: https://www.unmannedsystemstechnology.com/feature/measuring-latency-from-radar-interfacing-to-display/ (accessed on 12 June 2024).
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Xu, V.; Xu, S. The CornerGuard: Seeing around Corners to Prevent Broadside Collisions. Vehicles 2024, 6, 1468-1481. https://doi.org/10.3390/vehicles6030069
Xu V, Xu S. The CornerGuard: Seeing around Corners to Prevent Broadside Collisions. Vehicles. 2024; 6(3):1468-1481. https://doi.org/10.3390/vehicles6030069
Chicago/Turabian StyleXu, Victor, and Sheng Xu. 2024. "The CornerGuard: Seeing around Corners to Prevent Broadside Collisions" Vehicles 6, no. 3: 1468-1481. https://doi.org/10.3390/vehicles6030069
APA StyleXu, V., & Xu, S. (2024). The CornerGuard: Seeing around Corners to Prevent Broadside Collisions. Vehicles, 6(3), 1468-1481. https://doi.org/10.3390/vehicles6030069