Expanding pony - p-o-n-y/pony GitHub Wiki

Pony is an open-sourse platform, so you can easily expand the sourse code if you want to. Most likely, you'll want to expand the bus in some way or add an extra function.

Function

Write a function in pony.c, and if you want to use it outside the library, add the function's signature to pony.h.

Bus

Simplest case is adding a variable to pony or any of its subparts (such as imu, gnss, gps, sol, glo and so on). Usually this is needed when the same data is used in different plugins or passed from one plugin to another. Service data (which you probably won't need to expand) goes to pony_core, navigational data (which you are more likely to need) goes to the rest of pony. If you have an array of constant length, use constant arrays, if you don't know for sure what length the array will be, use a pointer and an integer for storing array length (basically, don't double* quaternion; q_len = 4; because quaternions have constant length). For navigational data, consider keeping a validity flag. In pony.c, in the function initialising the parts the new variaqbles belong to, initialise the variables. Most commonly, with a 0 (measurements, calculations, validity flags, counters), a particular value you need (constants) or NULL (pointers).