User avatar
Posts: 6289
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Car Autopilot ala Aircraft

Thu Oct 06, 2016 10:55 am

I could have used that, fifty years ago.

Early morning. Coming up to a cross-roads, lights turn to green. A bus on the opposite side, signaling to turn right across my path, moves forward and stops, clearly waiting for me. Pedestrian standing in the gutter waiting to cross left to right.
Just as I'm getting there, pedestrian wakes up enough to work out the bus isn't going to cross in front of him, so steps forward.

It takes about 0.5s to react to the unexpected.
In that time, the pedestrian has come flying up my windscreen.
The aftermath sees him land in the middle of the road, (he's wide awake, now) the bus driver come across to help, me take pedestrian to local A&E, then visit the cop-shop, then, because of the rules 'n' regs, I have to fill out all the paperwork, and my insurance company pays for the hospital treatment.

All that hassle would have been avoided if I'd had an automatic braking system.

Posts: 578
Joined: Wed Nov 12, 2014 8:16 pm

Re: Car Autopilot ala Aircraft

Thu Oct 06, 2016 11:18 am

That's interesting Burngate. In my case I was driving along a High Street when a lady looked one way and then stepped into the road in front of me before looking back toward me, stopping and stepping back. But by the time she had seen me and stepped back the car had stopped itself, about 2 metres short of her. I didn't get a chance to get involved, it was all too quick.

And there's all the rear-enders that will be prevented too.

User avatar
Posts: 37
Joined: Fri Apr 29, 2016 3:03 am
Location: Garden of Time
Contact: Website

Re: Car Autopilot ala Aircraft

Fri Oct 07, 2016 1:07 am

scotty101 wrote:If you have no experience of programming, you have no possibility of recreating the years of work that the many many experienced professionals put in to create the Tesla Autopilot.

Park your project and start with something simple that will allow you to build up your experience. A simple object avoiding robot maybe.
Thanks for the suggestion. I'm trying to learn a basic coding as well now as suggested earlier.
Heater wrote:cresfang,

So basically you want a system that will control something, a car in this case, and continue to work correctly even when parts of it fail. It's an interesting problem. Not at all easy to solve.

As you have said the way to do this is by having multiple copies of everything, such that if one dies or worse still starts producing incorrect results, it can be ignored and the non-faulty units can continue.

Firstly read about the Byzantine_Generals problem here: ... 27_Problem ... bs/byz.pdf

Basically there is a proof that if you want a system comprised of N elements that will continue to operate correctly when a number, F, elements fail you need to have N = 3 * F + 1 elements in the system. So if you want to continue working with one failed computer you need to start with 4 computers. They all have to be connected to each other. (Which is a surprising result, I would have always thought that 3 was enough to get some voting system working and fail safe, but it turns out that if one machine is producing incorrect results it can do so in a way that confuses the other 3)

Your system will have:

Inputs from sensors, say the speedometer, steering wheel angle, cameras, radars, whatever else.

You will need at least three sensors measuring every input. Then if one starts giving incorrect readings your control system can notice it's gone crazy and ignore it.

Outputs to actuators, turn turn the steering wheel, apply the brakes etc.

You will need at least three actuators for every output put you can drive. This gets a bit tricky, if you have three motors or whatever driving the steering wheel and one goes mad how do you ensure you detect that fault and disable it?

Processing elements, to read the sensors, calculate what to next, command the actuators.

You will need at least 4 computers, all fully interconnnected. And all connected to all sensors and actuators. Then you can use a Byzantine Generals algorith to ensure that the three working computers can detect an ignore the one that has died or producing crazy results.

Oh, and you will need four separate power supplies. No good having the whole thing fail when you supply dies.

For fun you could simplify this problem and see if you can make it work...

Get 4 Raspies a push button and a LED. Have the button connected and LED connected to all four Raspies. Have all the Raspies connected, point-to-point to each other some how.

The problem to solve then is to light the LED when the button is pressed. And only when the button is pressed. This system should work correctly when any of the Pi are dead or issuing the wrong command.

With that all figured out we can move on to the problem of actually driving a car....
Yes, this is the scientific explanation of what I'm trying to achieve.
One more question as I read it somewhere in this forum that someone trying to use RasPi for ECU and they said its impossible bcoz the ECU is a realtime computer.
How about the autopilot? Is it need to be realtime computer or just normal computer like RasPi?
Burngate wrote:Of note: a Tesla has already killed some-one. ... -elon-musk

Also of note: I read somewhere a suggestion that if an autonomous vehicle causes damage, the control system manufacturer / designer should be held responsible.

So are you sure you want to build something that could get you into that sort of trouble?
Really sure?
I'm aware of the risk, however if this aircraft autopilot type can be implemented in all vehicle as cheap as possible therefore RasPi, then it will be possible to fit it on every vehicle, minimizing collision and accident.... except any vehicle other than car...
Raspberry Pi 3

User avatar
Posts: 37
Joined: Fri Apr 29, 2016 3:03 am
Location: Garden of Time
Contact: Website

Re: Car Autopilot ala Aircraft

Fri Oct 07, 2016 1:19 am

CarlRJ wrote:
Heater wrote:1) If it screws up the driver is supposed to take over control again ASAP. If not, it's not our fault.
Case 1) seems crazy to me. Nobody is going to sit in a car, carefully watching the road and what goes on for an hour.
The problem is, the public is taking "self driving" as a binary thing - either it's not installed, or the car is a fully autonomous Johnny Cab. When what it really is, is like a minor assist. Calling it "Autopilot" was a foolish move on Tesla's part, because it's a cutesy name but people take it literally. When Apple called their first wireless access points, "Airports", nobody inferred from the name that actual airplanes, runways, and terminals were involved.

When you teach a kid to ride a bike, you don't just sit them on the seat, give them a hard shove, and turn and walk away. There's a lot of careful guidance and realtime monitoring to see that things are working out. The "Autopilot" name, combined with decent initial results under near perfect conditions have led some people to assume that this is a fully capable and debugged feature. It's not. Maybe in 10-20 years. Though I'm sure that some people and companies will claim to have it earlier, I'm just as certain that those folks will occasionally be putting cars into the sides of buses in the next 5-9 years and then saying "oh, well, but that wasn't supposed to happen."

(I remember people in the 80's saying, "see, we've got voice control working!" - no, they were getting results that were slightly above random chance - that's not a useful definition of working.)

As to your statement, "Nobody is going to sit in a car, carefully watching the road and what goes on for an hour." That's EXACTLY what everyone driving on a long trip today does. They sit in their car, holding the wheel in basically the same position, and the gas pedal is basically the same position, watching the road, for hours on end. It's drudge work, but we don't trust it to anything less than an adult human at this point.

A logical first step, really, would be dedicated/separated lanes on long inter-city freeways, similar to (perhaps even replacing) today's carpool lanes, that were properly instrumented with embedded machine-readable markers of some sort, so that cars equipped with the proper control computers could communicate with the servers running the "autopilot lane", then enter the lane, chose a destination (that is, when to exit the controlled lane), and have the car completely take over, working within a known, limited, instrumented environment, driving in front of and behind other computer-controlled cars, which are all continually communicating with the server controlling the traffic in the lane - you could sit back, surf the web for an hour or two, and let your-car-and-the-server do the driving (likely at very high speed) until you were near your destination. If the cars were required to automatically report every exceptional condition to the server (tire pressure falling, engine overheating, gas tank running low, etc.), the central server could coordinate temporarily slowing all the nearby cars while routing the failing car out of the traffic pattern, then bringing the remaining cars back up to speed.

But near term? Fully autonomous? Able to handle every exceptional condition to be found in busy city streets in all weather conditions? Bad idea. Really terrible idea.

As to the comparison to airplane autopilots, the aircraft pilots are still required to pay attention, they are highly trained professionals, and the airplanes are working in lanes that are mathematically defined, miles wide and made out of air, where cars are often within feet of other vehicles, pedestrians and obstructions, in lanes that are ill-defined and constantly changing. It's not really a fair comparison.

As to the original question, "is it possible..." - sure, phrased like that, nearly anything is possible. But highly unlikely. Start with some MUCH simpler project first, build your skills up to the point where you can eventually authoritatively answer the "is it possible" question yourself. It's not a short journey, but every step along the way can be interesting and rewarding.
Thanks for more detailed explanation. Yes, the fully autonomous is not gonna be a reality anytime soon.
Thats why I said earlier autopilot as in aircraft. The pilot still maintain a proper control over the vehicle, monitoring everyting and takeover whenever there's a warning.

I saw one video someone driving Tesla, and when the stick shaker activates, you basically need to take over the control. Just like in aircraft. But he doesn't, instead commenting: "see, if I still do nothing, the car autopilot will still take care of everything."
This kind of mentality will kill people.

We have the autobrake and brake assist combined with front sensor + cruise control already for collision avoidance with car in front of us. This is basic autothrottle and TCAS.

We can make the carpool and self parking guidance thing ala ILS in aircraft... Its basically an autolanding system, which can be used to autopark in carpool safely.

And yes, we still need server to maintain everything. We have traffic monitoring center already in some cities.
And blackbox installed in every car to see what makes the accident happen.

All and all, we can use the data for building more sophisticated system to make car safer than ever.
Raspberry Pi 3

Return to “General discussion”