News for hackers. Stuff that matters.
Re:Former Tesla Firmware Engineer Discusses the System by mlaretallack on Friday August 24, 2018 @02:23PM (#17836769)
Agree completely. Hard real time is possible with Linux, we use it for sub millisecond control of Traffic Lights. The only issue we ever hit is proving that the code running is the stuff we expected to run.
Re:Former Tesla Firmware Engineer Discusses the System by coldtea on Friday August 24, 2018 @03:00PM (#17837073)
>we use it for sub millisecond control of Traffic Lights

Why would anyone need "sub millisecond control of Traffic Lights"?

Traffic lights are mission critical systems, of course, but even millisecond precision should be more than enough, and possibly even 0.5x-1 second precision...

Re:Former Tesla Firmware Engineer Discusses the System by encoderer on Friday August 24, 2018 @03:55PM (#17837459)
The sub-millisecond precision ensures they can totally destroy your day with short left turn arrows and yellow lights.
Re:Former Tesla Firmware Engineer Discusses the System by xg15 on Saturday August 25, 2018 @12:35PM (#17841450)
Yes, some green phases definitely feel sub-millisecond.
Re:Former Tesla Firmware Engineer Discusses the System by dnautics on Friday August 24, 2018 @04:42PM (#17837760)
For legal reasons. Regs say that stop cycles have to meet minimum times in each state, if you're even off by a Tony bit you could potentially challenge it legally in court.
Re:Former Tesla Firmware Engineer Discusses the System by ams6110 on Friday August 24, 2018 @09:41PM (#17839080)
Bear in mind that the software only controls the cycle. The lights are electrically wired so that it is impossible for example to have "GREEN" illuminated in crossing directions. Or so I've read -- I don't work in traffic control software or hardware.
Re:Former Tesla Firmware Engineer Discusses the System by brbrodude on Friday August 24, 2018 @03:15PM (#17837177)
if it controls a ton of them, then small stuff could get them to be intolerably out of sync maybe? I'm just guessing :p
Re:Former Tesla Firmware Engineer Discusses the System by Cyph0n on Friday August 24, 2018 @06:43PM (#17838359)
The real question is: why do you need an entire OS kernel to control traffic lights?
Re:Former Tesla Firmware Engineer Discusses the System by noselasd on Friday August 24, 2018 @07:35PM (#17838623)
To communicate with all the other traffic lights and sensors at the other intersections on the road to optimize traffic flow.
Re:Former Tesla Firmware Engineer Discusses the System by Cyph0n on Friday August 24, 2018 @09:27PM (#17839045)
Yeah, I still think that's overkill, simply because the bulk of the computation is done on a remote server anyways. All you really need on the frontend is a TCP/IP stack to send telemetry and receive commands.

If the connection is lost, the exchange can just fallback to "naive" mode.

Re:Former Tesla Firmware Engineer Discusses the System by manmal on Saturday August 25, 2018 @01:16AM (#17839656)
I guess using off-the-shelf mass market hardware combined with a software stack anyone can design, setup, and implement is way easier and cheaper than a customized solution.
Re:Former Tesla Firmware Engineer Discusses the System by XorNot on Saturday August 25, 2018 @12:49AM (#17839605)
Consider the overhead of maintaining two entirely separate software stacks, with different libraries and controllers then? And the ongoing costs of discovering your "minimal" hardware can't accomodate a future improvement, compared to just using general compute at a marginal upfront cost, and then having everything else be familiar?
Re:Former Tesla Firmware Engineer Discusses the System by fidz on Friday August 24, 2018 @08:12PM (#17838756)
Such thing does exist? I thought traffict light only time-based on no sensor involved.
Re:Former Tesla Firmware Engineer Discusses the System by BinaryIdiot on Friday August 24, 2018 @08:39PM (#17838877)
Depends on the area but yeah many intersections use sensors (cameras, sometimes under the road pressure sensors, etc) to make anywhere from subtle to extreme changes based on traffic patterns. The under the road pressure sensor has been around for decades.

When I was a kid there was one light that, when you drove over the pressure sensor, it wouldn't really do much. But if you backed up and drove over it again it must have registered an additional car coming through and the light would almost immediately go through its light cycle to change. It was really interesting to see!

Nowadays I think it's mostly cameras? We have a light near my home and the left signal will literally never trigger unless someone is in one of the left lanes.

Re:Former Tesla Firmware Engineer Discusses the System by Cyph0n on Friday August 24, 2018 @09:25PM (#17839040)
It's not a pressure sensor, but an induction loop. Basically, there is a coil placed on the road that has a small AC current passed through it. When a car (metal) sits on top of the coil, the two "coils" couple, changing the overall inductance. A simple sensor can detect this change.
Re:Former Tesla Firmware Engineer Discusses the System by TheKarateKid on Saturday August 25, 2018 @01:24AM (#17839681)
The current is even able to pass through the tires?
Re:Former Tesla Firmware Engineer Discusses the System by Cyph0n on Saturday August 25, 2018 @02:26PM (#17841873)
No, the current passes through the coil, and the coil has no physical contact with the vehicle.

Look up inductive coupling. The basic idea is that a changing (AC) current in a conductor generates a changing magnetic field (Ampere's law). This changing magnetic field then induces a voltage in the second conductor (Faraday's law). This is the principle behind how transformers work.

Re:Former Tesla Firmware Engineer Discusses the System by Dreami on Saturday August 25, 2018 @03:12AM (#17839943)
As far as I understand, it's just electromagnetic waves. No current passing through to the car, but the coil can "register" a change in its magnetic field and can determine that it's a car and how fast it goes
Re:Former Tesla Firmware Engineer Discusses the System by vageli on Saturday August 25, 2018 @11:56AM (#17841297)
Can confirm. Also interesting to note that motorcycles often have trouble triggering these sensors (a common trick is to stick a heavy duty magnet underneath).
Re:Former Tesla Firmware Engineer Discusses the System by BinaryIdiot on Monday August 27, 2018 @03:00AM (#17849873)
Really interesting! Thanks for the correction!
Re:Former Tesla Firmware Engineer Discusses the System by mmt on Saturday August 25, 2018 @04:42AM (#17840132)
As a sibling comment noted, it's not a pressure sensor [1] but an induction loop.

The Wikipedia article https://en.wikipedia.org/wiki/Induction_loop#Vehicle_detecti... has fairly extensive details on modern implementation.

[1] These do exist for weight-in-motion systems, however.

Re:Former Tesla Firmware Engineer Discusses the System by Fnoord on Saturday August 25, 2018 @03:37AM (#17839994)
An OS has a kernel. TRON [1] equally fits your description. Which is IIRC what traditionally runs on traffic lights.

[1] https://en.wikipedia.org/wiki/TRON_project

Re:Former Tesla Firmware Engineer Discusses the System by arcticfox on Friday August 24, 2018 @02:34PM (#17836865)
> Agree completely. Hard real time is possible with Linux, we use it for sub millisecond control of Traffic Lights.

Out of curiosity, why do traffic light controls need to be that precise?

Re:Former Tesla Firmware Engineer Discusses the System by huehehue on Friday August 24, 2018 @03:05PM (#17837112)
Venturing a guess -- there's either some X% accuracy standard required by the government for who-knows-what reason, or it's for red light cameras and ticketing systems.

"Ironically, the biggest concern with red-light camera systems is that they are so precise. They measure a driver’s speed and exact location within a fraction of a second — but do not leave any wiggle room for the errors of traffic signals such as inconsistent yellow light times"[0]

If there's not an accuracy threshold for safety reasons, there's gotta be one when traffic ticketing revenue is on the line (also I guess determining fault at accidents, vehicular manslaughter cases, etc.)

[0] https://www.mercurynews.com/2014/06/06/red-light-cameras-how...

Re:Former Tesla Firmware Engineer Discusses the System by loourr on Friday August 24, 2018 @03:12PM (#17837156)
I don't actually know, but my guess is time drift with respect to other lights.
Re:Former Tesla Firmware Engineer Discusses the System by jackhack on Friday August 24, 2018 @03:18PM (#17837209)
resume-driven development?
Re:Former Tesla Firmware Engineer Discusses the System by lifeisstillgood on Friday August 24, 2018 @04:13PM (#17837568)
everything is revenue driven development
Re:Former Tesla Firmware Engineer Discusses the System by jethro_tell on Friday August 24, 2018 @06:20PM (#17838223)
he said resume, i.e. working with tech you want to use at your next gig not the tech you need at this gig.
Re:Former Tesla Firmware Engineer Discusses the System by lifeisstillgood on Saturday August 25, 2018 @07:04PM (#17843058)
could have sworn i read that right ... ah well

still, revenue driven development actually makes sense as a thing too ...

Re:Former Tesla Firmware Engineer Discusses the System by samstave on Friday August 24, 2018 @04:45PM (#17837769)
On a tangent, but still germane to the thread:

Why arent their efforts to create "autonomous only" traffic managment scenarios, where people drive into a given, known area, and the area then takes control of managing the traffic and vehicles. Such that you relinquish control of the vehicle to that area's control system, with your destination stated and then your vehicle is managed accordingly.

For example, a parking lot for a really large venue with an autonomous valet system.

YOu drive up and get out and then the system takes over your car and drives off iwth it and parks it and you recall it when needed...

Or managing traffic in a very heavily trafficed bottle-neck of a grid; such as the baybridge merging egress from SF financial district.

If you put in your destination, and join the group, all the cars could then be managed for getting onto the bridge more rapidiously ...

Autonomous doesnt need to drive me from SF to LA, but it would be great if an autonomous hive mind could get all the cars to up throughput in given situations, no?

Re:Former Tesla Firmware Engineer Discusses the System by forapurpose on Friday August 24, 2018 @05:05PM (#17837885)
That seems to match the right tool (AI driving) to the right job (well-defined, well-controlled situations).

I seem to recall that similar ideas go back to the early 1990s, at least, for highways: Drive your car to the entrance ramp, plug in your destination, and the autonomous system takes it from there.

But for many of these things, such as the Bay Bridge or a highway, it seems like there is a simpler solution: Put the cars on a train and take them across by rail. I suspect I'm not the first person to think of it so I wonder why it's never been done (i.e., what problem I'm overlooking).

Re:Former Tesla Firmware Engineer Discusses the System by chipotle_coyote on Friday August 24, 2018 @05:55PM (#17838111)
I suspect it's never been tried because the cost necessary to get from where we are now to there outweighs the potential benefit compared to more conventional transit solutions, carpooling, etc. Once automated driving gets to a point where it's possible to implement "autopilot-only" lanes (and doing so gets past the sociopolitical hurdles), I suspect those will come into play too, though.
Re:Former Tesla Firmware Engineer Discusses the System by coatmatter on Friday August 24, 2018 @07:17PM (#17838522)
Cars, or more specifically the way "we"* tend to (mis)use them (single occupancy mode) are an exponential major world problem.

* Full disclosure: I ride bicycles and only plan to ever live in localities where I won't need to purchase an entire car.

More cars, or even car-friendly tech will never be the solution for the issue of too many cars. See also "induced demand": https://en.wikipedia.org/wiki/Induced_demand

https://www.mrmoneymustache.com/2011/10/06/the-true-cost-of-...

https://carbusters.org/2011/09/08/are-cars-really-our-greate...

Re:Former Tesla Firmware Engineer Discusses the System by samstave on Friday August 24, 2018 @05:51PM (#17838098)
Ive been picturing the rail problem for some time as well.

Not just for cars, but also for cargo... just have a constant gondola-like conveyer that detaches a platform from the line to slow it enough to allow for cargo to get on, then re-zip-it backinto the line and speed it along, de-rail it once it hits its exit/location...

ideally though, in cities, there would be no surface streets and all cars would have their own level below that of bikes pedestrians.

What would SF look like if a superstructure was built above all streets and all pedestrian and bike traffic was moved up there? (sure, SF may be a poor example, so just select [city])

Look at Singapore's vast underground connecting malls between facilities. Those are pretty amazing.

I grade US urban/city planners rather poorly.

Re:Former Tesla Firmware Engineer Discusses the System by forapurpose on Saturday August 25, 2018 @12:41AM (#17839577)
> What would SF look like if a superstructure was built above all streets and all pedestrian and bike traffic was moved up there?

The street level would be dark and storefronts would become difficult to access. If the stores moved up to the 2nd floor (a massive transformation of real estate, probably greatly reducing available living space), what would go on the first level? Not many people would want to live in the dark.

Re:Former Tesla Firmware Engineer Discusses the System by samatman on Saturday August 25, 2018 @06:40AM (#17840338)
It's not a pure hypothetical, large parts of contemporary Chicago were built up a level.

The results are mostly "garden apartments" which are damp, dim, and slightly less expensive.

Re:Former Tesla Firmware Engineer Discusses the System by coatmatter on Friday August 24, 2018 @07:23PM (#17838563)
Underground space isn't unlimited.

Besides, the best integrated transport solution in the world already exists in places like Utrecht, Groningen and Assen thanks to reforms that started decades ago.

Re:Former Tesla Firmware Engineer Discusses the System by ummonk on Friday August 24, 2018 @06:28PM (#17838262)
If it were that easy to setup tech-based infrastructure, we would have had positive train control implemented years ago.
Re:Former Tesla Firmware Engineer Discusses the System by jacques_chester on Friday August 24, 2018 @06:50PM (#17838396)
Rio Tinto have spent more than a decade on autonomous freight trains.

On tracks they own.

With no other traffic than theirs.

And unlimited funding.

Re:Former Tesla Firmware Engineer Discusses the System by pouta on Friday August 24, 2018 @07:05PM (#17838467)
What is Rio Tinto? I'm curious because it is the name of a local city here in Porto.
Re:Former Tesla Firmware Engineer Discusses the System by coatmatter on Friday August 24, 2018 @07:09PM (#17838487)
One of the world's largest mining companies.

https://en.wikipedia.org/wiki/Rio_Tinto_Group

Re:Former Tesla Firmware Engineer Discusses the System by jacques_chester on Friday August 24, 2018 @07:27PM (#17838585)
BHP (largest mining company in the world) and Rio Tinto (second largest) are to parts of Australia as Google and Facebook are to the Bay Area.

And much less apologetic about wielding power.

Re:Former Tesla Firmware Engineer Discusses the System by nojvek on Saturday August 25, 2018 @02:50AM (#17839892)
Yep. Probably why Australia doesn’t churn out Tech behemoths. They’re too busy investing money to dig massive holes in the ground.
Re:Former Tesla Firmware Engineer Discusses the System by jacques_chester on Saturday August 25, 2018 @10:44AM (#17840970)
The dynamics of mine development show interesting parallels with tech, actually.

Lots of mines start from little companies searching for a possible ore body (the idea or market fit), then raising money to perform a closer survey (seed funding). If the closer geological work is promising they often obtain a lease (patents or other IP).

At this point it goes one of two ways. Either they raise enough money to start and operate the mine themselves (series A, B etc, leading to an IPO) or they sell the prospect to a major company.

Then the newly-minted millionaires, who know a lot about mining, invest in the next crop of junior miners.

So as with tech there are conceptual, exploratory, growth and liquidity phases, followed by a process of reinvestment.

I remember realising this when living in Perth and being frustrated that, with quite literally billions of dollars sloshing around the city looking to invest, you'd be hard-pressed to pitch anything smarter than a brochureware website to the local investment class.

There were other structural problems. Stock options are not A Thing for various legal reasons. Failure in starting a high-risk business is a bit of a black mark. There are VCs but so much of their money came from governments trying to jump-start a market that they were about as risk-taking as a loans officer at a bank (what government wants "10 MILLION WASTED ON PHONE APPS" as a headline?).

Meanwhile the super funds are collectively sitting on trillions of dollars[0] and investing an absurdly dumb fraction of it in the ASX. Putting just 0.5% of their holdings into VC would unlock tens of billions of dollars of potential investments.

For which, hey, VCs who lurk here and want to raise a fund: go talk to the Australian superannuation industry. It is a massive pool of underperforming cash languishing in the same dozen public companies and, because Australian law forces all Australians to set aside at least 9.5% of income for retirement, the industry will never stop having incoming funds. There will always be new money to raise[1] and it will probably the 2nd largest pool of pension investments sometime in the next 10-15 years.

I will accept finder's fees and/or massively remunerative job offers as reward for this insight.

[0] https://www.superannuation.asn.au/ArticleDocuments/269/Super...

[1] https://www.willistowerswatson.com/-/media/WTW/Images/Press/...

Re:Former Tesla Firmware Engineer Discusses the System by samstave on Friday August 24, 2018 @08:07PM (#17838739)
You're right. We should all just give up.

I mean, heck. If it were that easy to start a unicorn...

But seriously - I am not saying its easy, I'm just surprised that we haven't made much (publicly known about/announced) efforts along these lines.

I mean, we have TCP down pretty good - if we are simply thinking of cars as packets, a lot of the math should exist to ensure collision-less delivery?

Re:Former Tesla Firmware Engineer Discusses the System by exDM69 on Saturday August 25, 2018 @04:39AM (#17840127)
Well TCP doesn't do collision avoidance, it's a link layer thing. And on Ethernet, it is collision detection on the shared medium. Wireless does avoidance due to the hidden terminal problem.

Neither of these models is really analogous to cars on the road.

But applying collision detection and exponential back off in road traffic is a "fun" thought experiment.

A more apt model would be critical sections and semaphores from concurrent programming. Which is named after a collision avoidance scheme used to control trains. And we all know how difficult concurrent programming can be. I don't want traffic with deadlocks, starvation, busy waiting or live locks.

Re:Former Tesla Firmware Engineer Discusses the System by Pastrami on Friday August 24, 2018 @08:48PM (#17838923)
> if we are simply thinking of cars as packets

You better hope you don't get any dropped packets.

Re:Former Tesla Firmware Engineer Discusses the System by samstave on Friday August 24, 2018 @09:27PM (#17839044)
It's TCPizza delivery! much better than UDPizza - I never know when they cant locate my MAC.
Re:Former Tesla Firmware Engineer Discusses the System by ummonk on Sunday August 26, 2018 @12:50PM (#17846671)
Oh, we lost a car. No big deal, we'll just send another copy!
Re:Former Tesla Firmware Engineer Discusses the System by exDM69 on Saturday August 25, 2018 @04:48AM (#17840143)
Well this would mean collaboration between autonomous car manufacturers to build a common protocol. And this does not fit with their business model of getting massive investment on the grounds of potentially being the first player on the market.

I don't think there is any possibility of large scale autonomous driving without a shared control infrastructure. Autonomous driving will only work as long as autonomous cars are a small minority.

As soon as they stop being in the minority, some shared control infrastructure is necessary.

Case in point: 4 cars arriving in a no-lights 4 way intersection simultaneously will cause a deadlock. A tie breaking scheme requiring some form of communication is necessary.

Re:Former Tesla Firmware Engineer Discusses the System by xg15 on Saturday August 25, 2018 @12:44PM (#17841485)
Not just between car manufacturers, but also between the cars and the area conrol system. Basically, all car manufacturers whould have to agree on a common API that allows the control system to take over, with full access to sensors and drive controls. A manufacturer could not simply refuse to implement the API, because this would effectively make their cars unable to use certain parts of the road network.

Even if manufacturers would somehow manage to agree on an API, it could then be "abused" by competitors or accessory vendors to sell their own customized car assistants, which would instantly work with any car brand - without them having to negotiate with the manufacturers.

I fear we will sooner have a usable open IoT standard than manufacturers giving up that level of control.

Re:Former Tesla Firmware Engineer Discusses the System by coatmatter on Friday August 24, 2018 @07:06PM (#17838475)
Airport baggage systems are mostly automated.
Re:Former Tesla Firmware Engineer Discusses the System by mlaretallack on Friday August 24, 2018 @02:25PM (#17836790)
But I have to add we have a real embedded cortex checking everything, just in case ......
Re:Former Tesla Firmware Engineer Discusses the System by atomicthumbs on Friday August 24, 2018 @07:23PM (#17838554)
So what sort of interlocks do you have on top of that to prevent simultaneous greens?
Re:Former Tesla Firmware Engineer Discusses the System by amanaplanacanal on Friday August 24, 2018 @08:38PM (#17838870)
Traffic signals have hardware interlocks so that can never happen. I don't know if they are using mechanical relays or what, but you can't turn both sides green in software.