Making an ESP32-based quadcopter from scratch
Python arduinoautopilotcontrol-theorydroneesp32flight-controlflight-controllermavlinkquadcopterquadcopter-firmwareuav
Fix simulator run Add missing extern variables. Fix warning.
Oleg Kalachevcdfba72a0b05
diff --git a/flix/mavlink.ino b/flix/mavlink.inoindex a635947..66feef6 100644--- a/flix/mavlink.ino+++ b/flix/mavlink.ino@@ -41,7 +41,7 @@ void sendMavlink() {MAV_VTOL_STATE_UNDEFINED, landed ? MAV_LANDED_STATE_ON_GROUND : MAV_LANDED_STATE_IN_AIR);sendMessage(&msg);- uint16_t voltages[] = {voltage * 1000, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX};+ uint16_t voltages[] = {(uint16_t)(voltage * 1000), UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX};uint16_t voltagesExt[] = {0, 0, 0, 0};float remaining = constrain(mapf(voltage, 3.4, 4.2, 0, 1), 0, 1);mavlink_msg_battery_status_pack(mavlinkSysId, MAV_COMP_ID_AUTOPILOT1, &msg, 0, MAV_BATTERY_FUNCTION_ALL,diff --git a/gazebo/wifi.h b/gazebo/wifi.hindex 1c7b708..b01bac0 100644--- a/gazebo/wifi.h+++ b/gazebo/wifi.h@@ -11,7 +11,12 @@#include <sys/poll.h>#include <gazebo/gazebo.hh>-int wifiMode = 1; // mock+// Mocks+int wifiMode = 1;+int wifiLongRange = 0;+int espnowChannel = 6;+const int W_DISABLED = 0, W_AP = 1, W_STA = 2, W_ESPNOW = 3;+int udpLocalPort = 14580;int udpRemotePort = 14550;const char *udpRemoteIP = "255.255.255.255";