DEV Community

Discussion on: I am c++ coder in autonomous vehicle developing, Ask Me Anything!

Collapse
 
srinjana33 profile image
srinjana33

An autonomous car can move only in the front and reverse. There are two walls, one in df meter front of the car and the other dr meter back of the car. The car has forward speed sf m/sec and backward speed sr m/sec. The car moves forward and backward alternatively in each second.

At the start if the signal sg = 0, car starts moving in forward direction, otherwise if sg = 1, car starts moving in backward direction. Given the inputs df, dr, sf, sr and sg, out put following

(A) Whether car will collide with any of the wall

(B) Which wall?

(B) After how many seconds