forked from Archive/PX4-Autopilot
update according to pull request review comments
This commit is contained in:
parent
7c62fe885d
commit
627ea3b23e
|
@ -289,14 +289,19 @@ function(px4_os_add_flags)
|
||||||
list(APPEND added_c_flags ${BBBLUE_COMPILE_FLAGS})
|
list(APPEND added_c_flags ${BBBLUE_COMPILE_FLAGS})
|
||||||
list(APPEND added_cxx_flags ${BBBLUE_COMPILE_FLAGS})
|
list(APPEND added_cxx_flags ${BBBLUE_COMPILE_FLAGS})
|
||||||
|
|
||||||
|
set(LIBROBOTCONTROL_INSTALL_DIR $ENV{LIBROBOTCONTROL_INSTALL_DIR})
|
||||||
|
|
||||||
# TODO: Wmissing-field-initializers ignored on older toolchain, can be removed eventually
|
# TODO: Wmissing-field-initializers ignored on older toolchain, can be removed eventually
|
||||||
|
#
|
||||||
# On cross compile host system and native build system:
|
# On cross compile host system and native build system:
|
||||||
# a) install robotcontrol.h and rc/* into /usr/local/include
|
# a) select and define LIBROBOTCONTROL_INSTALL_DIR environment variable so that
|
||||||
# b) install pre-built native (ARM) version of librobotcontrol.* into /usr/local/lib
|
# other unwanted headers will not be included
|
||||||
list(APPEND added_cxx_flags -I/usr/local/include -Wno-missing-field-initializers)
|
# b) install robotcontrol.h and rc/* into $LIBROBOTCONTROL_INSTALL_DIR/include
|
||||||
list(APPEND added_c_flags -I/usr/local/include)
|
# c) install pre-built native (ARM) version of librobotcontrol.* into $LIBROBOTCONTROL_INSTALL_DIR/lib
|
||||||
|
list(APPEND added_cxx_flags -I${LIBROBOTCONTROL_INSTALL_DIR}/include -Wno-missing-field-initializers)
|
||||||
|
list(APPEND added_c_flags -I${LIBROBOTCONTROL_INSTALL_DIR}/include)
|
||||||
|
|
||||||
list(APPEND added_exe_linker_flags -L/usr/local/lib)
|
list(APPEND added_exe_linker_flags -L${LIBROBOTCONTROL_INSTALL_DIR}/lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# output
|
# output
|
||||||
|
|
|
@ -71,9 +71,9 @@ mc_att_control start
|
||||||
#fw_att_control start
|
#fw_att_control start
|
||||||
#fw_pos_control_l1 start
|
#fw_pos_control_l1 start
|
||||||
|
|
||||||
mavlink start -x -u 14556 -r 1000000
|
mavlink start -n SoftAp -x -u 14556 -r 1000000
|
||||||
# -n name of wifi interface: SoftAp, wlan or your custom interface,
|
# -n name of wifi interface: SoftAp, wlan or your custom interface,
|
||||||
# e.g., -n wlan . The default on BBBlue is SoftAp
|
# e.g., -n SoftAp . The default is wlan
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#ifdef __DF_BBBLUE
|
#ifdef __PX4_POSIX_BBBLUE
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -79,4 +79,4 @@ int BBBlueRcPWMOut::send_output_pwm(const uint16_t *pwm, int num_outputs)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __DF_BBBLUE
|
#endif // __PX4_POSIX_BBBLUE
|
||||||
|
|
|
@ -42,8 +42,7 @@ int RcInput::init()
|
||||||
/**
|
/**
|
||||||
* initialize the data of each channel
|
* initialize the data of each channel
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < input_rc_s::RC_INPUT_MAX_CHANNELS && i < 16; ++i) {
|
for (i = 0; i < input_rc_s::RC_INPUT_MAX_CHANNELS; ++i) {
|
||||||
//_data.values defined as int[16] and RC_INPUT_MAX_CHANNELS (=18) > 16
|
|
||||||
_data.values[i] = UINT16_MAX;
|
_data.values[i] = UINT16_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1150,12 +1150,8 @@ Mavlink::find_broadcast_address()
|
||||||
const struct in_addr netmask_addr = query_netmask_addr(_socket_fd, *cur_ifreq);
|
const struct in_addr netmask_addr = query_netmask_addr(_socket_fd, *cur_ifreq);
|
||||||
const struct in_addr broadcast_addr = compute_broadcast_addr(sin_addr, netmask_addr);
|
const struct in_addr broadcast_addr = compute_broadcast_addr(sin_addr, netmask_addr);
|
||||||
|
|
||||||
#ifdef __PX4_POSIX_BBBLUE
|
|
||||||
|
|
||||||
if (strstr(cur_ifreq->ifr_name, _mavlink_wifi_name) == NULL) { continue; }
|
if (strstr(cur_ifreq->ifr_name, _mavlink_wifi_name) == NULL) { continue; }
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
PX4_INFO("using network interface %s, IP: %s", cur_ifreq->ifr_name, inet_ntoa(sin_addr));
|
PX4_INFO("using network interface %s, IP: %s", cur_ifreq->ifr_name, inet_ntoa(sin_addr));
|
||||||
PX4_INFO("with netmask: %s", inet_ntoa(netmask_addr));
|
PX4_INFO("with netmask: %s", inet_ntoa(netmask_addr));
|
||||||
PX4_INFO("and broadcast IP: %s", inet_ntoa(broadcast_addr));
|
PX4_INFO("and broadcast IP: %s", inet_ntoa(broadcast_addr));
|
||||||
|
@ -1951,9 +1947,7 @@ Mavlink::task_main(int argc, char *argv[])
|
||||||
_mode = MAVLINK_MODE_NORMAL;
|
_mode = MAVLINK_MODE_NORMAL;
|
||||||
bool _force_flow_control = false;
|
bool _force_flow_control = false;
|
||||||
|
|
||||||
#ifdef __PX4_POSIX_BBBLUE
|
_mavlink_wifi_name = __DEFAULT_MAVLINK_WIFI;
|
||||||
_mavlink_wifi_name = __PX4_BBBLUE_DEFAULT_MAVLINK_WIFI;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __PX4_NUTTX
|
#ifdef __PX4_NUTTX
|
||||||
/* the NuttX optarg handler does not
|
/* the NuttX optarg handler does not
|
||||||
|
@ -2004,9 +1998,7 @@ Mavlink::task_main(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
#ifdef __PX4_POSIX_BBBLUE
|
|
||||||
_mavlink_wifi_name = myoptarg;
|
_mavlink_wifi_name = myoptarg;
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef __PX4_POSIX
|
#ifdef __PX4_POSIX
|
||||||
|
|
|
@ -63,10 +63,8 @@
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __PX4_POSIX_BBBLUE
|
#ifndef __DEFAULT_MAVLINK_WIFI
|
||||||
#ifndef __PX4_BBBLUE_DEFAULT_MAVLINK_WIFI
|
#define __DEFAULT_MAVLINK_WIFI "wlan"
|
||||||
#define __PX4_BBBLUE_DEFAULT_MAVLINK_WIFI "SoftAp"
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <uORB/uORB.h>
|
#include <uORB/uORB.h>
|
||||||
|
@ -608,9 +606,7 @@ private:
|
||||||
unsigned _network_buf_len;
|
unsigned _network_buf_len;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __PX4_POSIX_BBBLUE
|
|
||||||
const char *_mavlink_wifi_name;
|
const char *_mavlink_wifi_name;
|
||||||
#endif
|
|
||||||
|
|
||||||
int _socket_fd;
|
int _socket_fd;
|
||||||
Protocol _protocol;
|
Protocol _protocol;
|
||||||
|
|
|
@ -98,7 +98,7 @@ PARAM_DEFINE_FLOAT(BAT_A_PER_V, -1.0);
|
||||||
* means that measurements are expected to come from a power module. If the value is set to
|
* means that measurements are expected to come from a power module. If the value is set to
|
||||||
* 'External' then the system expects to receive mavlink battery status messages.
|
* 'External' then the system expects to receive mavlink battery status messages.
|
||||||
*
|
*
|
||||||
* @min -1
|
* @min 0
|
||||||
* @max 1
|
* @max 1
|
||||||
* @value 0 Power Module
|
* @value 0 Power Module
|
||||||
* @value 1 External
|
* @value 1 External
|
||||||
|
|
|
@ -626,7 +626,6 @@ void VotedSensorsUpdate::accel_poll(struct sensor_combined_s &raw)
|
||||||
|
|
||||||
// write the best sensor data to the output variables
|
// write the best sensor data to the output variables
|
||||||
if (best_index >= 0) {
|
if (best_index >= 0) {
|
||||||
raw.timestamp = _last_sensor_data[best_index].timestamp;
|
|
||||||
raw.accelerometer_integral_dt = _last_sensor_data[best_index].accelerometer_integral_dt;
|
raw.accelerometer_integral_dt = _last_sensor_data[best_index].accelerometer_integral_dt;
|
||||||
memcpy(&raw.accelerometer_m_s2, &_last_sensor_data[best_index].accelerometer_m_s2, sizeof(raw.accelerometer_m_s2));
|
memcpy(&raw.accelerometer_m_s2, &_last_sensor_data[best_index].accelerometer_m_s2, sizeof(raw.accelerometer_m_s2));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue