this is just a workbench. most of the stuff here will go into the Frontend class.
| 74 | |
| 75 | // this is just a workbench. most of the stuff here will go into the Frontend class. |
| 76 | int 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 |
nothing calls this directly
no test coverage detected