NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
offline_replay.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 
19 #ifndef LOCALIZATION_ANALYSIS_OFFLINE_REPLAY_H_
20 #define LOCALIZATION_ANALYSIS_OFFLINE_REPLAY_H_
21 
22 #include <camera/camera_params.h>
26 // #include <imu_bias_tester/imu_bias_tester_wrapper.h>
29 
30 #include <rosbag/bag.h>
31 #include <sensor_msgs/Image.h>
32 
33 #include <memory>
34 #include <string>
35 #include <vector>
36 
37 namespace localization_analysis {
38 // Reads through a bag file and passes relevant messages to graph localizer
39 // and VIO wrappers. Uses the LiveMeasurementSimulator which contains its own instances of sensor parsers
40 // (lk_optical_flow, localizer (for sparse map matching)) with optional measurement delays and passes the output of
41 // these sensor parses to the respective graph objects. This tool avoids using rosbag play and ROS core and enables
42 // parsing bags more quickly. Saves output to a new bagfile.
44  public:
45  OfflineReplay(const std::string& bag_name, const std::string& map_file, const std::string& image_topic,
46  const std::string& results_bag, const std::string& output_stats_file,
47  const bool use_bag_image_feature_msgs = true, const std::string& graph_config_path_prefix = "");
48  void Run();
49 
50  private:
51  void InitializeGraphs();
52  /*void SaveOpticalFlowTracksImage(const sensor_msgs::ImageConstPtr& image_msg,
53  const GraphLocalizerSimulator& graph_localizer);*/
54  std::unique_ptr<GraphLocalizerSimulator> graph_localizer_simulator_;
55  std::unique_ptr<GraphVIOSimulator> graph_vio_simulator_;
56  std::unique_ptr<LiveMeasurementSimulator> live_measurement_simulator_;
57  rosbag::Bag results_bag_;
58  // imu_bias_tester::ImuBiasTesterWrapper imu_bias_tester_wrapper_;
59  ros_pose_extrapolator::RosPoseExtrapolatorWrapper pose_extrapolator_wrapper_;
60  std::string output_stats_file_;
61  const std::string kFeatureTracksImageTopic_ = "feature_track_image";
62  boost::optional<ff_msgs::VisualLandmarks> latest_ar_msg_;
63  OfflineReplayParams params_;
64 };
65 } // end namespace localization_analysis
66 
67 #endif // LOCALIZATION_ANALYSIS_OFFLINE_REPLAY_H_
localization_analysis::OfflineReplay
Definition: offline_replay.h:43
graph_vio_simulator.h
localization_analysis
Definition: ar_tag_pose_adder.h:29
ros_pose_extrapolator_wrapper.h
graph_localizer_simulator.h
localization_analysis::OfflineReplay::OfflineReplay
OfflineReplay(const std::string &bag_name, const std::string &map_file, const std::string &image_topic, const std::string &results_bag, const std::string &output_stats_file, const bool use_bag_image_feature_msgs=true, const std::string &graph_config_path_prefix="")
Definition: offline_replay.cc:46
localization_analysis::OfflineReplay::Run
void Run()
Definition: offline_replay.cc:81
offline_replay_params.h
live_measurement_simulator.h
ros_pose_extrapolator::RosPoseExtrapolatorWrapper
Definition: ros_pose_extrapolator_wrapper.h:43
camera_params.h
localization_analysis::OfflineReplayParams
Definition: offline_replay_params.h:28