[squeak-dev] Building a linux/Pi library to call via FFI

David T. Lewis lewis at mail.msen.com
Fri Sep 11 02:29:30 UTC 2015


On Thu, Sep 10, 2015 at 06:55:55PM -0700, tim Rowledge wrote:
> 
> On 10-09-2015, at 12:33 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> > But I think I may re-do it as a plugin today, not least because it seems that the ARM ffi interface has a problem with returning floats; they come back as Character null. I may not be a great IEEE floating point standard expert but that doesn?t seem quite right.
> > 
> > I'm sure this can be fixed.  Have you talked to Doug McPherson?
> 
> Yup. 
> 
> And after much head-scratching because I?ve completely forgotten how plugin building works, I finally have a plugin that takes 9 float values, does unspeakable things to them and spits out a four float quaternion answer. On a Pi2 it test at ~ 8 micro-sec per call, which isn?t bad for 270+ floating point operations including 150 divides. The next fun is feeding live IMU data to it and finding away to display something meaningful as a result.
> 

Can you send a copy of your plugin as a fileout, change set, or mcz?

I am expecting that you have one primitive with 9 double precision
Float objects as parameters that are coerced to single precision floats
and passed as parameters to MadgwickAHRSupdate(), which deposits
the results into the q0, q1, q2, and q3 variables, which are coerced
back to double precision Float objects and pushed back to the image
as the result. Is that right?

Thanks,
Dave
 


More information about the Squeak-dev mailing list