Skip to content

Commit

Permalink
move MavLinkDroneController.cpp to header file
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Jun 30, 2017
1 parent 7a6c0fb commit dca11b6
Show file tree
Hide file tree
Showing 19 changed files with 1,385 additions and 1,391 deletions.
1 change: 0 additions & 1 deletion AirLib/AirLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\controllers\DroneControllerBase.cpp" />
<ClCompile Include="src\controllers\MavLinkDroneController.cpp" />
<ClCompile Include="src\safety\ObstacleMap.cpp" />
<ClCompile Include="src\rpc\RpcLibClient.cpp" />
<ClCompile Include="src\rpc\RpcLibServer.cpp" />
Expand Down
9 changes: 3 additions & 6 deletions AirLib/AirLib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,6 @@
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\controllers\DroneControllerBase.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\controllers\MavLinkDroneController.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\controllers\Settings.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand All @@ -413,5 +407,8 @@
<ClCompile Include="src\controllers\FileSystem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\controllers\DroneControllerBase.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
4 changes: 3 additions & 1 deletion AirLib/include/common/common_utils/EnumFlags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,7 @@ class EnumFlags

};

#endif
} //namespace


#endif
18 changes: 5 additions & 13 deletions AirLib/include/controllers/DroneControllerBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@


#include "common/Common.hpp"
#include "VehicleControllerBase.hpp"
#include "common/common_utils/WorkerThread.hpp"
#include "controllers/VehicleCamera.hpp"
#include "Waiter.hpp"
#include "safety/SafetyEval.hpp"
#include "common/CommonStructs.hpp"
#include "VehicleControllerBase.hpp"
#include "DroneCommon.hpp"
#include "common/common_utils/WorkerThread.hpp"

namespace msr { namespace airlib {

Expand Down Expand Up @@ -63,15 +64,6 @@ class DroneControllerBase : public VehicleControllerBase {
std::lock_guard<std::recursive_mutex> lock_;
};

enum class ImageType : uint {
None = 0,
Scene = 1,
Depth = 2,
Segmentation = 4,
All = 255
};
typedef common_utils::EnumFlags<ImageType> ImageTypeFlags;

enum class LandedState : uint {
Landed = 0,
Flying = 1
Expand Down Expand Up @@ -233,7 +225,7 @@ class DroneControllerBase : public VehicleControllerBase {
/// Request an image of specific type from the specified camera. Currently AirSim is configured with only 2 cameras which
/// have id of 0 and 1. Camera 0 is setup to be an FPV camera view and camera 1 is setup as a 3rd person view that chases the drone.
/// The image is return in the .png format. This call will block until the render is complete.
virtual vector<uint8_t> getImageForCamera(int camera_id, ImageType type);
virtual vector<uint8_t> getImageForCamera(int camera_id, VehicleCamera::ImageType type);

virtual void addCamera(std::shared_ptr<VehicleCamera> camera);

Expand Down Expand Up @@ -280,7 +272,7 @@ class DroneControllerBase : public VehicleControllerBase {
template <typename Key, typename T>
using EnumClassUnorderedMap = std::unordered_map<Key, T, EnumClassHashType<Key>>;

unordered_map<int, EnumClassUnorderedMap<ImageType, vector<uint8_t>>> images;
unordered_map<int, EnumClassUnorderedMap<VehicleCamera::ImageType, vector<uint8_t>>> images;

protected: //optional oveerides recommanded for any drones, default implementation may work
virtual float getAutoLookahead(float velocity, float adaptive_lookahead,
Expand Down
2 changes: 1 addition & 1 deletion AirLib/include/controllers/DroneControllerCancelable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class DroneControllerCancelable {
}

//get image
vector<uint8_t> getImageForCamera(int camera_id, DroneControllerBase::ImageType type)
vector<uint8_t> getImageForCamera(int camera_id, VehicleCamera::ImageType type)
{
return controller_->getImageForCamera(camera_id, type);
}
Expand Down
Loading

0 comments on commit dca11b6

Please sign in to comment.