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

Car Autopilot ala Aircraft

Sat Oct 01, 2016 2:33 am

Is it possible to utilize five RPi3 as a car autopilot in configuration similar to that in the aircraft?
Using five Raspberry Pi 3 as the brain.

Five computers, four of which redundantly ran identical software, and a fifth backup running software that was developed independently. The software on the fifth system provided only the basic functions needed to control the car, further reducing any possible commonality with the software running on the four primary systems.

For four main computer, if one computer disagrees with the other two, its output is ignored. The system allows some processors to be faulty while maintaining the operation of the overall system.
If a microprocessor is overheated or overloaded and spontaneously fails, I would expect it to stop doing anything and produce no output. To deal with this kind of failure, you'd want to have a backup processor, but you wouldn't need to compare the outputs of three computers—any output produced would be assumed correct, so you'd be happy to directly use the output of any processor that was producing output, this is the function of the fifth independent one.

So its basically like Tesla's autopilot but using RPi3 as the main computer.

Is it possible?
Raspberry Pi 3

ElEscalador
Posts: 667
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 3:01 am

Are you insane?

Let me rephrase that - you're insane.

You didn't mention how the Pis would know where they were or how they would actuate steering or throttle or sense obstacles...
Is it possible to have the Pi's back eachother up in case of failure - certainly. But if your question is "Can it be done?" and not - "I've working on x but do you guys think there is a better way to....?" Then the answer is no - you can't do it.

Steering an aircraft is one zillion times easier than operating an automobile.
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

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

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 3:08 am

Yes, I'm insane, therefore I'm really interested to try.... :D

Yes, I'm aware of the situation in road is different from sky.
But, Google & Tesla already did it.

And I'm talking about implementing various existing usable aircract autopilot function (esp TCAS - Traffic Collision Avoidance System) to car using RPi3.
Also for sensors etc, it'll be routed via GPIO and various sensors boards (Arduino, etc, you know it).
GPS will be fitted along with its traffic avoidance message receiver.

The function for the autopilot is for assisting driver rather than completely takeover the car control.
And all input adjusted by the system will be reflected clearly like in the aircraft (like the steering wheel moving, the pedals moving, etc like in the aircraft). All is done using servo/other means of control.

:lol:
Raspberry Pi 3

ElEscalador
Posts: 667
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 3:16 am

I do rather enjoy embracing insanity and something that would maintain distance - or at least reduce throttle /brake to avoid collision when I'm daydreaming/writing code in my head and driving would be sweet.
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

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

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 3:21 am

Yup, that's what I'm thinking about.
At least make the car aware the situation of the road and traffic, and help driver to steer it safely.

The problem is, I don't have any experience in programming...
I only can tinker & hack things.... :lol:
Raspberry Pi 3

ElEscalador
Posts: 667
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 3:32 am

Neither did I until I picked up a copy of c++ for dummies (seriously). Now my tinkering abilities approach wizardy to the perception of most mortals. To programmers I'm still a hack. Pick a small part of the project and just figure that out. Say...a range-finder. Just display the distance....don't worry about the big picture yet - you can get to it later.
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

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

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 4:04 am

I think I saw that book in the local bookstore, I'll get one later.
Thanks for the help ;)

I think I need to learn programming first..... :D
Raspberry Pi 3

scotty101
Posts: 3597
Joined: Fri Jun 08, 2012 6:03 pm

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 9:12 am

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.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

MikeDunn
Posts: 83
Joined: Wed Jul 01, 2015 6:58 pm

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 3:03 pm

cresfang wrote: The problem is, I don't have any experience in programming...
I only can tinker & hack things.... :lol:
Would you mind saying where you are ?

I'd like to make sure I'm a long way away from you if you ever do this ... at least 10 miles, and preferable in another country or even continent ...

Heater
Posts: 12657
Joined: Tue Jul 17, 2012 3:02 pm

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 3:49 pm

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:
https://en.wikipedia.org/wiki/Byzantine ... 27_Problem
http://research.microsoft.com/en-us/um/ ... 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....

User avatar
karrika
Posts: 1052
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 3:57 pm

We are going to see autonomous trains, cars, airplanes, ships real soon.

Fortunately there is laws of how you need to design software for this kind of projects.

In a nutshell you need to evaluate the risk of different components like breaks or steering. Depending on what may go wrong you estimate frequencies of how often these may happen and hazards of what could happen - nothing, material damage, injury, death of one person, death of many persons.

Depending on this you get requirements of how the system has to be developed. You may need to model it using formal methods. You may need to have teams doing the validation of your software and verification of your software. In extreme cases these team must come from other companies without economic bindings to your own company.

So there is a long way from tinkering with your own car to create an autonomous car that is allowed to drive by itself.

Heater
Posts: 12657
Joined: Tue Jul 17, 2012 3:02 pm

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 4:21 pm

Oddly enough, one such extreme example is the fly by wire system of the Boeing 777. The 777's Primary Flight computers were entirely the responsibility of one company, GEC Avionics. Hardware design, software, testing. Different teams of course but the same company. As a member of the PFC test team I hardly ever met the software developers.

As you may be implying, this did give rise to pressure on the test team from the management to cut corners and speed things along a bit to meet the deadlines. Which we vigorously opposed. So vigorously that our test team manager was replaced three times until they found someone a bit more "cooperative".

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

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 5:34 pm

cresfang wrote:... So its basically like Tesla's autopilot but using RPi3 as the main computer.
Of note: a Tesla has already killed some-one.
https://www.theguardian.com/technology/ ... -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?

AJB2K3
Posts: 215
Joined: Sun Aug 11, 2013 3:25 pm

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 5:47 pm

Sorry to be a downer but....
Don't matter if you use five or fifty, the answer is no.

Too many stupid drivers are on the road.

FYI one of googles cars drove into a bus a few months back when it decided to pull into the side of the bus for no reason.
Back in the old days, we were smarter then the technology.
Nowadays technology makes us look like villages fools in front of the children!

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 5:53 pm

AJB2K3 wrote:FYI one of googles cars drove into a bus a few months back when it decided to pull into the side of the bus for no reason.
Hey, they like public transportation a little too much.

Heater
Posts: 12657
Joined: Tue Jul 17, 2012 3:02 pm

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 5:56 pm

I wonder if a Tesla, or any other self driving vehicle, even bothers with multiple redundant fault tolerant systems.

Their argument seems to be:

1) If it screws up the driver is supposed to take over control again ASAP. If not, it's not our fault.

2) If we can kill less people per million miles than human drivers do then that is good.

Case 2) is kind of reasonable. 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. They are not going to be there when needed.

User avatar
CarlRJ
Posts: 599
Joined: Thu Feb 20, 2014 4:00 am
Location: San Diego, California

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 8:15 pm

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.

Heater
Posts: 12657
Joined: Tue Jul 17, 2012 3:02 pm

Re: Car Autopilot ala Aircraft

Sat Oct 01, 2016 9:35 pm

CarlRj,
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.
Sorry, perhaps I phrased that badly. Of course that is what we do. Not just an hour. Often far longer.

My point was that normally the driver is an active part of the process at all times. Read the road, read the surrounding vehicles. If you don't do the right thing you are in trouble.

The Tesla idea is that you just sit and monitor what goes on, with nothing to do for hours on end. Until something happens the system cannot handle. By which time you have fallen asleep or got lost in the cloud with your iPhone.

So yes, I agree. Calling it "Autopilot" was foolish on Tesla's part.

User avatar
CarlRJ
Posts: 599
Joined: Thu Feb 20, 2014 4:00 am
Location: San Diego, California

Re: Car Autopilot ala Aircraft

Sun Oct 02, 2016 6:12 am

Heater wrote:My point was that normally the driver is an active part of the process at all times. Read the road, read the surrounding vehicles. If you don't do the right thing you are in trouble.

The Tesla idea is that you just sit and monitor what goes on, with nothing to do for hours on end. Until something happens the system cannot handle. By which time you have fallen asleep or got lost in the cloud with your iPhone.
I think we're in agreement ;) A problem on long trips now, is keeping the driver fully engaged - it's easy for some to zone out (there's a term - I thought it was highway hypnosis, but that looks to be when someone actually is quite functional, though not fully aware - anyway, it's entirely possible for people to get a bit zombie-like and respond well enough for staying in a lane but not for exceptional cases). The Tesla approach, having the car handle the easy cases in uncontrolled conditions, and then summarily punting back to the driver in the exceptional cases, while the driver meanwhile is pages deep in Facebook or some such and totally disengaged, is a recipe for disaster.

Pithagoros
Posts: 580
Joined: Wed Nov 12, 2014 8:16 pm

Re: Car Autopilot ala Aircraft

Sun Oct 02, 2016 10:10 am

Anybody who wants to tinker in this field should give it a go, I'm messing with it after a German contributor to these forums get me interested a few months ago.

Of course, I am not working with full size cars but much can be done with adapted RC models and tape on a wood floor.

User avatar
DougieLawson
Posts: 35364
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Car Autopilot ala Aircraft

Sun Oct 02, 2016 10:43 am

CarlRJ wrote:The Tesla approach, having the car handle the easy cases in uncontrolled conditions, and then summarily punting back to the driver in the exceptional cases, while the driver meanwhile is pages deep in Facebook or some such and totally disengaged, is a recipe for disaster.
Isn't that precisely what Boeing and Airbus do with their control systems. I guess they have the advantage of their warnings going off long before the collision or other disaster. That said their autopilot stuff didn't prevent AF296 (Airbus), AF447 (Airbus), BD092 (Boeing) and MH370 (Boeing) from falling out of the sky (although at least three of those have been confirmed as pilot error).

If you're going to have an autopilot on your Tesla it's got to apply the brakes at the first hint of danger so that it will stop even when the driver is deep in Faceborg. You then hope that the vehicle behind that's going to rear-end the Tesla has an identical automatic control system or a driver that's 100% alert and in control.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
CarlRJ
Posts: 599
Joined: Thu Feb 20, 2014 4:00 am
Location: San Diego, California

Re: Car Autopilot ala Aircraft

Sun Oct 02, 2016 7:11 pm

DougieLawson wrote:Isn't that precisely what Boeing and Airbus do with their control systems. I guess they have the advantage of their warnings going off long before the collision or other disaster.
Well, the bit in my text that you quoted that I would point to is "in uncontrolled conditions". The airplane manufacturers, and the airlines who set policy to allow their aircrews to use the airplane's autopilot, are both dealing with a very controlled environment - the lanes/corridors in which the planes are flying are quite large and pre-defined in machine-readable ways, and the planes are continually monitored by, and in communication with, the controllers on the ground, and are squawking their identification and precise location (if I understand correctly) to any other nearby planes. The system is designed with numerous layers of mechanisms to keep planes from running into each other.

With cars, by comparison, the only inter-vehicle communication is peering out the windows at each other and occasionally honking, the lanes/corridors are incredibly poorly-defined*, there is no communication with any coordinating agency (no Air Traffic Control for cars), and drivers don't get anywhere near the kind of training that commercial pilots do.

*: (there is no machine-readable standard imposed by a governing body to consult, that tells precisely where the lanes are - which there is for aircraft - at best you can use a GPS and maps generated by third-party mapping companies, and a little guesswork, to get a good approximation of where you are, though it will often be off by multiple meters - a distance that is much larger than the distances that often occur between cars, so for lane holding the available machine-readable data is useless; thus autonomous cars are forced to peer out at their surroundings, figure out what they're looking at, and make a best guess at what constitutes the boundaries of their lane, in order to try to stay in the lane. At this point, there are still many conditions that will be correctly parsed by a human but misunderstood by a computer.)
DougieLawson wrote:If you're going to have an autopilot on your Tesla it's got to apply the brakes at the first hint of danger so that it will stop even when the driver is deep in Faceborg. You then hope that the vehicle behind that's going to rear-end the Tesla has an identical automatic control system or a driver that's 100% alert and in control.
This is why I was suggesting that the first real worthwhile large-scale use of "autonomous" vehicles will end up being in special computer-controlled-only lanes, separated off from the normal traffic, so a coordinating server (plus continual communication between the cars) can reasonably handle any exceptional conditions that arise.

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

Re: Car Autopilot ala Aircraft

Thu Oct 06, 2016 4:57 am

MikeDunn wrote: Would you mind saying where you are ?

I'd like to make sure I'm a long way away from you if you ever do this ... at least 10 miles, and preferable in another country or even continent ...
I'm from Indonesia, East Java..... lol why? :lol:
Raspberry Pi 3

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

Re: Car Autopilot ala Aircraft

Thu Oct 06, 2016 10:12 am

CarlRJ wrote:This is why I was suggesting that the first real worthwhile large-scale use of "autonomous" vehicles will end up being in special computer-controlled-only lanes, separated off from the normal traffic, so a coordinating server (plus continual communication between the cars) can reasonably handle any exceptional conditions that arise.
I'm not sure that's right.

The people most likely to make money out of autonomous vehicles are manufacturers such as Tesla, Ford and Toyota, and users such as Uber and freight haulage companies.
The people most likely to have to pay for separate lanes are local authorities.

Can you see New York City carving up their already-congested highways to provided a special lane for Uber?
Same goes for motorways - you really think the average commuter would be happy with one of the four lanes of the M25 round Heathrow being shut to them, just so Norbert Dentressangle can get from Dover to Birmingham?

1st October New Scientist had an article on mapping roads specifically for autonomous cars - amidst their usual gee-wizz style, they included some interesting information.
For a start, "San Francisco has about 2000 kilometres of major roads".
Re-engineering those roads for dedicated lanes would be expensive.
Mapping them is, apparently, a two-week job for Google or Tesla.

Hidden away in that article is a statement:"Toyota plans to include the sensors required for autonomous driving in all of its new cars in 2017. These millions of cars won't be autonomous themselves, but will gather the data neede for Toyota to build its own maps. To deal with this vast amount of information, Toyota is building a data centre in Plano, Texas"
So if you buy a new Toyota (or probably any other make) next year, Toyota will know where you've been, and when.

1984, just 33 years late.

Pithagoros
Posts: 580
Joined: Wed Nov 12, 2014 8:16 pm

Re: Car Autopilot ala Aircraft

Thu Oct 06, 2016 10:20 am

My car is damn good at telling me when I am going to the edge of a lane. It's also very good at emergency stops, when I needed one the other day it had already started braking before I could.

Return to “General discussion”