Not to say this is bad or incorrect, but this is very unidiomatic Clojure. I would question the amount of global state, and the broad use of loops inside threads. This can’t be fun to try and test! Perhaps better would be to make pure functions to take current telemetry as an argument and return actions as outputs, perhaps all at once or more likely individually for each control. You could then capture all of this in…
I'm a Clojure fan but I'm not sure a modeling and simulation problem such as this is the best use case for it. Sure, you can do it, but it probably wouldn't be my first choice. Last I checked, Aerospace software is still dominated by C/C++ and Ada (still alive because it found itself a niche), and there's good reasons for it. The satellite simulators I worked on had to be able to execute actual flight code from the v…
Show HN: SpaceX Dragon simulator docking autopilot in Clojure
31–38 of 38 posts
Re: Show HN: SpaceX Dragon simulator docking autopilot in Clojure
#32Earlier quoted context omitted.
Each time someone complains a working program is not "idiomatic" in what ever language I die a little inside. That makes it sound you approach this from a haughty presumptuous, uncharitable angle. It sounds like you exclude the possibility that the author did not try it "your way" first, for example, but found a simpler way to implement it. "That's not the most obvious to do it IMO" or "I would have preferred to do i…
Clojure is a mostly pure functional language, it is very uncommon to have almost all logic reach out to global variables to do work. It’s also rare to see multithreaded code that eschews most of the mechanisms built into the language for multithreading. These two things together (pure functional programming and strong concurrency primitives) are arguably the fundamental motivations behind the language. You value simp…
We all like to critizice things that offend our sense of aesthetics. But criticism always hurts the author. It's ok if it hurts if it is valid critique. And the only way to get understood is to be explicit.
Re: Show HN: SpaceX Dragon simulator docking autopilot in Clojure
#33It crashed for me right as it docked with:
Syntax error (ExceptionInfo) compiling at (/private/var/folders/8f/wlmmp1rs38966nkmrs_slnjd1vkfkk/T/form-
init8037093313867620508.clj:1:125).
throw+: {:type :etaoin/timeout, :message "Wait for {:css \"#success > h2\"} element is visible", :timeout 300, :interval 0.33, :times 910, :predicate #object[etaoin.api$wait_visible$fn__4868 0x173b24c4 "etaoin.api$wait_visible$fn__4868@173b24c4"]}Re: Show HN: SpaceX Dragon simulator docking autopilot in Clojure
#34Earlier quoted context omitted.
Heh, never thought about it that way! But good question. Yes, it can translate on 2 axes at the same time, since the control loops for each axis run in separate threads, so there is no control locking. The same is with rotation - it can e.g. pitch, roll and yaw at the same time.
So if you click one of the rotate buttons after it has zeroed out the offsets will it correct? Is it using a PID model or something else?
Re: Show HN: SpaceX Dragon simulator docking autopilot in Clojure
#35Earlier quoted context omitted.
So if you click one of the rotate buttons after it has zeroed out the offsets will it correct? Is it using a PID model or something else?
The SpaceX simulation is simplistic enough and gives you enough data that you really don't need a PID controller to hit the target numbers.
Re: Show HN: SpaceX Dragon simulator docking autopilot in Clojure
#36Source code:
https://gist.github.com/ggerganov/092b86a59fa34926998953701a...
Re: Show HN: SpaceX Dragon simulator docking autopilot in Clojure
#37From all the auto-pilots I've seen so far, I believe mine docks the fastest (without cheating): https://youtu.be/jWQQH2_UGLw Source code: https://gist.github.com/ggerganov/092b86a59fa34926998953701a...
Re: Show HN: SpaceX Dragon simulator docking autopilot in Clojure
#38From all the auto-pilots I've seen so far, I believe mine docks the fastest (without cheating): https://youtu.be/jWQQH2_UGLw Source code: https://gist.github.com/ggerganov/092b86a59fa34926998953701a...
Nice! It will will the award in speed, but not in the amount of fuel it wasted :D