Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Control Mario Kart 64 with your car over CAN bus (2016) (github.com/danh42)
197 points by stoppingin on March 9, 2023 | hide | past | favorite | 69 comments


I was involved in a Nissan advertisement project connecting Playstation 4 with a cars as controllers[1]. They did a convention tour with 4 cars playing the same football game in front of a projector.

I did everything except front end and CAN interface though, $20 USB CAN reader device + python. I remember it took a while for my colleague to figure out the right input signals as the bus was quite chatty/high output, like tailing android logcat on verbose. We didn't use any factory unlock codes or anything to get more data.

As a gamer it was not really up to par - big deadzone when turning the wheel from one side to the other as we did not have time to get analogue movement read correctly.

On that particular car model you had to interact with the touch display every 15 minutes or else the whole car went into power saving mode and the CAN bus stopped sending messages.

[1] Nissan Project Driving Controller 2016: https://www.youtube.com/watch?v=QM958yUbr0Y


Sounds like a really cool project to work on but the video is unintentionally hilarious

No, the game is not Rocket League, it's just a regular football game and all these players have to talk to the camera about how great it was to play FIFA with a Nissan Qashqai. All the absurdity of USB steering wheel memes, but played with a straight face


On that particular car model you had to interact with the touch display every 15 minutes or else the whole car went into power saving mode and the CAN bus stopped sending messages.

Wait, what? I guess that doesn't disturb ordinary operation, i.e. driving? Very easy of course to imagine a scenario when you drive and don't touch the display for 15 minutes.

That would have made sense if the CAN was for non-driving stuff only (like the entertainment system) but your application seems to indicate that not being true.

How does the car still operate if the CAN bus goes dark?


I'd assume that the demo car was not having its engine running - it's usual for cars to switch to power-save after 5-10 minutes, mostly to prevent cars from draining their battery if the user forgot to take the key out.


Presumably you can also have the engine running.


I'm surprised that nobody has mentioned yet that this is a built in feature on Teslas. Not Mario Kart, of course, but a generic kart game that you can play with the real steering wheel.


Be careful playing the Tesla kart game, don't wear your tires down by steering the wheel too much


Or do it sitting in a loose surface parking lot (dirt, gravel, whatever).


I doubt the wheels turn at all while in this mode.


they do turn unfortunately turn

https://www.youtube.com/watch?v=_sanbI_ze8c


As noted above they do turn. I think it would be potentially dangerous to allow a software change to prevent the wheel from turning the tires, so unlikely to be implemented.


I understand that, but also, the tesla has software configuration for e.g. how tight the steering is, so ostensibly it would be possible. But it does make sense that there would be no way for the steering column ECU's CAN messages to be blocked from reaching the steering ECU.


I've got a Sparco R383 steering wheel .. on a Fanatec Podium Hub and DD1 direct drive wheelbase.

There's your real steering wheel, and it won't wear out your car's tyres either. ;)


I love how clever this is!

If I wasn’t pretty sure that gunning the engine in park repeatedly is a bad idea (and would draw more than a few stares when done from a street-parking space in Manhattan) I’d give it a try.

Would very much like to see a video of someone using this.


Here is the video from the creator I think: https://www.vice.com/en/article/jpn45k/watch-this-dude-play-...


Here’s the link to the actual video: https://youtu.be/zOSN66wYbTE


The input lag looks terrible.


My guess it is using some periodic signal one of devices on bus sends instead of querying it directly, code looks like it only process signals, not sends any queries


I’m also of the impression that dry turning the wheel isn’t great for the tie rods. But I welcome a car person to teach me the truth.


Park the car with the front tires on two pieces of cardboard (each) to limit the turning forces.

I wouldn’t sweat it for the duration of demo or until you (quickly) got bored with it. You do the same everyday you parallel park a car.


Dry steering will also damage your concrete or pavement. Should probably jack your car up while doing this or turn up the sensitivity so very small inputs translate to larger turns


It will damage your tires more than the concrete.


Concrete, yes. On the other hand, a hot residential asphalt driveway can be boogered up pretty easily.


Or just on jack stands


Worry about your tyres.


The amount of force you're putting into the system, regardless of if the engine is running (and therefore the power steering pump is pumping) or not, is a fraction of the forces the system handles constantly while going around a corner at 60 mph or hitting a pot hole.

It's perfectly fine.


For steering you're exactly wrong. Drive an old car without power steering, on the highway you'll barely notice, but you'll be using all your might to park. It's much easier to steer a rolling tire.

Power steering systems create heat and rely on airflow for cooling...so prolonged steering back and forth in a parking space is a worst case scenario for the system.


> For steering you're exactly wrong. Drive an old car without power steering, on the highway you'll barely notice, but you'll be using all your might to park. It's much easier to steer a rolling tire.

So you're talking about the force the human has to use to turn the steering wheel. In a car with power steering, the human doesn't have to do much, because the pump effectively amplifies the force and exerts it on the tie rods, steering, etc. etc.

Either way, the forces on the steering components are the same, and they're not a problem.

> Power steering systems create heat and rely on airflow for cooling...so prolonged steering back and forth in a parking space is a worst case scenario for the system.

I assume you mean while the engine is idling.. in which case the main cooling fan will kick on when the temp of any component requires it, so it's perfectly fine.


I'm no expert, but what you're saying goes against everything I've ever heard, including from a driving instructor and senior engineer at Ford. The internet also seems to disagree with you.

https://www.eptyres.com/news/details/why-dry-steering-is-bad...

https://engineering.stackexchange.com/questions/16575/dry-st...


Doesn't matter if the engine is running. It only matters whether you're in motion or not. The engine running just enables power steering but the strain on the steering system and the tires are the same.


Thanks! I’ll chill out about avoiding it then. What you say makes complete sense.


Won’t damage tie rods or anything mechanical. May shorten life of tyres.


I... don't think you ever driven anything without power steering.


Surely, you’d do this key on-engine off. (Key on so the CAN bus is active; engine off for obvious reasons.)


Or you could play while driving. Solves the accelerator and steering problems at the same time.


This would be a LOT of fun on salt flats


Extra challenge, drive the same track in real life and in video game


Extra-extra challenge: drive a different track in real life as in the game.


Reminds me of some speedruns where 2 or 3 games were played at same time via one input



No power steering if engine is off, would be hard to play


I don't think you'd need to have the engine running for the throttle pot to send data.


Why purchase a racing simulator cockpit or steering wheel when you've already got a perfectly good one at home!?


Today it would be possible to use e.g. a Raspberry Pi Pico (~6€ including VAT, the CAN module would be more expensive than that) and make it identify as USB input device directly instead of connecting a full single-board computer via network.


My favorite part about it is this issue https://github.com/DanH42/CatchMeIfYouCAN/issues/1


Heh, this would be cool to do with a junk car and a bunch of screens.


I mean, if you have a bunch of free space and itch to play some sim racing, getting the cockpit out of some junker aint a bad idea to start


when did it become common to have an encoder on the steering wheel in a car, and for what purpose?


I would assume it’s been a while actually. Consider that modern cars want to know both what the wheels are doing as well as what you’re trying to get them to do. The oldest driver assist features try to adjust for over-correction and low friction surfaces.



For stability control systems already in older cars and for lane keeping systems now in newer cars. If you want to have servo control over the steering (if even just for automatic parking), you're going to need a position sensor for feedback of the current position.


Steering angle is a critical input for antilock break systems, so quite a while.


ABS is very simple and only needs to know the difference between the speed of the tire and the speed of the road. It is more complicated systems like ESC (which works with ABS) that need to know about steering inputs.


I thought the "speed of the road" was calculated by checking the speeds of the other types, which is trivial if you are going in a straight line, but needs correction if you are steering, hence needs steering angle?

Or is there a simpler way in non-ESC systems?


Simple ABS only cares if the wheel is stationary/goes much slower vs other wheels. Like it wouldn't be perfect but still vast improvement over locking all 4 wheels. Hell, the older ABS systems controlled pair of wheels and activated on both regardless of which one was locking

I'd imagine once they are implementing ESC the ABS also gets the benefit of steering sensor but it is not strictly necessary.


To nitpick, simple ABS is an improvement over locking some of the wheels. It often struggles with preventing a lock of all 4 wheels, because it loses reference for the road speed. A dumb ABS system with just wheel speed sensors can't tell if [0,0,0,0] means all 4 are locked, or if you're stationary.

I don't know as much about the implementation details of modern ESC systems, but I'm guessing this problem is much easier to solve with accelerometer data.


> To nitpick, simple ABS is an improvement over locking some of the wheels

In direction control, sure, but you are getting less braking out of it. The earlier ones could be outbraked by skilled driver keeping brake just at the edge of wheel locking, but that isn't the case for the modern ones, precisely because it can brake each wheel separately

> A dumb ABS system with just wheel speed sensors can't tell if [0,0,0,0] means all 4 are locked, or if you're stationary.

I'm actually curious how they deal with ice, you might be breaking but still getting near zero decceleration from it. Then again if it is that slipper it doesn't matter all that much...


Often cited reason is electric power steering, which technically don't need absolute angle because they assist with torque. Stability controls sounds more plausible to me, and self driving can be another reason.

I don't know for sure, but I think all of above benefit from an encoder and it would be logical enough to have one for any of those.


I wonder if there's a market for VR simulator that uses your actual car as a controller? Mostly for practicing maneuvers like parallel parking, or entering a busy multi-lane turnaround, but also for more immersive racing. It would require ODB-to-Bluetooth adapter and a standalone headset. Main tech difficulty would be dealing with all the different cars, and limitations of standby mode like the lack of power steering.


Can it play Carmageddon?


Isn't it what drivers play every day?


Only Mustang drivers


First and last commit was in 2016 - has anyone ever gotten this working (and perhaps recorded a video)?



“Use item: Activate your winshield wipers.”

Absolutely glorious, thank you for this.


Need sprinklers when hit by blooper


Reminds me of the SEGA arcade in Tokyo: https://youtu.be/3I-a5onDg7s


So...who else is tempted to go to a Pick-A-Part now?


throwback to CdT and being around when Dan first posted this project




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: