|  | NASA Astrobee Robot Software
    0.19.1
    Flight software for the Astrobee robots operating inside the International Space Station. | 
#include <ff_common/init.h>#include <ff_common/thread.h>#include <ff_common/utils.h>#include <config_reader/config_reader.h>#include <camera/camera_params.h>#include <sparse_mapping/sparse_map.h>#include <sparse_mapping/reprojection.h>#include <sparse_mapping/tensor.h>#include <sparse_mapping/sparse_mapping.h>#include <opencv2/features2d/features2d.hpp>#include <opencv2/highgui/highgui.hpp>#include <sparse_map.pb.h>#include <gflags/gflags.h>#include <glog/logging.h>#include <iostream>#include <fstream>#include <algorithm>#include <thread>
| Functions | |
| DEFINE_string (output_map, "", "Output file containing the matches and control network.") | |
| DEFINE_int32 (sample_rate, 1, "Add one of every n input frames to the map.") | |
| DEFINE_bool (save_individual_maps, false, "Save separately the maps after detection, matching, track building, " "incremental bundle adjustment, and global bundle adjustment.") | |
| DEFINE_string (detector, "SURF", "Feature detector to use. Options are: SURF, ORGBRISK, TEBLID512, TEBLID256.") | |
| DEFINE_string (rebuild_detector, "TEBLID512", "Feature detector to use. Options are: SURF, ORGBRISK, TEBLID512, TEBLID256.") | |
| DEFINE_bool (feature_detection, false, "Compute features for input images.") | |
| DEFINE_bool (feature_matching, false, "Perform feature matching.") | |
| DEFINE_bool (track_building, false, "Perform track building.") | |
| DEFINE_bool (incremental_ba, false, "Perform incremental bundle adjustment.") | |
| DEFINE_bool (loop_closure, false, "Take a map where images start repeating, and close the loop.") | |
| DEFINE_bool (bundle_adjustment, false, "Perform bundle adjustment.") | |
| DEFINE_bool (rebuild, false, "Rebuild the map with BRISK features.") | |
| DEFINE_bool (rebuild_replace_camera, false, "During rebuilding replace the camera with the one from ASTROBEE_ROBOT.") | |
| DEFINE_bool (vocab_db, false, "Build the map with a vocabulary database.") | |
| DEFINE_bool (registration, false, "Register the map to world coordinates(requires control points and their xyz coordinates). " "This new data is used to redo the bundle adjustment") | |
| DEFINE_bool (verification, false, "Verify how an already registered map performs on an independently " "acquired set of control points and 3D measurements.") | |
| DEFINE_bool (registration_skip_bundle_adjustment, false, "Skip bundle adjustment during the registration step.") | |
| DEFINE_bool (prune, false, "Prune the map (the vocab db is unchanged).") | |
| DEFINE_bool (info, false, "Print some information on the existing map.") | |
| DEFINE_bool (save_poses, false, "Save the camera to world transform and its inverse for each image in the map.") | |
| DEFINE_bool (save_xyz, false, "Save the sparse set of points obtained by triangulating the interest point matches.") | |
| DEFINE_int32 (num_repeat_images, 0, "How many images from the beginning of the sequence to repeat at the end " "of the sequence, to help with loop closure (assuming first and last images " "are similar).") | |
| DEFINE_bool (fix_cameras, false, "Keep the cameras fixed during bundle adjustment.") | |
| DEFINE_bool (rebuild_refloat_cameras, false, "Optimize the cameras as well as part of rebuilding. Usually that is " "avoided when rebuilding with binary features, but could be useful with SURF.") | |
| DEFINE_int32 (db_restarts, 1, "Number of restarts when building the tree.") | |
| DEFINE_int32 (db_depth, 0, "Depth of the tree to build. Default: 4") | |
| DEFINE_int32 (db_branching_factor, 0, "Branching factor of the tree to build. " "Default: 10") | |
| DEFINE_string (robot_camera, "nav_cam", "Which of bot's cameras to use for map-building. Anything except nav_cam is experimental.") | |
| DEFINE_string (undistorted_camera_params, "", "Assume that the camera has no distortion and given intrinsics. " "Specify as: 'image_wid_x image_wid_y focal_length optical_center_x " "optical_center_y'.") | |
| void | DetectAllFeatures (int argc, char **argv) | 
| void | MatchFeatures () | 
| void | BuildTracks () | 
| void | IncrementalBA () | 
| void | CloseLoop () | 
| void | BundleAdjust () | 
| void | Rebuild () | 
| void | PruneMap () | 
| void | VocabDB () | 
| void | RegistrationOrVerification (std::vector< std::string > const &data_files) | 
| void | MapInfo () | 
| void | SavePoses () | 
| void | SaveXYZ () | 
| int | main (int argc, char **argv) | 
| Variables | |
| bool | g_pruning_was_done = false | 
| void BuildTracks | ( | ) | 
| void BundleAdjust | ( | ) | 
| void CloseLoop | ( | ) | 
| DEFINE_bool | ( | bundle_adjustment | , | 
| false | , | ||
| "Perform bundle adjustment." | |||
| ) | 
| DEFINE_bool | ( | feature_detection | , | 
| false | , | ||
| "Compute features for input images." | |||
| ) | 
| DEFINE_bool | ( | feature_matching | , | 
| false | , | ||
| "Perform feature matching." | |||
| ) | 
| DEFINE_bool | ( | fix_cameras | , | 
| false | , | ||
| "Keep the cameras fixed during bundle adjustment." | |||
| ) | 
| DEFINE_bool | ( | incremental_ba | , | 
| false | , | ||
| "Perform incremental bundle adjustment." | |||
| ) | 
| DEFINE_bool | ( | info | , | 
| false | , | ||
| "Print some information on the existing map." | |||
| ) | 
| DEFINE_bool | ( | loop_closure | , | 
| false | , | ||
| "Take a map where images start | repeating, | ||
| and close the loop." | |||
| ) | 
| DEFINE_bool | ( | prune | , | 
| false | , | ||
| "Prune the map (the vocab db is unchanged)." | |||
| ) | 
| DEFINE_bool | ( | rebuild | , | 
| false | , | ||
| "Rebuild the map with BRISK features." | |||
| ) | 
| DEFINE_bool | ( | rebuild_refloat_cameras | , | 
| false | , | ||
| "Optimize the cameras as well as part of rebuilding. Usually that is " "avoided when rebuilding with binary | features, | ||
| but could be useful with SURF." | |||
| ) | 
| DEFINE_bool | ( | rebuild_replace_camera | , | 
| false | , | ||
| "During rebuilding replace the camera with the one from ASTROBEE_ROBOT." | |||
| ) | 
| DEFINE_bool | ( | registration | , | 
| false | , | ||
| "Register the map to world coordinates(requires control points and their xyz coordinates). " "This new data is used to redo the bundle adjustment" | |||
| ) | 
| DEFINE_bool | ( | registration_skip_bundle_adjustment | , | 
| false | , | ||
| "Skip bundle adjustment during the registration step." | |||
| ) | 
| DEFINE_bool | ( | save_individual_maps | , | 
| false | , | ||
| "Save separately the maps after | detection, | ||
| matching | , | ||
| track | building, | ||
| " "incremental bundle | adjustment, | ||
| and global bundle adjustment." | |||
| ) | 
| DEFINE_bool | ( | save_poses | , | 
| false | , | ||
| "Save the camera to world transform and its inverse for each image in the map." | |||
| ) | 
| DEFINE_bool | ( | save_xyz | , | 
| false | , | ||
| "Save the sparse set of points obtained by triangulating the interest point matches." | |||
| ) | 
| DEFINE_bool | ( | track_building | , | 
| false | , | ||
| "Perform track building." | |||
| ) | 
| DEFINE_bool | ( | verification | , | 
| false | , | ||
| "Verify how an already registered map performs on an independently " "acquired set of control points and 3D measurements." | |||
| ) | 
| DEFINE_bool | ( | vocab_db | , | 
| false | , | ||
| "Build the map with a vocabulary database." | |||
| ) | 
| DEFINE_int32 | ( | db_branching_factor | , | 
| 0 | , | ||
| "Branching factor of the tree to build. " "Default: 10" | |||
| ) | 
| DEFINE_int32 | ( | db_depth | , | 
| 0 | , | ||
| "Depth of the tree to build. Default: 4" | |||
| ) | 
| DEFINE_int32 | ( | db_restarts | , | 
| 1 | , | ||
| "Number of restarts when building the tree." | |||
| ) | 
| DEFINE_int32 | ( | num_repeat_images | , | 
| 0 | , | ||
| "How many images from the beginning of the sequence to repeat at the end " "of the | sequence, | ||
| to help with loop closure(assuming first and last images " "are similar)." | |||
| ) | 
| DEFINE_int32 | ( | sample_rate | , | 
| 1 | , | ||
| "Add one of every n input frames to the map." | |||
| ) | 
| DEFINE_string | ( | detector | , | 
| "SURF" | , | ||
| "Feature detector to use. Options are: | SURF, | ||
| ORGBRISK | , | ||
| TEBLID512 | , | ||
| TEBLID256." | |||
| ) | 
| DEFINE_string | ( | output_map | , | 
| "" | , | ||
| "Output file containing the matches and control network." | |||
| ) | 
| DEFINE_string | ( | rebuild_detector | , | 
| "TEBLID512" | , | ||
| "Feature detector to use. Options are: | SURF, | ||
| ORGBRISK | , | ||
| TEBLID512 | , | ||
| TEBLID256." | |||
| ) | 
| DEFINE_string | ( | robot_camera | , | 
| "nav_cam" | , | ||
| "Which of bot's cameras to use for map-building. Anything except nav_cam is experimental." | |||
| ) | 
| DEFINE_string | ( | undistorted_camera_params | , | 
| "" | , | ||
| "Assume that the camera has no distortion and given intrinsics. " "Specify as: 'image_wid_x image_wid_y focal_length optical_center_x " "optical_center_y'." | |||
| ) | 
| void DetectAllFeatures | ( | int | argc, | 
| char ** | argv | ||
| ) | 
| void IncrementalBA | ( | ) | 
| int main | ( | int | argc, | 
| char ** | argv | ||
| ) | 
| void MapInfo | ( | ) | 
| void MatchFeatures | ( | ) | 
| void PruneMap | ( | ) | 
| void Rebuild | ( | ) | 
| void RegistrationOrVerification | ( | std::vector< std::string > const & | data_files | ) | 
| void SavePoses | ( | ) | 
| void SaveXYZ | ( | ) | 
| void VocabDB | ( | ) | 
| bool g_pruning_was_done = false |