Frequently Asked Questions
How Do I Modify an Existing C++ StateBlock / MeasurementProcessor from Python?
Due to technical limitations, when writing Python code it is only possible to
implement a new class. As a workaround, you can use delegation of
implementation. For example, suppose you wanted to modify the
Pinson15NedBlock to add an additional state. Then
you could:
Define a new standalone block called
My16StateBlockas you normally would.When you implement your
generate_dynamics()function, you internally make a copy ofPinson15NedBlockand callgenerate_dynamics()on the Pinson block to get the 15-state matrices from it. Then construct your 16x16 matrix, copy the 15 states from Pinson, and set the 16th state manually.Similarly delegate any of the other methods to the internal Pinson block when possible.