diff --git a/src/examples/px4_simple_app/px4_simple_app.c b/src/examples/px4_simple_app/px4_simple_app.c index 67faf88ae7..c9f9d61927 100644 --- a/src/examples/px4_simple_app/px4_simple_app.c +++ b/src/examples/px4_simple_app/px4_simple_app.c @@ -48,7 +48,7 @@ #include #include -#include +#include #include __EXPORT int px4_simple_app_main(int argc, char *argv[]); @@ -57,8 +57,8 @@ int px4_simple_app_main(int argc, char *argv[]) { PX4_INFO("Hello Sky!"); - /* subscribe to sensor_combined topic */ - int sensor_sub_fd = orb_subscribe(ORB_ID(sensor_combined)); + /* subscribe to vehicle_acceleration topic */ + int sensor_sub_fd = orb_subscribe(ORB_ID(vehicle_acceleration)); /* limit the update rate to 5 Hz */ orb_set_interval(sensor_sub_fd, 200); @@ -99,20 +99,20 @@ int px4_simple_app_main(int argc, char *argv[]) if (fds[0].revents & POLLIN) { /* obtained data for the first file descriptor */ - struct sensor_combined_s raw; + struct vehicle_acceleration_s accel; /* copy sensors raw data into local buffer */ - orb_copy(ORB_ID(sensor_combined), sensor_sub_fd, &raw); + orb_copy(ORB_ID(vehicle_acceleration), sensor_sub_fd, &accel); PX4_INFO("Accelerometer:\t%8.4f\t%8.4f\t%8.4f", - (double)raw.accelerometer_m_s2[0], - (double)raw.accelerometer_m_s2[1], - (double)raw.accelerometer_m_s2[2]); + (double)accel.xyz[0], + (double)accel.xyz[1], + (double)accel.xyz[2]); /* set att and publish this information for other apps the following does not have any meaning, it's just an example */ - att.q[0] = raw.accelerometer_m_s2[0]; - att.q[1] = raw.accelerometer_m_s2[1]; - att.q[2] = raw.accelerometer_m_s2[2]; + att.q[0] = accel.xyz[0]; + att.q[1] = accel.xyz[1]; + att.q[2] = accel.xyz[2]; orb_publish(ORB_ID(vehicle_attitude), att_pub, &att); }