forked from microsoft/AirSim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PixhawkTest.hpp
34 lines (29 loc) · 951 Bytes
/
PixhawkTest.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef msr_AirLibUnitTests_PixhawkTest_hpp
#define msr_AirLibUnitTests_PixhawkTest_hpp
#include "vehicles/multirotor/MultiRotorParamsFactory.hpp"
#include "TestBase.hpp"
namespace msr
{
namespace airlib
{
class PixhawkTest : public TestBase
{
public:
virtual void run() override
{
//Test PX4 based drones
auto pixhawk = MultiRotorParamsFactory::createConfig(AirSimSettings::singleton().getVehicleSetting("Pixhawk"),
std::make_shared<SensorFactory>());
auto api = pixhawk->createMultirotorApi();
testAssert(api != nullptr, "Couldn't get pixhawk controller");
try {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
catch (std::domain_error& ex) {
std::cout << ex.what() << std::endl;
}
}
};
}
}
#endif