Unable to access telemetry data in px4 using mavsdk

When i access the Pixhawk IMU data using MAVSDK, it shows zero. But i am able to access the raw IMU values with MAVROS but not throught simple c++ code as given in MAVSDK.