MCPcopy Create free account
hub / github.com/AutonomousFieldRoboticsLab/SVIn / main

Function main

okvis_ros/src/okvis_node_synchronous.cpp:76–375  ·  view source on GitHub ↗

this is just a workbench. most of the stuff here will go into the Frontend class.

Source from the content-addressed store, hash-verified

74
75// this is just a workbench. most of the stuff here will go into the Frontend class.
76int main(int argc, char** argv) {
77 rclcpp::init(argc, argv);
78 rclcpp::NodeOptions options;
79 options.allow_undeclared_parameters(true);
80 options.automatically_declare_parameters_from_overrides(true);
81
82 google::InitGoogleLogging(argv[0]);
83 FLAGS_stderrthreshold = 0; // INFO: 0, WARNING: 1, ERROR: 2, FATAL: 3
84 FLAGS_colorlogtostderr = 1;
85
86 if (argc != 3 && argc != 4) {
87 LOG(ERROR) << "Usage: ./" << argv[0] << " configuration-yaml-file bag-to-read-from [skip-first-seconds]";
88 return -1;
89 }
90
91 okvis::Duration deltaT(0.0);
92 if (argc == 4) {
93 deltaT = okvis::Duration(atof(argv[3]));
94 }
95
96 // set up the node
97 auto node = std::make_shared<rclcpp::Node>("okvis_node", options);
98
99 // publisher
100 okvis::Publisher publisher(node);
101
102 // read configuration file
103 std::string configFilename(argv[1]);
104
105 okvis::RosParametersReader vio_parameters_reader(configFilename);
106 okvis::VioParameters parameters;
107 vio_parameters_reader.getParameters(parameters);
108
109 okvis::ThreadedKFVio okvis_estimator(parameters);
110
111 // okvis_estimator.setFullStateCallback(std::bind(&okvis::Publisher::publishFullStateAsCallback,&publisher,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4));
112 okvis_estimator.setFullStateCallback(std::bind(&okvis::Publisher::publishFullStateAsCallback,
113 &publisher,
114 std::placeholders::_1,
115 std::placeholders::_2,
116 std::placeholders::_3,
117 std::placeholders::_4));
118 okvis_estimator.setLandmarksCallback(std::bind(&okvis::Publisher::publishLandmarksAsCallback,
119 &publisher,
120 std::placeholders::_1,
121 std::placeholders::_2,
122 std::placeholders::_3));
123 okvis_estimator.setStateCallback(
124 std::bind(&okvis::Publisher::publishStateAsCallback, &publisher, std::placeholders::_1, std::placeholders::_2));
125 okvis_estimator.setKeyframeCallback(std::bind(&okvis::Publisher::publishKeyframeAsCallback,
126 &publisher,
127 std::placeholders::_1,
128 std::placeholders::_2,
129 std::placeholders::_3,
130 std::placeholders::_4));
131 okvis_estimator.setBlocking(true);
132 publisher.setParameters(parameters); // pass the specified publishing stuff
133

Callers

nothing calls this directly

Calls 15

DurationClass · 0.85
TimeClass · 0.85
setFullStateCallbackMethod · 0.80
setLandmarksCallbackMethod · 0.80
setStateCallbackMethod · 0.80
setKeyframeCallbackMethod · 0.80
numCamerasMethod · 0.80
setCsvFileMethod · 0.80
setLandmarksCsvFileMethod · 0.80
setImuCsvFileMethod · 0.80
setTracksCsvFileMethod · 0.80
addImuMeasurementMethod · 0.80

Tested by

no test coverage detected