Re:An interactive guide to sensor fusion with quaternions
by oneshtein on Friday August 15, 2025 @01:29PM
(#44915112)
Function is vibe coded.
[ Parent
| on HN ]
Re:An interactive guide to sensor fusion with quaternions
by noodlejs on Friday August 15, 2025 @01:42PM
(#44915267)
Hi! Author here. I hand wrote this website and the source code of the examples mostly comes from my own debugging tools. That method in particular is just a very minimal implementation of section 8.5.2 of this textbook (but I tried to make it friendly for the blog post).
Re:An interactive guide to sensor fusion with quaternions
by polishdude20 on Friday August 15, 2025 @02:28PM
(#44915875)
Sorry, but x,y and z are not even being used in that function...
Re:An interactive guide to sensor fusion with quaternions
by noodlejs on Friday August 15, 2025 @02:39PM
(#44916003)
LOL ok yeah, that's a copy-paste issue. I'll fix it up here shortly.
Re:An interactive guide to sensor fusion with quaternions
by xeonmc on Friday August 15, 2025 @02:45PM
(#44916074)
imo it's better to express the conversion relation as exp-log pairs:
fn exp(q: Quat) -> Quat {
let ijk = sqrt(q.i*q.i + q.j*q.j + q.k*q.k);
Quat {
i: exp(q.l) * sin(ijk) * q.i / ijk,
j: exp(q.l) * sin(ijk) * q.j / ijk,
k: exp(q.l) * sin(ijk) * q.k / ijk,
l: exp(q.l) * cos(ijk),
}
}
fn log(q: Quat) -> Quat {
let ijk = sqrt(q.i*q.i + q.j*q.j + q.k*q.k);
Quat {
i: atan2(ijk, q.l) * q.i / ijk,
j: atan2(ijk, q.l) * q.j / ijk,
k: atan2(ijk, q.l) * q.k / ijk,
l: 0.5 * log(q.i*q.i + q.j*q.j + q.k*q.k + q.l*q.l),
}
}
Re:An interactive guide to sensor fusion with quaternions
by ARob109 on Friday August 15, 2025 @02:52PM
(#44916148)
I've been seeing "that's vibe coded" comments a lot lately on posts. Comments that call out code that may or may not be vibe-coded. At what point should these types of posts start getting down-voted? It's not constructive, and IMO imparts a negative connotation.
HN: Show HN Awesome New LLM can Code!! Also HN: TFA is vibe coded angry pitchfork or ugh
Re:An interactive guide to sensor fusion with quaternions
by RossBencina on Friday August 15, 2025 @11:56PM
(#44919996)
Yes, and low effort backhanded comments about "AI slop" are also getting tiresome.
Re:An interactive guide to sensor fusion with quaternions
by bubblyworld on Saturday August 16, 2025 @12:16AM
(#44920118)
I agree, this is becoming HN's new favourite way to detail a conversation unproductively. It's up there with doxxing and ad hominems in my opinion - unverifiable and usually antagonistic.
Re:An interactive guide to sensor fusion with quaternions
by feoren on Friday August 15, 2025 @01:44PM
(#44915306)
What makes you so confident that you can tell that a 3-line function is AI? Especially given that the author denies it, with evidence.
Re:An interactive guide to sensor fusion with quaternions
by oneshtein on Friday August 15, 2025 @03:23PM
(#44916454)
It cannot work, because x,y,z are not used at all.
Re:An interactive guide to sensor fusion with quaternions
by margalabargala on Friday August 15, 2025 @03:39PM
(#44916573)
This looks more like a copy paste error, where the function signature requests xyz, but the function itself uses an undefined array "axis" of which xyz correspond to indexes 0-2.
The code is correct aside from the obvious bug.
Bugs predate the existence of AI by decades. This particular bug doesn't look like one an AI would write.
Re:An interactive guide to sensor fusion with quaternions
by throwaway290 on Friday August 15, 2025 @10:51PM
(#44919702)
unused variables is typical LLM.
Also it's a short function. It's impossible to miss unused parame if you read your own code at all. And if you somehow don't... then it's deserved anyway.
Re:An interactive guide to sensor fusion with quaternions
by margalabargala on Sunday August 17, 2025 @11:41AM
(#44932389)
Maybe typical LLM of a year ago. If a function was one-shot written by an LLM today, it would not make that mistake.
It could make that mistake if it writes the header at one point, and the body separately. Though that's unlikely.
But I suspect this is a genuine human error.
Re:An interactive guide to sensor fusion with quaternions
by CamperBob2 on Friday August 15, 2025 @03:16PM
(#44916394)
Then again, that's just the AI would say...
Re:An interactive guide to sensor fusion with quaternions
by dzidol on Friday August 15, 2025 @07:00PM
(#44918255)
I love vibe coding. Even the variables don't match (x, y, x vs axis[3]) and the coder is left with no knowledge what's they doing. You'll probably either prompt for fixing it or fix it yourself, but will still not get substantial amount of the domain knowledge -- and let's be honest, this is example just the simplest term there, that's why the code is so easy to correct even without thinking...
Re:An interactive guide to sensor fusion with quaternions
by dzidol on Friday August 15, 2025 @07:04PM
(#44918278)
I just figured out from subcomments it's an excerpt from article, so my comment just doesn't fit here (thought author of the comment I replied to just braged they can vibe code something ad hoc and don't need to read about domain). Apologies for the mistake (still keeping my opinion about vibe coding).