mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-14 06:01:35 +08:00
Add position ground truth. (#5819)
Have confirmed this works with gazebo sitl.
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <uORB/topics/manual_control_setpoint.h>
|
||||
#include <uORB/topics/actuator_outputs.h>
|
||||
#include <uORB/topics/vehicle_attitude.h>
|
||||
#include <uORB/topics/vehicle_global_position.h>
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
#include <uORB/topics/battery_status.h>
|
||||
#include <drivers/drv_accel.h>
|
||||
@@ -58,6 +59,7 @@
|
||||
#include <uORB/topics/distance_sensor.h>
|
||||
#include <v1.0/mavlink_types.h>
|
||||
#include <v1.0/common/mavlink.h>
|
||||
#include <geo/geo.h>
|
||||
namespace simulator
|
||||
{
|
||||
|
||||
@@ -247,10 +249,17 @@ private:
|
||||
,
|
||||
_rc_channels_pub(nullptr),
|
||||
_attitude_pub(nullptr),
|
||||
_gpos_pub(nullptr),
|
||||
_actuator_outputs_sub{},
|
||||
_vehicle_attitude_sub(-1),
|
||||
_manual_sub(-1),
|
||||
_vehicle_status_sub(-1),
|
||||
_hil_local_proj_ref(),
|
||||
_hil_local_proj_inited(false),
|
||||
_hil_ref_lat(0),
|
||||
_hil_ref_lon(0),
|
||||
_hil_ref_alt(0),
|
||||
_hil_ref_timestamp(0),
|
||||
_rc_input{},
|
||||
_actuators{},
|
||||
_attitude{},
|
||||
@@ -317,6 +326,8 @@ private:
|
||||
// uORB publisher handlers
|
||||
orb_advert_t _rc_channels_pub;
|
||||
orb_advert_t _attitude_pub;
|
||||
orb_advert_t _gpos_pub;
|
||||
orb_advert_t _lpos_pub;
|
||||
|
||||
// uORB subscription handlers
|
||||
int _actuator_outputs_sub[ORB_MULTI_MAX_INSTANCES];
|
||||
@@ -324,6 +335,14 @@ private:
|
||||
int _manual_sub;
|
||||
int _vehicle_status_sub;
|
||||
|
||||
// hil map_ref data
|
||||
struct map_projection_reference_s _hil_local_proj_ref;
|
||||
bool _hil_local_proj_inited;
|
||||
double _hil_ref_lat;
|
||||
double _hil_ref_lon;
|
||||
float _hil_ref_alt;
|
||||
uint64_t _hil_ref_timestamp;
|
||||
|
||||
// uORB data containers
|
||||
struct rc_input_values _rc_input;
|
||||
struct actuator_outputs_s _actuators[ORB_MULTI_MAX_INSTANCES];
|
||||
|
||||
Reference in New Issue
Block a user