Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Betaflight SITL #113

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ cmake_build/
/3.3.2.zip
/PythonClient/**/cloud.txt
/PythonClient/**/cloud.asc
/Unreal/Environments/BlocksV2/BlocksV2.sln
/Unreal/Plugins/AirSim/Content/VehicleAdv/SUV/
/suv_download_tmp
car_assets.zip
Expand Down
2 changes: 2 additions & 0 deletions AirLib/AirLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
<ClInclude Include="include\vehicles\multirotor\api\MultirotorRpcLibAdaptors.hpp" />
<ClInclude Include="include\vehicles\multirotor\api\MultirotorRpcLibClient.hpp" />
<ClInclude Include="include\vehicles\multirotor\api\MultirotorRpcLibServer.hpp" />
<ClInclude Include="include\vehicles\multirotor\firmwares\betaflight\BetaflightApi.hpp" />
<ClInclude Include="include\vehicles\multirotor\firmwares\betaflight\BetaflightParams.hpp" />
<ClInclude Include="include\vehicles\multirotor\firmwares\mavlink\ArduCopterSoloApi.hpp" />
<ClInclude Include="include\vehicles\multirotor\firmwares\mavlink\ArduCopterSoloParams.hpp" />
<ClInclude Include="include\vehicles\multirotor\firmwares\simple_flight\AirSimSimpleFlightBoard.hpp" />
Expand Down
6 changes: 6 additions & 0 deletions AirLib/AirLib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,12 @@
<ClInclude Include="include\common\common_utils\SmoothingFilter.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\vehicles\multirotor\firmwares\betaflight\BetaflightApi.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\vehicles\multirotor\firmwares\betaflight\BetaflightParams.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\safety\ObstacleMap.cpp">
Expand Down
3 changes: 2 additions & 1 deletion AirLib/include/common/AirSimSettings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace airlib
static constexpr char const* kVehicleTypeArduCopterSolo = "arducoptersolo";
static constexpr char const* kVehicleTypeSimpleFlight = "simpleflight";
static constexpr char const* kVehicleTypeArduCopter = "arducopter";
static constexpr char const* kVehicleTypeBetaflight = "betaflight";
static constexpr char const* kVehicleTypePhysXCar = "physxcar";
static constexpr char const* kVehicleTypeArduRover = "ardurover";
static constexpr char const* kVehicleTypeComputerVision = "computervision";
Expand Down Expand Up @@ -817,7 +818,7 @@ namespace airlib
auto vehicle_type = Utils::toLower(settings_json.getString("VehicleType", ""));

std::unique_ptr<VehicleSetting> vehicle_setting;
if (vehicle_type == kVehicleTypePX4 || vehicle_type == kVehicleTypeArduCopterSolo || vehicle_type == kVehicleTypeArduCopter || vehicle_type == kVehicleTypeArduRover)
if (vehicle_type == kVehicleTypePX4 || vehicle_type == kVehicleTypeArduCopterSolo || vehicle_type == kVehicleTypeArduCopter || vehicle_type == kVehicleTypeBetaflight || vehicle_type == kVehicleTypeArduRover)
vehicle_setting = createMavLinkVehicleSetting(settings_json);
//for everything else we don't need derived class yet
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "vehicles/multirotor/firmwares/simple_flight/SimpleFlightQuadXParams.hpp"
#include "vehicles/multirotor/firmwares/mavlink/ArduCopterSoloParams.hpp"
#include "vehicles/multirotor/firmwares/arducopter/ArduCopterParams.hpp"
#include "vehicles/multirotor/firmwares/betaflight/BetaflightParams.hpp"

namespace msr
{
Expand All @@ -33,6 +34,9 @@ namespace airlib
else if (vehicle_setting->vehicle_type == AirSimSettings::kVehicleTypeArduCopter) {
config.reset(new ArduCopterParams(*static_cast<const AirSimSettings::MavLinkVehicleSetting*>(vehicle_setting), sensor_factory));
}
else if (vehicle_setting->vehicle_type == AirSimSettings::kVehicleTypeBetaflight) {
config.reset(new BetaflightParams(*static_cast<const AirSimSettings::MavLinkVehicleSetting*>(vehicle_setting), sensor_factory));
}
else if (vehicle_setting->vehicle_type == "" || //default config
vehicle_setting->vehicle_type == AirSimSettings::kVehicleTypeSimpleFlight) {
config.reset(new SimpleFlightQuadXParams(vehicle_setting, sensor_factory));
Expand Down
Loading