delete control_state and cleanup vehicle_attitude (#7882)

This commit is contained in:
Daniel Agar
2017-09-21 16:24:53 -04:00
committed by GitHub
parent 5bea264a5f
commit b4755297ec
42 changed files with 776 additions and 1061 deletions
@@ -64,7 +64,7 @@
#include <uORB/uORB.h>
#include <uORB/topics/sensor_combined.h> // this topics hold the acceleration data
#include <uORB/topics/actuator_controls.h> // this topic gives the actuators control input
#include <uORB/topics/control_state.h> // this topic holds the orientation of the hippocampus
#include <uORB/topics/vehicle_attitude.h> // this topic holds the orientation of the hippocampus
extern "C" __EXPORT int uuv_example_app_main(int argc, char *argv[]);
@@ -78,9 +78,9 @@ int uuv_example_app_main(int argc, char *argv[])
orb_set_interval(sensor_sub_fd, 200);
/* subscribe to control_state topic */
int ctrl_state_sub_fd = orb_subscribe(ORB_ID(control_state));
int vehicle_attitude_sub_fd = orb_subscribe(ORB_ID(vehicle_attitude));
/* limit the update rate to 5 Hz */
orb_set_interval(ctrl_state_sub_fd, 200);
orb_set_interval(vehicle_attitude_sub_fd, 200);
/* advertise to actuator_control topic */
struct actuator_controls_s act;
@@ -90,7 +90,7 @@ int uuv_example_app_main(int argc, char *argv[])
/* one could wait for multiple topics with this technique, just using one here */
px4_pollfd_struct_t fds[] = {
{ .fd = sensor_sub_fd, .events = POLLIN },
{ .fd = ctrl_state_sub_fd, .events = POLLIN },
{ .fd = vehicle_attitude_sub_fd, .events = POLLIN },
};
int error_counter = 0;
@@ -127,9 +127,9 @@ int uuv_example_app_main(int argc, char *argv[])
(double)raw_sensor.accelerometer_m_s2[2]);
/* obtained data for the third file descriptor */
struct control_state_s raw_ctrl_state;
struct vehicle_attitude_s raw_ctrl_state;
/* copy sensors raw data into local buffer */
orb_copy(ORB_ID(control_state), ctrl_state_sub_fd, &raw_ctrl_state);
orb_copy(ORB_ID(vehicle_attitude), vehicle_attitude_sub_fd, &raw_ctrl_state);
// get current rotation matrix from control state quaternions, the quaternions are generated by the
// attitude_estimator_q application using the sensor data