Exercise 5: Field data acquisition and analysis

n58h2r發表於2024-10-03

Exercise 5: Field data acquisition and analysis

October 7, 2024

Introduction

In this assignment you will be using your knowledge on safety measures and signal processing to analyzereal-world data collected in the field. The aim of this assignment is to investigate how vulnerable roadusers (VRUs) interact. This assignment consists of two parts. In the first part, you will be collecting datawith the LIDAR. In the second part you will analyze the data you collected to model VRUs interactions.In this assignment you will be using MATLAB.

Note: You are encouraged to discuss your solutions with others but you must write and submit yourown code implementation and answers.

Deadline: October 21, 2024 (23:59)

Learning objectives After having performed this assignment, you shall be able to:

  • Collect real-world data in real world from a LIDAR based system
  • Process and filter LIDAR data
  • Calculate safety indicators to create a simple model for the interaction between VRUs
  • Select parameters to design a collision warning system

Preparations

  1. Download the material from Canvas. Exercise.m is the template script to solve the second part ofthe assignment. The script contains some guidelines to complete the exercise. The file playLidar.ms the toolkit to visualize the collected data. The file bag2csv.m contains a function to convert theTME192 - Active safety Page 1file that contains the LIDAR measurement (.bag) into a comma separated values (.csv) file that onlycontains LIDAR data. The file importLidarData.m contains a function to import the .csv datainto MATLAB.
  1. You have the choice to collect your own data on campus (see info on Canvas), or to work with thedata from a previous year (2018-10-24-11-11-25_0.bag).
  1. We are using the Robot Operating System (ROS) to record the LIDAR data with our data loggingplatform1 . To be able to read the recorded data in MATLAB, you need to have the ROS Toolbox2nstalled.

Tasks

Part A - Data collection

Instructions to collect the data will be given in class. The instructions will include the description of theLIDAR-based platform and how to operate it. You will be outside with the teaching assistants to collectLIDAR data using a handheld LIDAR device. By holding the LIDAR in front of you and approachingpedestrians (this will later on be referred to as the ‘event of interest’), you will record data which will beused in the second part to analyze pedestrian interaction.

Note: Due to the pandemic, this part is voluntary in this year’s round of the course. If you donot wish to collect your own data, you can proceed to Part B with the data from the previous round(2018-10-24-11-11-25_0.bag).

Part B - Data analysis

  1. The Lidar has a field of view of about 190 degrees and a range of about 120 meters. At eachtimestamp, the Lidar scans the environment and collect 1521 measurements equally spaced between-95 deg and +95 deg. Figure 1 below shows the reference system for interpreting the data.Figure 1: LIDAR reference system

1https://github.com/ruvigroup/div_datalogger

2https://se.mathworks.com/products/ros.html

TME192 - Active safety Page 22. The LIDAR saves the data in the ROS .bag format. Save this file into the folder of the exercise. The.bag file needs to be converted into a .csv file via the function bag2csv which extracts only theLIDAR data from the bag file. That reduces file size, in case you have video data in your collected

data (which is not the case for the given example 代 寫Exercise 5: Field data acquisition and analysis recording). The function takes as input the relativepath of the .bag file to be converted, e.g. bag2csv('2018-10-24-11-11-25_0.bag') . Whenyou run bag2csv, a new .csv file will be saved in the same location of the .bag file. This .csv file isthe one you should submit in the end.

  1. With the function playLidar, you can visualize the ROS .bag file you recorded (both LIDAR andvideo data). When you run the script without any input, a dialog box appears. Select the .bag filehat contains the measurements. Otherwise, you can run the function specifying the .bag file tobe loaded as a input to the function, e.g. playLidar('2018-10-24-11-11-25_0.bag') . Theinterface shows both the timestamp in seconds and the frame number. Working with frame numbersmakes it easier to analyze the data in MATLAB (the frame number corresponds to the row numberin the .bag file). Scroll through the frames (you can also use the arrow keys, left/right = +/- 1 frame,p/down = +/- 10 frames) and identify the frames that contain relevant events (in particular, thestart and the end frame for each event). You may also want to limit the field of view. A narrow fieldof view may help to differentiate among targets.
  1. Once you have identified the events of interest and you found the optimal field of view settings, youcan start coding in the main script Exercise.m. Before anything, set the filename of the .csv youwill be using for your analysis. The script will import the .csv file into a MATLAB structure data.
  1. To get acquainted with processing LIDAR data, plot the LIDAR measurement at a single timestamp.Plot the measurements in the whole field of view of the LIDAR, highlight the data within the chosenbounded) field of view, and mark the closest point in the field of view (which is a reasonableapproximation of the obstacles). The LIDAR data are collected as polar coordinates. Thus, thedata need to be transformed to be able to plot a graph in Cartesian coordinates (try the MATLABunction pol2cart). Try to replicate Figure 2:TME192 - Active safety Page 3Figure 2: LIDAR visualization via the playLidar function.
  1. In a single figure, plot the distance measurements for all the events of interest. You should obtainmething like Figure 3. Data can be noisy. If so, apply a filter to the data to reduce the noise andremove artifacts. Try, for example, the MATLAB function smooth.Figure 3: Distance over time, obtained from all events of interest.
  1. In a single figure, plot the relative speed (range rate) with the obstacles for all the events of interest.You should obtain something like Figure 4. Data can be noisy. If so, apply a filter to the data toeduce the noise and remove artifacts.Figure 4: Relative speed over time, obtained from all events of interest.TME192 - Active safety Page 48. In a single figure, plot time to collision (TTC) with the obstaclesfor all the events of interest. Youshould obtain something like Figure 5. Data can be noisy. If so, apply a filter to the data to reducethe noise and remove artifacts.Figure 5: Time-to-collision (TTC) over time, obtained from all events of interest.
  1. Finally, answer the question: What safety measure would you use to design a warning that alert theuser that is about to collide with an obstacle? You may want to use one of the safety measures youcomputed in the script of find a more accurate one. What value of such measure would you use to
  2. trigger a warning? Write your answer in the MATLAB script and enclose it in a comment. Submission

Submit your solutions in the assignment in Canvas. Submit the Exercise.m script together with yourrecorded .csv file (only if you recorded your own data). If the file is too large, upload it e.g. using Chalmersbox (https://chalmersuniversity.app.box.com/), and submit the link to the file in a comment. Itis sufficient if at least one group member submits your solution in Canvas. See deadline above.TME192 - Active safety Page 5

相關文章