From 2c450280d21d0ebe60d9ccbe866e443fc26fe697 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 22 Aug 2020 14:34:05 -0400 Subject: [PATCH] examples/uuv_example_app: replace sensor_combined with vehicle_acceleration --- .../uuv_example_app/uuv_example_app.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/examples/uuv_example_app/uuv_example_app.cpp b/src/examples/uuv_example_app/uuv_example_app.cpp index a02900c5c1..99bd013827 100644 --- a/src/examples/uuv_example_app/uuv_example_app.cpp +++ b/src/examples/uuv_example_app/uuv_example_app.cpp @@ -62,7 +62,7 @@ // Include uORB and the required topics for this app #include -#include // this topics hold the acceleration data +#include // this topics hold the acceleration data #include // this topic gives the actuators control input #include // this topic holds the orientation of the hippocampus @@ -72,8 +72,8 @@ int uuv_example_app_main(int argc, char *argv[]) { PX4_INFO("auv_hippocampus_example_app has been started!"); - /* 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); @@ -118,17 +118,17 @@ int uuv_example_app_main(int argc, char *argv[]) if (fds[0].revents & POLLIN) { /* obtained data for the first file descriptor */ - struct sensor_combined_s raw_sensor; + vehicle_acceleration_s sensor{}; /* copy sensors raw data into local buffer */ - orb_copy(ORB_ID(sensor_combined), sensor_sub_fd, &raw_sensor); + orb_copy(ORB_ID(vehicle_acceleration), sensor_sub_fd, &sensor); // printing the sensor data into the terminal PX4_INFO("Acc:\t%8.4f\t%8.4f\t%8.4f", - (double)raw_sensor.accelerometer_m_s2[0], - (double)raw_sensor.accelerometer_m_s2[1], - (double)raw_sensor.accelerometer_m_s2[2]); + (double)sensor.xyz[0], + (double)sensor.xyz[1], + (double)sensor.xyz[2]); /* obtained data for the third file descriptor */ - struct vehicle_attitude_s raw_ctrl_state; + vehicle_attitude_s raw_ctrl_state{}; /* copy sensors raw data into local buffer */ orb_copy(ORB_ID(vehicle_attitude), vehicle_attitude_sub_fd, &raw_ctrl_state);