forked from microsoft/AirSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor sensor architecture for easy pluggability for sensors derive…
…d from Unreal engine
- Loading branch information
Showing
32 changed files
with
367 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifndef msr_airlib_SensorFactoryBase_hpp | ||
#define msr_airlib_SensorFactoryBase_hpp | ||
|
||
|
||
#include "SensorBase.hpp" | ||
#include <memory> | ||
|
||
//sensors | ||
#include "sensors/imu/ImuSimple.hpp" | ||
#include "sensors/magnetometer/MagnetometerSimple.hpp" | ||
#include "sensors/gps/GpsSimple.hpp" | ||
#include "sensors/barometer/BarometerSimple.hpp" | ||
|
||
namespace msr { namespace airlib { | ||
|
||
|
||
class SensorFactory { | ||
public: | ||
virtual std::unique_ptr<SensorBase> createSensor(SensorBase::SensorType sensor_type) const | ||
{ | ||
switch (sensor_type) { | ||
case SensorBase::SensorType::Imu: | ||
return std::unique_ptr<ImuSimple>(new ImuSimple()); | ||
case SensorBase::SensorType::Magnetometer: | ||
return std::unique_ptr<MagnetometerSimple>(new MagnetometerSimple()); | ||
case SensorBase::SensorType::Gps: | ||
return std::unique_ptr<GpsSimple>(new GpsSimple()); | ||
case SensorBase::SensorType::Barometer: | ||
return std::unique_ptr<BarometerSimple>(new BarometerSimple()); | ||
default: | ||
return std::unique_ptr<SensorBase>(); | ||
} | ||
} | ||
}; | ||
|
||
|
||
}} //namespace | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.