forked from microsoft/AirSim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
78 lines (59 loc) · 2.36 KB
/
main.cpp
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "StandAloneSensors.hpp"
#include "StandAlonePhysics.hpp"
#include "StereoImageGenerator.hpp"
#include "GaussianMarkovTest.hpp"
#include <iostream>
#include <string>
int runStandAloneSensors(int argc, const char *argv[])
{
if (argc < 2) {
std::cout << "Usage: " << argv[0] << " <out_file_name> <period_ms> <total_duration_sec>" << std::endl;
return 1;
}
float period = 30E-3f;
if (argc >= 3)
period = std::stof(argv[2]) * 1E-3f;
float total_duration = 3600;
if (argc >= 4)
total_duration = std::stof(argv[3]);
std::cout << "Period is " << period << "sec" << std::endl;
std::cout << "Total duration is " << total_duration << "sec" << std::endl;
using namespace msr::airlib;
//60 acres park:
//GeoPoint testLocation(47.7037051477, -122.1415384809, 9.93f);
//marymoore park
//GeoPoint testLocation(47.662804385, -122.1167039875, 9.93f);
GeoPoint testLocation(47.7631699747, -122.0685655406, 9.93f); // woodinville
float yawOffset = 0;// static_cast<float>(91.27622 * M_PI / 180.0); // I was aligned with the road...
std::ofstream out_file(argv[1]);
StandALoneSensors::generateImuStaticData(out_file, period, total_duration);
StandALoneSensors::generateBarometerStaticData(out_file, period, total_duration, testLocation);
StandALoneSensors::generateBarometerDynamicData(out_file, period, total_duration, testLocation);
StandALoneSensors::generateMagnetometer2D(out_file, period, total_duration, testLocation, yawOffset, true);
StandALoneSensors::generateMagnetometerMap(out_file);
return 0;
}
int runStandAlonePhysics(int argc, const char *argv[])
{
using namespace msr::airlib;
StandAlonePhysics::testCollison();
return 0;
}
void runSteroImageGenerator(int num_samples, std::string storage_path)
{
StereoImageGenerator gen(storage_path);
gen.generate(num_samples);
}
void runSteroImageGenerator(int argc, const char *argv[])
{
runSteroImageGenerator(argc < 2 ? 50000 : std::stoi(argv[1]), argc < 3 ?
common_utils::FileSystem::combine(
common_utils::FileSystem::getAppDataFolder(), "stereo_gen")
: std::string(argv[2]));
}
int main(int argc, const char *argv[])
{
using namespace msr::airlib;
GaussianMarkovTest test;
test.run();
}