imu_vn_100 icon indicating copy to clipboard operation
imu_vn_100 copied to clipboard

[WIP] Beta c++ lib

Open andre-nguyen opened this issue 9 years ago • 13 comments

Still need to:

  • [x] Test with camera sync (I'm getting my parts to make a custom cable only next week).
  • [x] Add error management, there's a new error async handler.
  • [ ] Add more try catch blocks to certain parts
  • [x] Non-binary output handling
  • [ ] Figure out if pausing/muting the output is useful/done the right way. The old pause/resume methods seem odd.
    • The pause method is essentially writing VNASYNC_OFF (value 0) to the VNASY register. The new value is now part of the AsciiAsync enum i.e. AsciiAsync::VNOFF.
    • The old resume method would write VNASYNC_VNYPR (value 0) to the VNASY register. Essentially turning on the async output to Yaw, Pitch, Roll.
    • I suspect we should't be using these methods as they are related to ascii output and not binary output.
  • [x] Confirm they are using JPL notation for quaternions.
    • According to the manual "The last term is the scalar value"

andre-nguyen avatar Feb 27 '16 08:02 andre-nguyen

@versatran01 Sorry for the messy commits but could you maybe give this version a test run without and with camera sync? This shouldn't fix your problem, but I expect a different error code now.

For reference, on my side im running:

Model number: VN-100S-CR
Hardware revision: 7
Firmware version: 2.0.1.0

andre-nguyen avatar Feb 28 '16 00:02 andre-nguyen

@andre-nguyen This looks great. I will test it sometime next week.

It would be nice if you could follow google cpp style, you could just use clang-format to do it. It's also fine if you don't want to.

versatran01 avatar Feb 28 '16 01:02 versatran01

Ready for test :smile:

andre-nguyen avatar Feb 28 '16 02:02 andre-nguyen

So I was able to get my wires and stuff today and I tested using a modified cam_imu_sync node and everything is working on my side at 30Hz! (didn't use the sync_verification node yet)

Note:

  • I am not using a flea3 but a FireflyMV with a modified pointgrey_camera_driver node. The modification was basically to make it inherit from camera_base. Implementation here: https://github.com/andre-nguyen/pointgrey_camera_driver
  • This also required changes on the cam_imu_sync side including adding the vnproglib dependency and of course changing the camera being instanciated https://github.com/andre-nguyen/cam_imu_sync branch pointgrey_generic

andre-nguyen avatar Feb 29 '16 06:02 andre-nguyen

flea3 driver doesn't work with FireflyMV? I prefer not to depend on pointgrey_camera_driver.

versatran01 avatar Feb 29 '16 15:02 versatran01

iirc I tried using it 2-3 weeks ago and I wasn't getting any images from it. I can try again today.

andre-nguyen avatar Feb 29 '16 17:02 andre-nguyen

Yeah, flea3 driver doesn't work for me, my guess is it has something to do with it trying to use format7 even when I set it to use 640x480Y8. In any case, on your side the important part is the vn100 driver update, the cam_imu sync should work for you if you cherry pick the changes that link the package to the vnproglib.

andre-nguyen avatar Feb 29 '16 17:02 andre-nguyen

Seems like the time stamping part doesnt work for me. Did you guys by any chance plug sync_out into sync_in to get the sync data through the binary interface?

andre-nguyen avatar Feb 29 '16 23:02 andre-nguyen

Yes, that's a hack, you have to short sync_in and sync_out to get it to work. Should probably mention that in the readme.

versatran01 avatar Feb 29 '16 23:02 versatran01

Well that explains things

andre-nguyen avatar Mar 01 '16 00:03 andre-nguyen

haha. Sorry about that. cam_imu_sync is mostly used for an internal project thus it is not very well documented.

versatran01 avatar Mar 01 '16 00:03 versatran01

All good, thanks for making it all open source, this has probably accelerated development time on my end by a month.

I soldered the wire and I'm getting time stamps now. I'll run a calibration using Kalibr and get back to you with what the estimated time delay is.

andre-nguyen avatar Mar 01 '16 00:03 andre-nguyen

This works great with the vn200-rugged. Thank you!

Model number: VN-200S-CR
Hardware revision: 2
Firmware version: 1.0.0.0

goldbattle avatar Mar 07 '16 13:03 goldbattle