mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 06:53:34 +08:00
Support disabling GPS output via IOCTL, general cleanup of author and copyright code style
This commit is contained in:
+13
-8
@@ -289,11 +289,13 @@ GPS::task_main()
|
|||||||
|
|
||||||
//no time and satellite information simulated
|
//no time and satellite information simulated
|
||||||
|
|
||||||
if (_report_pub > 0) {
|
if (!(_pub_blocked)) {
|
||||||
orb_publish(ORB_ID(vehicle_gps_position), _report_pub, &_report);
|
if (_report_pub > 0) {
|
||||||
|
orb_publish(ORB_ID(vehicle_gps_position), _report_pub, &_report);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_report_pub = orb_advertise(ORB_ID(vehicle_gps_position), &_report);
|
_report_pub = orb_advertise(ORB_ID(vehicle_gps_position), &_report);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
usleep(2e5);
|
usleep(2e5);
|
||||||
@@ -330,11 +332,14 @@ GPS::task_main()
|
|||||||
while (_Helper->receive(TIMEOUT_5HZ) > 0 && !_task_should_exit) {
|
while (_Helper->receive(TIMEOUT_5HZ) > 0 && !_task_should_exit) {
|
||||||
// lock();
|
// lock();
|
||||||
/* opportunistic publishing - else invalid data would end up on the bus */
|
/* opportunistic publishing - else invalid data would end up on the bus */
|
||||||
if (_report_pub > 0) {
|
|
||||||
orb_publish(ORB_ID(vehicle_gps_position), _report_pub, &_report);
|
|
||||||
|
|
||||||
} else {
|
if (!(_pub_blocked)) {
|
||||||
_report_pub = orb_advertise(ORB_ID(vehicle_gps_position), &_report);
|
if (_report_pub > 0) {
|
||||||
|
orb_publish(ORB_ID(vehicle_gps_position), _report_pub, &_report);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_report_pub = orb_advertise(ORB_ID(vehicle_gps_position), &_report);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
last_rate_count++;
|
last_rate_count++;
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012,2013 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2012-2014 PX4 Development Team. All rights reserved.
|
||||||
* Author: Thomas Gubler <thomasgubler@student.ethz.ch>
|
|
||||||
* Julian Oes <joes@student.ethz.ch>
|
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -41,6 +39,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @file gps_helper.cpp
|
* @file gps_helper.cpp
|
||||||
|
*
|
||||||
|
* @author Thomas Gubler <thomasgubler@student.ethz.ch>
|
||||||
|
* @author Julian Oes <joes@student.ethz.ch>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
float
|
float
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2012-2014 PX4 Development Team. All rights reserved.
|
||||||
* Author: Thomas Gubler <thomasgubler@student.ethz.ch>
|
|
||||||
* Julian Oes <joes@student.ethz.ch>
|
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -35,6 +33,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @file gps_helper.h
|
* @file gps_helper.h
|
||||||
|
* @author Thomas Gubler <thomasgubler@student.ethz.ch>
|
||||||
|
* @author Julian Oes <joes@student.ethz.ch>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef GPS_HELPER_H
|
#ifndef GPS_HELPER_H
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
|
# Copyright (c) 2012-2014 PX4 Development Team. All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
# modification, are permitted provided that the following conditions
|
# modification, are permitted provided that the following conditions
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
|
||||||
* Author: Thomas Gubler <thomasgubler@student.ethz.ch>
|
|
||||||
* Julian Oes <joes@student.ethz.ch>
|
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -33,7 +31,12 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* @file mkt.cpp */
|
/**
|
||||||
|
* @file mkt.cpp
|
||||||
|
*
|
||||||
|
* @author Thomas Gubler <thomasgubler@student.ethz.ch>
|
||||||
|
* @author Julian Oes <joes@student.ethz.ch>
|
||||||
|
*/
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2013 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
|
||||||
* Author: Thomas Gubler <thomasgubler@student.ethz.ch>
|
|
||||||
* Julian Oes <joes@student.ethz.ch>
|
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -33,7 +31,12 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* @file mtk.h */
|
/**
|
||||||
|
* @file mkt.cpp
|
||||||
|
*
|
||||||
|
* @author Thomas Gubler <thomasgubler@student.ethz.ch>
|
||||||
|
* @author Julian Oes <joes@student.ethz.ch>
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef MTK_H_
|
#ifndef MTK_H_
|
||||||
#define MTK_H_
|
#define MTK_H_
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
|
||||||
* Author: Thomas Gubler <thomasgubler@student.ethz.ch>
|
|
||||||
* Julian Oes <joes@student.ethz.ch>
|
|
||||||
* Anton Babushkin <anton.babushkin@me.com>
|
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -40,8 +37,13 @@
|
|||||||
* U-Blox protocol implementation. Following u-blox 6/7 Receiver Description
|
* U-Blox protocol implementation. Following u-blox 6/7 Receiver Description
|
||||||
* including Prototol Specification.
|
* including Prototol Specification.
|
||||||
*
|
*
|
||||||
|
* @author Thomas Gubler <thomasgubler@student.ethz.ch>
|
||||||
|
* @author Julian Oes <joes@student.ethz.ch>
|
||||||
|
* @author Anton Babushkin <anton.babushkin@me.com>
|
||||||
|
*
|
||||||
* @see http://www.u-blox.com/images/downloads/Product_Docs/u-blox6_ReceiverDescriptionProtocolSpec_%28GPS.G6-SW-10018%29.pdf
|
* @see http://www.u-blox.com/images/downloads/Product_Docs/u-blox6_ReceiverDescriptionProtocolSpec_%28GPS.G6-SW-10018%29.pdf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
|||||||
+12
-5
@@ -1,9 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2013 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
|
||||||
* Author: Thomas Gubler <thomasgubler@student.ethz.ch>
|
|
||||||
* Julian Oes <joes@student.ethz.ch>
|
|
||||||
* Anton Babushkin <anton.babushkin@me.com>
|
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -34,7 +31,17 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* @file U-Blox protocol definitions */
|
/**
|
||||||
|
* @file ubx.h
|
||||||
|
*
|
||||||
|
* U-Blox protocol definition. Following u-blox 6/7 Receiver Description
|
||||||
|
* including Prototol Specification.
|
||||||
|
*
|
||||||
|
* @author Thomas Gubler <thomasgubler@student.ethz.ch>
|
||||||
|
* @author Julian Oes <joes@student.ethz.ch>
|
||||||
|
* @author Anton Babushkin <anton.babushkin@me.com>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef UBX_H_
|
#ifndef UBX_H_
|
||||||
#define UBX_H_
|
#define UBX_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user