mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-08 15:51:36 +08:00
HACK: add new topic to log vehicle_gps_position w/o lat/lon
Which has the same fields as vehicle_gps_position, but the lat/lon set to 0. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -42,3 +42,5 @@ float32 heading # heading angle of XYZ body frame rel to NED. Set to NaN if no
|
||||
float32 heading_offset # heading offset of dual antenna array in body frame. Set to NaN if not applicable. (rad, [-PI, PI])
|
||||
|
||||
uint8 selected # GPS selection: 0: GPS1, 1: GPS2. 2: GPS3. 3. Blending multiple receivers
|
||||
|
||||
# TOPICS vehicle_gps_position vehicle_gps_position_wo_lat_lon
|
||||
|
||||
@@ -113,6 +113,7 @@ void LoggedTopics::add_default_topics()
|
||||
add_topic("wind", 1000);
|
||||
|
||||
add_topic("vehicle_local_position_wo_ref", 100);
|
||||
add_topic("vehicle_gps_position_wo_lat_lon", 500);
|
||||
|
||||
if (!_do_not_log_position_data) {
|
||||
add_optional_topic("camera_capture");
|
||||
|
||||
@@ -44,6 +44,7 @@ VehicleGPSPosition::VehicleGPSPosition() :
|
||||
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::nav_and_controllers)
|
||||
{
|
||||
_vehicle_gps_position_pub.advertise();
|
||||
_vehicle_gps_position_wo_lat_lon_pub.advertise();
|
||||
}
|
||||
|
||||
VehicleGPSPosition::~VehicleGPSPosition()
|
||||
@@ -172,6 +173,12 @@ void VehicleGPSPosition::Publish(const sensor_gps_s &gps, uint8_t selected)
|
||||
gps_output.selected = selected;
|
||||
|
||||
_vehicle_gps_position_pub.publish(gps_output);
|
||||
|
||||
vehicle_gps_position_s gps_output_wo_lat_lon;
|
||||
gps_output_wo_lat_lon = gps_output;
|
||||
gps_output_wo_lat_lon.lat = 0;
|
||||
gps_output_wo_lat_lon.lon = 0;
|
||||
_vehicle_gps_position_wo_lat_lon_pub.publish(gps_output_wo_lat_lon);
|
||||
}
|
||||
|
||||
void VehicleGPSPosition::PrintStatus()
|
||||
|
||||
@@ -82,6 +82,7 @@ private:
|
||||
"GPS_MAX_RECEIVERS must match to GPS_MAX_RECEIVERS_BLEND");
|
||||
|
||||
uORB::Publication<vehicle_gps_position_s> _vehicle_gps_position_pub{ORB_ID(vehicle_gps_position)};
|
||||
uORB::Publication<vehicle_gps_position_s> _vehicle_gps_position_wo_lat_lon_pub{ORB_ID(vehicle_gps_position_wo_lat_lon)};
|
||||
|
||||
uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user