CSLM Final Project Dr. SAFE Group 9 B 黃昱翔 B 賈乃輝
Motivation We have many car accidents every day and the reasons varies, such as drunk- driving, bad road condition, rule-violating, and so on.
Motivation To avoid car accidents, we must find some solutions which can help us avoid the cause of accidents and will not be too unacceptable for people.
Goal Develop a system that can Prevent drunk-driving Detect bad road condition, and Give suggestion of a safe driving speed given the road condition
Road Condition Alcohol Test GPS Data Random Specific Patterns Touch Screen 3D Accelerator Data Car Lock Bluetooth Recording Data base Query Check nearby Road Condition Detect Current Road Condition Car Computer Drawing TestWalking Test GUI User 3D- accelerometer GPS
System Components Drunk-driving prevention block Road condition detection and speed suggestion block Connected by bluetooth interface
Bluetooth Maintain the state of the program Door_closed->door_open->car_on->car_off Rfcomm sockets Like TCP Communicate with car computer (our notebook) A thread parallel the original (GUI) thread Awaken only when the socket is readable or need to request sth.
Flow of events In DOOR_CLOSED state: Start these two tests If failed in one test => Quit If success in both tests => REQUEST_OPENDOOR Receive ACK and go to DOOR_OPEN state In DOOR_OPEN state: Idle until the CAR_ON msg is received Then go to CAR_ON state
Flow of events In CAR_ON state: Road condition detection and speed suggestion Terminate until CAR_OFF msg is received
Prevent Drunk Driving Check if the user can walk straight Two threads: GUI and Accelerometer thread Acc. thread is busy reading the acc. file Calculate the standard deviation all data collected (x-axis acc. data) If less than threshold => pass! Else => failed
Prevent Drunk Driving Touch the random points display on the screen mousePressedEvent mouseReleaseEvent timer If user can point to the target for 8 out of 10 tries=>passed else=>failed
Road Detection and Suggestion Record the condition of the road driver had gone through. Use the data we have recorded before with the current detection to suggest the driver how fast he (she) should drive with to avoid danger.
Road Detection and Suggestion 3D accelerator: To detect the current road condition. We don’t use derivation but the difference between current and old values. If the difference is too big, store in a variable as a part of the data for the road to record later. If there is a obvious and last for a while, we see it as an action of turning. And two turning action forms a “road” in our definition.
Road Detection and Suggestion With the observation of the turning action, we call GPS to define where we are and record the data we have observed. The format of each road data in the file is like: [GPS-address] [road-detection] [GPS-address]
Road Detection and Suggestion GPS Call GPS to get address of the place turning action happens as ending an old road and starting a new road. Search data in the file with the address and using the one-dim polynomial functions to find the closet data in the file. y infile = mx infile + c, this represent the road by the two point we have in file. Use the data whose function is the closet to y data – mx data - c=0
Road Detection and Suggestion Combine the data we have recorded and the current difference of the acceleration we can suggest the driver how fast he (she) should drive according to the road condition.
Road Detection and Suggestion Summarize