Translating RC Messages to Acceleration

Hello all,

I am trying to find a way to translate RC messages, the raw channel inputs from the RC, to an acceleration that can then be sent to Mavros topics to control the drone in offboard mode. Does anyone know how to do this? Also, I will need access to the RC messages when the FCU is in offboard mode, but to my understanding, it seems that Mavros does not publish the actual RC data to mavros/rc/out when it is in offboard mode. I could be wrong though.

Does anyone know a solution to either of these two problems? Any help would be greatly appreciated. I want to be able to use the RC messages for a machine learning experiment that I am working on. I can provide more details if anyone is interested or needs them to help. I need to be able to capture what a pilot is telling the drone to do at all times (whether the drone is in manual, offboard, etc.) and then translate that raw RC message to a usable command (acceleration, velocity, pose, etc.) for the drone. If what I am asking is not possible, does anyone know of an alternative way of doing this?

Thank you.