global fix of current warnings and errors in CI server (#2341)

This commit is contained in:
Gautier Hattenberger
2018-10-04 19:09:05 +02:00
committed by GitHub
parent 26b66809b0
commit 2298c2b391
23 changed files with 102 additions and 124 deletions
+1 -1
View File
@@ -149,7 +149,7 @@
<firmware name="rotorcraft">
<target name="ap" board="lisa_s_1.0">
<module name="radio_control" type="spektrum">
<module name="radio_control" type="superbitrf_rc">
<define name="RADIO_MODE" value="RADIO_FLAP"/>
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="0"/>
+2 -2
View File
@@ -7,10 +7,10 @@
<firmware name="rotorcraft">
<target name="ap" board="bebop2"/>
<target name="nps" board="pc">
<!--target name="nps" board="pc">
<module name="fdm" type="jsbsim"/>
<module name="udp"/>
</target>
</target-->
<!-- Subsystem section -->
<module name="telemetry" type="transparent_udp"/>
@@ -7,10 +7,10 @@
<firmware name="rotorcraft">
<target name="ap" board="bebop"/>
<target name="nps" board="pc">
<!--target name="nps" board="pc">
<module name="fdm" type="jsbsim"/>
<module name="udp"/>
</target>
</target-->
<!--define name="USE_SONAR" value="TRUE"/-->
+2 -2
View File
@@ -5,10 +5,10 @@
<firmware name="rotorcraft">
<target name="ap" board="bebop"/>
<target name="nps" board="pc">
<!--target name="nps" board="pc">
<module name="fdm" type="jsbsim"/>
<module name="udp"/>
</target>
</target-->
<!--define name="USE_SONAR" value="TRUE"/-->
-44
View File
@@ -201,50 +201,6 @@
gui_color="white"
release="65aa9a711dc4a66ed2d7cf73c0f5872bbeeb821d"
/>
<aircraft
name="GeniusDD"
ac_id="129"
airframe="airframes/tudelft/heliGeniusDD.xml"
radio="radios/dummy.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/rotorcraft_basic.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/heli_throttle_curve.xml modules/gps_ubx_ucenter.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
gui_color="#c99fb4caebdd"
/>
<aircraft
name="GeniusDDBart"
ac_id="130"
airframe="airframes/tudelft/bs_helidd_indi.xml"
radio="radios/dummy.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/rotorcraft_basic.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/gps_ubx_ucenter.xml modules/air_data.xml modules/ahrs_int_cmpl_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
gui_color="#c99fb4caebdd"
/>
<aircraft
name="Heli450"
ac_id="99"
airframe="airframes/tudelft/heli450.xml"
radio="radios/dummy.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/rotorcraft_basic.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/gps_ubx_ucenter.xml modules/air_data.xml modules/geo_mag.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_rate.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
gui_color="#c99fb4caebdd"
/>
<aircraft
name="Helisa"
ac_id="114"
airframe="airframes/tudelft/walkera_genius_v2.xml"
radio="radios/FlyElectricRx31_DX6.xml"
telemetry="telemetry/rotorcraft_with_logger.xml"
flight_plan="flight_plans/rotorcraft_basic.xml"
settings="settings/rotorcraft_basic.xml [settings/superbitrf.xml]"
settings_modules="modules/logger_sd_spi_direct.xml modules/ahrs_int_cmpl_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
gui_color="#9b69e5ce9e7a"
/>
<aircraft
name="Iris"
ac_id="66"
+1
View File
@@ -6,4 +6,5 @@ RUN wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
libgazebo7-dev \
rustc cargo \
&& rm -rf /var/lib/apt/lists/*
+1 -1
View File
@@ -50,7 +50,7 @@ struct i2c_thread_t {
pthread_cond_t condition;
};
static void i2c_arch_init(struct i2c_periph *p)
static void UNUSED i2c_arch_init(struct i2c_periph *p)
{
pthread_t tid;
if (pthread_create(&tid, NULL, i2c_thread, (void *)p) != 0) {
@@ -155,8 +155,8 @@ static void stm32_gpio_init(void) {
/* Enabling GPIO-related clocks, the mask comes from the
registry header file.*/
rccResetAHB1(STM32_GPIO_EN_MASK);
rccEnableAHB1(STM32_GPIO_EN_MASK, true);
rccResetAHB(STM32_GPIO_EN_MASK);
rccEnableAHB(STM32_GPIO_EN_MASK, true);
/* Initializing all the defined GPIO ports.*/
#if STM32_HAS_GPIOA
@@ -123,7 +123,7 @@ void guidance_hybrid_init(void)
#define INT32_ANGLE_HIGH_RES_NORMALIZE(_a) { \
while ((_a) > (INT32_ANGLE_PI << (INT32_ANGLE_HIGH_RES_FRAC - INT32_ANGLE_FRAC))) (_a) -= (INT32_ANGLE_2_PI << (INT32_ANGLE_HIGH_RES_FRAC - INT32_ANGLE_FRAC)); \
while ((_a) < (-INT32_ANGLE_PI << (INT32_ANGLE_HIGH_RES_FRAC - INT32_ANGLE_FRAC))) (_a) += (INT32_ANGLE_2_PI << (INT32_ANGLE_HIGH_RES_FRAC - INT32_ANGLE_FRAC)); \
while ((_a) < -(INT32_ANGLE_PI << (INT32_ANGLE_HIGH_RES_FRAC - INT32_ANGLE_FRAC))) (_a) += (INT32_ANGLE_2_PI << (INT32_ANGLE_HIGH_RES_FRAC - INT32_ANGLE_FRAC)); \
}
void guidance_hybrid_run(void)
@@ -23,17 +23,17 @@
* Find a colored item and track its geo-location and update a waypoint to it
*/
#ifndef BLOB_LOCATOR_FPS
#define BLOB_LOCATOR_FPS 0 ///< Default FPS (zero means run at camera fps)
#endif
PRINT_CONFIG_VAR(BLOB_LOCATOR_FPS)
#include "modules/computer_vision/cv_blob_locator.h"
#include "modules/computer_vision/cv.h"
#include "modules/computer_vision/blob/blob_finder.h"
#include "modules/computer_vision/blob/imavmarker.h"
#include "modules/computer_vision/detect_window.h"
#ifndef BLOB_LOCATOR_FPS
#define BLOB_LOCATOR_FPS 0 ///< Default FPS (zero means run at camera fps)
#endif
PRINT_CONFIG_VAR(BLOB_LOCATOR_FPS)
uint8_t color_lum_min;
uint8_t color_lum_max;
@@ -27,18 +27,22 @@
#define RES 100
#define N_WINDOW_SIZES 1
#include "cv.h"
#include "detect_window.h"
#include <stdio.h>
#ifndef DETECT_WINDOW_FPS
#define DETECT_WINDOW_FPS 0 ///< Default FPS (zero means run at camera fps)
#endif
PRINT_CONFIG_VAR(DETECT_WINDOW_FPS)
#include "cv.h"
#include "detect_window.h"
#include <stdio.h>
void detect_window_init(void)
{
#ifdef DETECT_WINDOW_CAMERA
cv_add_to_device(&DETECT_WINDOW_CAMERA, detect_window, DETECT_WINDOW_FPS);
#else
#warning "DETECT_WINDOW_CAMERA not defined, CV callback not added to device"
#endif
}
struct image_t *detect_window(struct image_t *img)
@@ -112,7 +112,7 @@ void act_fast(struct image_t *img, uint8_t fast_threshold, uint16_t *num_corners
break;
} else {
// make a step:
struct point_t loc = {agents[a].x, agents[a].y};
struct point_t loc = { .x = agents[a].x, .y = agents[a].y};
image_gradient_pixel(img, &loc, gradient_method, &dx, &dy);
int gradient = (abs(dx) + abs(dy)) / 2;
if (abs(gradient) >= min_gradient) {
@@ -708,12 +708,12 @@ void image_show_flow_color(struct image_t *img, struct flow_t *vectors, uint16_t
for (uint16_t i = 0; i < points_cnt; i++) {
// Draw a line from the original position with the flow vector
struct point_t from = {
vectors[i].pos.x / subpixel_factor,
vectors[i].pos.y / subpixel_factor
.x = vectors[i].pos.x / subpixel_factor,
.y = vectors[i].pos.y / subpixel_factor
};
struct point_t to = {
(vectors[i].pos.x + vectors[i].flow_x) / subpixel_factor,
(vectors[i].pos.y + vectors[i].flow_y) / subpixel_factor
.x = (vectors[i].pos.x + vectors[i].flow_x) / subpixel_factor,
.y = (vectors[i].pos.y + vectors[i].flow_y) / subpixel_factor
};
if (vectors[i].error >= LARGE_FLOW_ERROR) {
@@ -847,7 +847,7 @@ void image_draw_rectangle(struct image_t *img, int x_min, int x_max, int y_min,
* Example colors: white = {127, 255, 127, 255}, green = {0, 127, 0, 127};
* @param[in] size_crosshair Actually the half size of the cross hair
*/
void image_draw_crosshair(struct image_t *img, struct point_t *loc, const uint8_t *color, int size_crosshair)
void image_draw_crosshair(struct image_t *img, struct point_t *loc, const uint8_t *color, uint32_t size_crosshair)
{
struct point_t from, to;
@@ -107,7 +107,7 @@ void image_show_points_color(struct image_t *img, struct point_t *points, uint16
void image_show_flow_color(struct image_t *img, struct flow_t *vectors, uint16_t points_cnt, uint8_t subpixel_factor,
const uint8_t *color, const uint8_t *bad_color);
void image_show_flow(struct image_t *img, struct flow_t *vectors, uint16_t points_cnt, uint8_t subpixel_factor);
void image_draw_crosshair(struct image_t *img, struct point_t *loc, const uint8_t *color, int size_crosshair);
void image_draw_crosshair(struct image_t *img, struct point_t *loc, const uint8_t *color, uint32_t size_crosshair);
void image_draw_rectangle(struct image_t *img, int x_min, int x_max, int y_min, int y_max, uint8_t *color);
void image_draw_line(struct image_t *img, struct point_t *from, struct point_t *to);
void image_draw_line_color(struct image_t *img, struct point_t *from, struct point_t *to, const uint8_t *color);
@@ -1050,7 +1050,7 @@ static int cmp_flow(const void *a, const void *b)
*/
static int cmp_array(const void *a, const void *b)
{
uint16_t *pa = *(uint16_t **)a;
uint16_t *pb = *(uint16_t **)b;
const uint16_t *pa = (const uint16_t *)a;
const uint16_t *pb = (const uint16_t *)b;
return pa[0] - pb[0];
}
@@ -29,7 +29,8 @@
#include "subsystems/radio_control.h"
#include "firmwares/rotorcraft/stabilization.h"
#include "firmwares/rotorcraft/stabilization/stabilization_attitude.h"
#include "firmwares/rotorcraft/stabilization/stabilization_attitude_rc_setpoint.h"
#include "autopilot.h"
// Own Variables
@@ -60,12 +61,12 @@ void guidance_h_module_enter(void)
ctrl.cmd.psi = stateGetNedToBodyEulers_i()->psi;
// Convert RC to setpoint
stabilization_attitude_read_rc_setpoint_eulers(&rc_sp, in_flight, false, false);
stabilization_attitude_read_rc_setpoint_eulers(&ctrl.rc_sp, autopilot.in_flight, false, false);
}
void guidance_h_module_read_rc(void)
{
stabilization_attitude_read_rc_setpoint_eulers(&rc_sp, in_flight, false, false);
stabilization_attitude_read_rc_setpoint_eulers(&ctrl.rc_sp, autopilot.in_flight, false, false);
}
+43 -41
View File
@@ -27,7 +27,9 @@
#include "xsens700.h"
#include "led.h"
#include "generated/airframe.h"
#include "mcu_periph/uart.h"
#if USE_GPS_XSENS
#include "math/pprz_geodetic_wgs84.h"
@@ -50,7 +52,7 @@ volatile int xsens_configured = 0;
void xsens700_init(void)
{
xsens.parser.status = UNINIT;
xsens700.parser.status = UNINIT;
xsens_configured = 30;
xsens_msg_statusword = 0;
@@ -139,17 +141,17 @@ void xsens700_periodic(void)
void parse_xsens700_msg(void)
{
uint8_t offset = 0;
if (xsens.parser.id == XSENS_ReqLeverArmGpsAck_ID) {
xsens_gps_arm_x = XSENS_ReqLeverArmGpsAck_x(xsens.parser.msg_buf);
xsens_gps_arm_y = XSENS_ReqLeverArmGpsAck_y(xsens.parser.msg_buf);
xsens_gps_arm_z = XSENS_ReqLeverArmGpsAck_z(xsens.parser.msg_buf);
} else if (xsens.parser.id == XSENS_Error_ID) {
xsens_errorcode = XSENS_Error_errorcode(xsens.parser.msg_buf);
} else if (xsens.parser.id == XSENS_MTData2_ID) {
for (offset = 0; offset < xsens.parser.len;) {
uint8_t code1 = xsens.parser.msg_buf[offset];
uint8_t code2 = xsens.parser.msg_buf[offset + 1];
int subpacklen = (int)xsens.parser.msg_buf[offset + 2];
if (xsens700.parser.id == XSENS_ReqLeverArmGpsAck_ID) {
xsens_gps_arm_x = XSENS_ReqLeverArmGpsAck_x(xsens700.parser.msg_buf);
xsens_gps_arm_y = XSENS_ReqLeverArmGpsAck_y(xsens700.parser.msg_buf);
xsens_gps_arm_z = XSENS_ReqLeverArmGpsAck_z(xsens700.parser.msg_buf);
} else if (xsens700.parser.id == XSENS_Error_ID) {
xsens_errorcode = XSENS_Error_errorcode(xsens700.parser.msg_buf);
} else if (xsens700.parser.id == XSENS_MTData2_ID) {
for (offset = 0; offset < xsens700.parser.len;) {
uint8_t code1 = xsens700.parser.msg_buf[offset];
uint8_t code2 = xsens700.parser.msg_buf[offset + 1];
int subpacklen = (int)xsens700.parser.msg_buf[offset + 2];
offset += 3;
if (code1 == 0x10) {
@@ -164,25 +166,25 @@ void parse_xsens700_msg(void)
} else if (code1 == 0x20) {
if (code2 == 0x30) {
// Attitude Euler
xsens700.euler.phi = XSENS_DATA_Euler_roll(xsens.parser.msg_buf, offset) * M_PI / 180;
xsens700.euler.theta = XSENS_DATA_Euler_pitch(xsens.parser.msg_buf, offset) * M_PI / 180;
xsens700.euler.psi = XSENS_DATA_Euler_yaw(xsens.parser.msg_buf, offset) * M_PI / 180;
xsens700.euler.phi = XSENS_DATA_Euler_roll(xsens700.parser.msg_buf, offset) * M_PI / 180;
xsens700.euler.theta = XSENS_DATA_Euler_pitch(xsens700.parser.msg_buf, offset) * M_PI / 180;
xsens700.euler.psi = XSENS_DATA_Euler_yaw(xsens700.parser.msg_buf, offset) * M_PI / 180;
xsens700.new_attitude = TRUE;
}
} else if (code1 == 0x40) {
if (code2 == 0x10) {
// Delta-V
xsens700.accel.x = XSENS_DATA_Acceleration_x(xsens.parser.msg_buf, offset) * 100.0f;
xsens700.accel.y = XSENS_DATA_Acceleration_y(xsens.parser.msg_buf, offset) * 100.0f;
xsens700.accel.z = XSENS_DATA_Acceleration_z(xsens.parser.msg_buf, offset) * 100.0f;
xsens700.accel.x = XSENS_DATA_Acceleration_x(xsens700.parser.msg_buf, offset) * 100.0f;
xsens700.accel.y = XSENS_DATA_Acceleration_y(xsens700.parser.msg_buf, offset) * 100.0f;
xsens700.accel.z = XSENS_DATA_Acceleration_z(xsens700.parser.msg_buf, offset) * 100.0f;
}
} else if (code1 == 0x80) {
if (code2 == 0x20) {
// Rate Of Turn
xsens700.gyro.p = XSENS_DATA_RateOfTurn_x(xsens.parser.msg_buf, offset) * M_PI / 180;
xsens700.gyro.q = XSENS_DATA_RateOfTurn_y(xsens.parser.msg_buf, offset) * M_PI / 180;
xsens700.gyro.r = XSENS_DATA_RateOfTurn_z(xsens.parser.msg_buf, offset) * M_PI / 180;
xsens700.gyro.p = XSENS_DATA_RateOfTurn_x(xsens700.parser.msg_buf, offset) * M_PI / 180;
xsens700.gyro.q = XSENS_DATA_RateOfTurn_y(xsens700.parser.msg_buf, offset) * M_PI / 180;
xsens700.gyro.r = XSENS_DATA_RateOfTurn_z(xsens700.parser.msg_buf, offset) * M_PI / 180;
}
} else if (code1 == 0x30) {
if (code2 == 0x10) {
@@ -191,7 +193,7 @@ void parse_xsens700_msg(void)
} else if (code1 == 0xE0) {
if (code2 == 0x20) {
// Status Word
xsens_msg_statusword = XSENS_DATA_StatusWord_status(xsens.parser.msg_buf, offset);
xsens_msg_statusword = XSENS_DATA_StatusWord_status(xsens700.parser.msg_buf, offset);
//xsens700.gps.tow = xsens_msg_statusword;
#if USE_GPS_XSENS
if (bit_is_set(xsens_msg_statusword, 2) && bit_is_set(xsens_msg_statusword, 1)) {
@@ -205,17 +207,17 @@ void parse_xsens700_msg(void)
}
} else if (code1 == 0x88) {
if (code2 == 0x40) {
xsens700.gps.week = XSENS_DATA_GpsSol_week(xsens.parser.msg_buf, offset);
xsens700.gps.num_sv = XSENS_DATA_GpsSol_numSv(xsens.parser.msg_buf, offset);
xsens700.gps.pacc = XSENS_DATA_GpsSol_pAcc(xsens.parser.msg_buf, offset);
xsens700.gps.sacc = XSENS_DATA_GpsSol_sAcc(xsens.parser.msg_buf, offset);
xsens700.gps.pdop = XSENS_DATA_GpsSol_pDop(xsens.parser.msg_buf, offset);
xsens700.gps.week = XSENS_DATA_GpsSol_week(xsens700.parser.msg_buf, offset);
xsens700.gps.num_sv = XSENS_DATA_GpsSol_numSv(xsens700.parser.msg_buf, offset);
xsens700.gps.pacc = XSENS_DATA_GpsSol_pAcc(xsens700.parser.msg_buf, offset);
xsens700.gps.sacc = XSENS_DATA_GpsSol_sAcc(xsens700.parser.msg_buf, offset);
xsens700.gps.pdop = XSENS_DATA_GpsSol_pDop(xsens700.parser.msg_buf, offset);
} else if (code2 == 0xA0) {
// SVINFO
xsens700.gps.tow = XSENS_XDI_GpsSvInfo_iTOW(xsens.parser.msg_buf + offset);
xsens700.gps.tow = XSENS_XDI_GpsSvInfo_iTOW(xsens700.parser.msg_buf + offset);
#if USE_GPS_XSENS
xsens700.gps.nb_channels = XSENS_XDI_GpsSvInfo_nch(xsens.parser.msg_buf + offset);
xsens700.gps.nb_channels = XSENS_XDI_GpsSvInfo_nch(xsens700.parser.msg_buf + offset);
xsens700.gps.last_3dfix_ticks = sys_time.nb_sec_rem;
xsens700.gps.last_3dfix_time = sys_time.nb_sec;
@@ -223,21 +225,21 @@ void parse_xsens700_msg(void)
uint8_t i;
// Do not write outside buffer
for (i = 0; i < Min(xsens700.gps.nb_channels, GPS_NB_CHANNELS); i++) {
uint8_t ch = XSENS_XDI_GpsSvInfo_chn(xsens.parser.msg_buf + offset, i);
uint8_t ch = XSENS_XDI_GpsSvInfo_chn(xsens700.parser.msg_buf + offset, i);
if (ch > xsens700.gps.nb_channels) { continue; }
xsens700.gps.svinfos[ch].svid = XSENS_XDI_GpsSvInfo_svid(xsens.parser.msg_buf + offset, i);
xsens700.gps.svinfos[ch].flags = XSENS_XDI_GpsSvInfo_bitmask(xsens.parser.msg_buf + offset, i);
xsens700.gps.svinfos[ch].qi = XSENS_XDI_GpsSvInfo_qi(xsens.parser.msg_buf + offset, i);
xsens700.gps.svinfos[ch].cno = XSENS_XDI_GpsSvInfo_cnr(xsens.parser.msg_buf + offset, i);
xsens700.gps.svinfos[ch].svid = XSENS_XDI_GpsSvInfo_svid(xsens700.parser.msg_buf + offset, i);
xsens700.gps.svinfos[ch].flags = XSENS_XDI_GpsSvInfo_bitmask(xsens700.parser.msg_buf + offset, i);
xsens700.gps.svinfos[ch].qi = XSENS_XDI_GpsSvInfo_qi(xsens700.parser.msg_buf + offset, i);
xsens700.gps.svinfos[ch].cno = XSENS_XDI_GpsSvInfo_cnr(xsens700.parser.msg_buf + offset, i);
}
#endif
}
} else if (code1 == 0x50) {
if (code2 == 0x10) {
//xsens700.gps.hmsl = XSENS_DATA_Altitude_h(xsens.parser.msg_buf,offset)* 1000.0f;
//xsens700.gps.hmsl = XSENS_DATA_Altitude_h(xsens700.parser.msg_buf,offset)* 1000.0f;
} else if (code2 == 0x20) {
// Altitude Elipsoid
xsens700.gps.lla_pos.alt = XSENS_DATA_Altitude_h(xsens.parser.msg_buf, offset) * 1000.0f;
xsens700.gps.lla_pos.alt = XSENS_DATA_Altitude_h(xsens700.parser.msg_buf, offset) * 1000.0f;
// Compute geoid (MSL) height
float geoid_h = wgs84_ellipsoid_to_geoid_f(xsens700.lla_f.lat, xsens700.lla_f.lon);
@@ -254,15 +256,15 @@ void parse_xsens700_msg(void)
xsens700.gps.last_3dfix_time = sys_time.nb_sec;
xsens700.gps.week = 0; // FIXME
xsens700.lla_f.lat = RadOfDeg(XSENS_DATA_LatLon_lat(xsens.parser.msg_buf, offset));
xsens700.lla_f.lon = RadOfDeg(XSENS_DATA_LatLon_lon(xsens.parser.msg_buf, offset));
xsens700.lla_f.lat = RadOfDeg(XSENS_DATA_LatLon_lat(xsens700.parser.msg_buf, offset));
xsens700.lla_f.lon = RadOfDeg(XSENS_DATA_LatLon_lon(xsens700.parser.msg_buf, offset));
}
} else if (code1 == 0xD0) {
if (code2 == 0x10) {
// Velocity
xsens700.vel.x = XSENS_DATA_VelocityXYZ_x(xsens.parser.msg_buf, offset);
xsens700.vel.y = XSENS_DATA_VelocityXYZ_y(xsens.parser.msg_buf, offset);
xsens700.vel.z = XSENS_DATA_VelocityXYZ_z(xsens.parser.msg_buf, offset);
xsens700.vel.x = XSENS_DATA_VelocityXYZ_x(xsens700.parser.msg_buf, offset);
xsens700.vel.y = XSENS_DATA_VelocityXYZ_y(xsens700.parser.msg_buf, offset);
xsens700.vel.z = XSENS_DATA_VelocityXYZ_z(xsens700.parser.msg_buf, offset);
xsens700.gps.ned_vel.x = xsens700.vel.x;
xsens700.gps.ned_vel.y = xsens700.vel.y;
xsens700.gps.ned_vel.z = xsens700.vel.x;
-1
View File
@@ -34,7 +34,6 @@
#include "xsens_parser.h"
#if USE_GPS_XSENS
#include "subsystems/gps.h"
#endif
+3
View File
@@ -38,6 +38,7 @@
#include "mcu_periph/spi.h"
#include "subsystems/abi.h"
#include <pthread.h>
#include <unistd.h>
#include "subsystems/datalink/downlink.h"//FIXME, include only when link need
#include "filters/median_filter.h"
@@ -200,7 +201,9 @@ void *sonar_bebop_read(void *data __attribute__((unused)))
// Send Telemetry report
DOWNLINK_SEND_SONAR(DefaultChannel, DefaultDevice, &sonar_bebop.meas, &sonar_bebop.distance);
#endif
#ifndef SITL
}
#endif
usleep(10000); //100Hz
}
return NULL;
@@ -31,14 +31,20 @@
#include "subsystems/radio_control.h"
#include "mcu_periph/sys_time_arch.h"
#include "mcu_periph/uart.h"
#include "mcu_periph/gpio.h"
void spektrum_soft_bind_init(void) {
void spektrum_soft_bind_init(void)
{
}
#define _UART_INIT(i) i ## _init()
#define UART_INIT(i) _UART_INIT(i)
bool bind_soft_value;
void spektrum_soft_bind_click(bool val ) {
void spektrum_soft_bind_click(bool val)
{
#ifndef INTER_MCU_AP
send_spektrum_bind();
#else
@@ -49,7 +55,8 @@ void spektrum_soft_bind_click(bool val ) {
}
#ifndef INTER_MCU_AP
void send_spektrum_bind(void) {
void send_spektrum_bind(void)
{
//power cycle the spektrum
#if defined(RADIO_CONTROL_LED)
LED_OFF(RADIO_CONTROL_LED);
@@ -65,7 +72,11 @@ void send_spektrum_bind(void) {
//put to bind mode
RADIO_CONTROL_BIND_IMPL_FUNC(); //basically = radio_control_spektrum_try_bind()
SpektrumUartInit();
// init uart peripherals
UART_INIT(SPEKTRUM_PRIMARY_UART);
#ifdef SPEKTRUM_SECONDARY_UART
UART_INIT(SPEKTRUM_SECONDARY_UART);
#endif
}
#endif
+1
View File
@@ -141,6 +141,7 @@ void mpu9250_spi_event(struct Mpu9250_Spi *mpu)
switch (mpu->spi_trans.status) {
case SPITransFailed:
mpu->config.init_status--; // Retry config (TODO max retry)
/* Falls through. */
case SPITransSuccess:
case SPITransDone:
mpu9250_send_config(mpu9250_spi_write_to_reg, (void *)mpu, &(mpu->config));
+1 -1
View File
@@ -476,7 +476,7 @@ void ins_int_update_gps(struct GpsState *gps_s __attribute__((unused))) {}
* This is only used with the extended version of the vertical float filter
*/
#if USE_VFF_EXTENDED
static void agl_cb(uint8_t sender_id, float distance) {
static void agl_cb(uint8_t __attribute__((unused)) sender_id, float distance) {
if (distance <= 0 || !(ins_int.baro_initialized)) {
return;
}
+1 -1
View File
@@ -133,8 +133,8 @@ void nps_autopilot_run_step(double time)
float dist = (float) sensors.sonar.value;
AbiSendMsgAGL(AGL_SONAR_NPS_ID, dist);
uint16_t foo = 0;
#ifdef SENSOR_SYNC_SEND_SONAR
uint16_t foo = 0;
DOWNLINK_SEND_SONAR(DefaultChannel, DefaultDevice, &foo, &dist);
#endif