I believe you simulated a pid loop (https://en.wikipedia.org/wiki/PID_controller) in your code, though I think you might have ignored the integral, which is useful in damping oscillations in some cases.
Pretty much, yes. But PIDs are great for linear control, and not so great for nonlinear control, so tuning a PID becomes a full time job compared to keeping things "plain code". It's easier to understand what you're tweaking and why.
(That said, I'm working on a rewrite atm -it getting turned into just JS- with a follow-up that goes into PID a bit)
I know it's Python and it's supposed to be all snakes and games, but for someone who suffers from ophidiophobia (fear of snakes) when I see one unexpectedly my whole day is ruined (that's it: I see snakes everywhere attacking me).
I've been programming in Python for 20 years (the current logo is from 2006..), and while snake pictures included in articles about Python programming are rare, they trigger that fear in me (and possibly other folks).
I don't want to rip on GP, I think they were more sharing a quirk than calling to action.
But I have a mental model of "shared cost" that I wish more people had: if the cost for me to grin an bear it is less than the sum of the costs of everyone else changing, it's probably not worth changing.
Obviously there are extreme nonlinearities involved in these costs. Very bad things for a few individuals are worth lots of small changes for a majority.
- What's your opinion of doing a stint as a snake handler at a zoo or wildlife park? I believe there are smaller snakes that tend to be a bit bitey but don't hurt very much and are completely non-venomous, and it's apparently part of the job to get used to them quickly (ie, it's the norm to rapidly reach the point of going "ok this isn't the end of the world" - basically the pins-and-needles equivalent of sticking one's arm in a tank full of daddy-long-legs spiders).
- What would you think of having designated "see a snake" days or times of day, where you reroute your adblocker to load pictures of snakes in ad frames at specific times? Going for an exposure therapy vibe, but where you control the parameters, and you start off very easy (eg, one specific day of week, time window of 1 minute, you know exactly when it'll happen to begin with lol).
Asking entirely out of "what happens to the black box if we push this button", coming from someone who has annoying random triggers that I'm trying to get to the bottom of too.
This approach worked for me. I had an irrational fear of eating out after getting blown up in a dining facility in Afghanistan. It took me a couple years of uncomfortable meals to finally realize I could eat without people dying. The mind is a weird thing.
This might work... however I can't see myself doing these things, for reasons that I have no time nor intention. Where I live (UK) the snakes are rare things in the wild, so I really have no desire to fight my fear of them. Simply put, they don't exist in my day-to-day living and that's good. Except when I go to read random post about programming language...
possible con: you'll instantly have all the Vogons from Big Education and Big Porn-Is-Evil lumbering after you, and they will catch you and eat your spirit for dinner.
Good news: it's an AI generated image, it's not real on multiple levels.
Although in other good news, I'm current reimplementing the whole thing in JS so the python parts are getting rewritten soon and the image of a fake snake on a fake plane will have to go, too.
Note that you just says "yes, we do need hundreds more dead in the hopes of putting tens of thousands of people out of a job". Not sure I'm down with that.
Boeing lost hundreds of millions (that it already worked into its budget) from cancelled orders alone. Just because the law didn't do enough according to you, doesn't mean you should be okay with (let alone advocate for) people dying just to teach a company a lesson.
What you want is for a company whose planes end up causing catastrophe to stay in business and never make planes like that again, because no one wins when a large aircraft manufacturer gets shut down. I would like to see all the execs involved in pushing through the "no no it's still a 737 no new training required" bullshit to get fired on the spot, without bonuses, but that's not my call to make, nor even the law's. Unless they want to sue each exec individually, which would have to be brought before the courts by "not the government". Because government is (for good reasons) not allows to meddle with how a private company is structured internally.
>Note that you just says "yes, we do need hundreds more dead in the hopes of putting tens of thousands of people out of a job". Not sure I'm down with that.
Well then you disagree with Boeing and the aviation regulators then.
>Just because the law didn't do enough according to you, doesn't mean you should be okay with (let alone advocate for) people dying just to teach a company a lesson.
Many more will die because the regulators aren't regulating and no one has been held responsible.
>Because government is (for good reasons) not allows to meddle with how a private company is structured internally.
So mass murder is Ok as long as it's done by a corporate executive?
You're the one who thinks corporate executives who design systems that murder hundreds should be left alone. Take your libertarian shit and peddle it elsewhere.
If the reality of living in a country with a constitution, constitutional amendments, as well as a litany of tort and criminal law (and subsequent case law for both) that all dictate what the government can and cannot do feels libertarian to you, I have some unfortunate news for you.
The stormworks community has some amazing gyro/telemetry/PID/auto pilot controllers done in LUA of all things. Managing a helicopter in transitory flight with LUA is never something i thought i'd do.
Sticking with the extremely well documented SimConnect for now (although to be fair, those docs are a very recent thing) mostly because that's what I'm having fun in, but if I ever start playing with FLightgear, who knows!
I played around with FlightGear a few years back. They have a couple of interfaces like UDP and the like, but that was harder to use. Anyway, they have a web interface, and that's where I found a websocket which can stream all the info and set all the values I needed.
I then used it to dampen the input of a flight yoke. The flight yoke was nearly unusable when unfiltered/undamped but nicely usable after that.
Did a similar script in kerbal space program to complete atmospheric flying missions automatically: https://github.com/Aperocky/ksp_eng/blob/master/lib/flight_l....