mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 17:40:34 +08:00
adapted to new vehicle attitude message
This commit is contained in:
@@ -78,6 +78,15 @@
|
||||
#include <systemlib/state_table.h>
|
||||
#include <systemlib/systemlib.h>
|
||||
#include <systemlib/hysteresis/hysteresis.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <poll.h>
|
||||
#include <float.h>
|
||||
#include <matrix/math.hpp>
|
||||
|
||||
#include <uORB/uORB.h>
|
||||
#include <uORB/topics/actuator_armed.h>
|
||||
#include <uORB/topics/actuator_controls.h>
|
||||
#include <uORB/topics/battery_status.h>
|
||||
@@ -106,7 +115,6 @@
|
||||
#include <uORB/topics/vehicle_land_detected.h>
|
||||
#include <uORB/topics/vehicle_local_position.h>
|
||||
#include <uORB/topics/vtol_vehicle_status.h>
|
||||
#include <uORB/uORB.h>
|
||||
|
||||
typedef enum VEHICLE_MODE_FLAG
|
||||
{
|
||||
@@ -1160,7 +1168,9 @@ static void commander_set_home_position(orb_advert_t &homePub, home_position_s &
|
||||
home.y = localPosition.y;
|
||||
home.z = localPosition.z;
|
||||
|
||||
home.yaw = attitude.yaw;
|
||||
matrix::Quaternion<float> q(&attitude.q[0]);
|
||||
matrix::Euler<float> euler(q);
|
||||
home.yaw = euler(2);
|
||||
|
||||
PX4_INFO("home: %.7f, %.7f, %.2f", home.lat, home.lon, (double)home.alt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user