FRC-Utilities / QDriverStation

Cross-platform clone of the FRC Driver Station

Home Page:https://frc-utilities.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introducing LibDS-C

alex-spataru opened this issue · comments

TLDR; check this out (feedback is welcome!).

Hello,

For those who don't know, LibDS is the core of all QDriverStation projects, it handles the communications between the robot, the FMS and the client application and implements all the code required for dynamic protocol loading.

During the last weeks, I have been working on an new implementation of LibDS in plain C. I have decided to do that for the following reasons:

  • Programmers won't need to use Qt to implement their own driver stations with LibDS
  • It will be a lot easier to bind LibDS with other languages, such as Python and Java
  • By having no external dependencies, LibDS should be able to easily integrate to different development platforms, such as Android and iOS
  • Compilation is a LOT faster (~5 seconds on my machine)
  • Since we won't depend on any framework/platform, we should have less bugs related to the frameworks themselves (e.g. Qt socket flags do not work very well with some Linux builds)
  • Being written in plain C, LibDS could benefit from more programmers, since many FRC teams (and programmers in general) are familiar with C/C++
  • And finally, the C implementation is a bit faster and more efficient than its Qt/C++ counterpart

Of course, there are also some drawbacks (e.g. more chances of blowing things up), but in a more general perspective, the new implementation of LibDS brings many benefits.

Now, we all know and love Murphy's Law, which states the following:

Anything that can go wrong will go wrong

I am sure we all praise the Universe for conspiring against our seemingly perfect projects. Jokes aside, I need help with testing this new implementation. While my code may work flawlessly for me, it may not work for the person next to me. Before replacing the "old" LibDS with the C implementation, I would love to get some feedback and possibly (certainly) squashing some bugs hidden in the code.

You can find the repository of LibDS-C here: https://github.com/frc-utilities/libds-c

Thanks for all your help,
--Alex Spataru