Getting IMU data while running APM

I followed the “Navio2 for developer” section about getting IMU data. But when I tried to run the code when APM was running, it gave the error “APM is running. Can’t launch the example”. So if I want to get the IMU data while the UAV is flying, how should I do? Is ROS helpful?

ROS will be the way to go. Check out our docs: