Need help understanding archeticture

I am confused as to which part of ROSflight is implemented where. Are the estimator, controller, etc. running on the micro-controller or the companion computer?

What is the role of each of the micro-controller and the companion computer?
Which one has the control law and estimators and stuff?

is all the stuff in the middle on the microcontroller? where is the part for the microntroller in the code?

The ROSflight firmware does have a complimentary filter for fusing IMU and gyro data, and control loops for attitude and attitude rate control. No position or velocity controllers exist in the firmware. The idea is that the firmware provides as little functionality as needed while the companion computer does the majority of the work, so everything needed for higher level autonomy is found there.

To clarify, all of this higher level functionality is not found in ROSflight itself, but is found in other packages like ROSplane and ROScopter. The diagrams you’ve provided are just dealing with the firmware architecture.