NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
graph_vio_simulator.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_GRAPH_VIO_SIMULATOR_H_
20 #define LOCALIZATION_ANALYSIS_GRAPH_VIO_SIMULATOR_H_
21 
22 #include <ff_msgs/Feature2dArray.h>
23 #include <ff_msgs/FlightMode.h>
24 #include <ff_msgs/VisualLandmarks.h>
28 
29 #include <sensor_msgs/Image.h>
30 #include <sensor_msgs/Imu.h>
31 #include <sensor_msgs/PointCloud2.h>
32 
33 #include <string>
34 #include <vector>
35 
36 namespace localization_analysis {
37 // Buffers msgs and passes these to the graph VIO after a simluated
38 // optimization time occurs (as set in the params). Enables a set optimization time
39 // to be simulated regardless of the hardware used for offline replay.
41  public:
42  GraphVIOSimulator(const GraphVIOSimulatorParams& params, const std::string& graph_config_path_prefix);
43 
44  void BufferOpticalFlowMsg(const ff_msgs::Feature2dArray& feature_array_msg);
45 
46  void BufferImuMsg(const sensor_msgs::Imu& imu_msg);
47 
48  void BufferFlightModeMsg(const ff_msgs::FlightMode& flight_mode_msg);
49 
50  void BufferDepthOdometryMsg(const ff_msgs::DepthOdometry& depth_odometry_msg);
51 
53 
54  private:
55  std::vector<ff_msgs::Feature2dArray> of_msg_buffer_;
56  std::vector<ff_msgs::DepthOdometry> depth_odometry_msg_buffer_;
57  std::vector<sensor_msgs::Imu> imu_msg_buffer_;
58  std::vector<ff_msgs::FlightMode> flight_mode_msg_buffer_;
59  boost::optional<localization_common::Time> last_update_time_;
61 };
62 } // namespace localization_analysis
63 
64 #endif // LOCALIZATION_ANALYSIS_GRAPH_VIO_SIMULATOR_H_
localization_analysis::GraphVIOSimulator::GraphVIOSimulator
GraphVIOSimulator(const GraphVIOSimulatorParams &params, const std::string &graph_config_path_prefix)
Definition: graph_vio_simulator.cc:23
localization_analysis::GraphVIOSimulator::BufferDepthOdometryMsg
void BufferDepthOdometryMsg(const ff_msgs::DepthOdometry &depth_odometry_msg)
Definition: graph_vio_simulator.cc:30
localization_analysis::GraphVIOSimulator
Definition: graph_vio_simulator.h:40
ros_graph_vio_wrapper.h
localization_analysis
Definition: ar_tag_pose_adder.h:29
ros_graph_vio::RosGraphVIOWrapper
Definition: ros_graph_vio_wrapper.h:41
localization_analysis::GraphVIOSimulator::BufferFlightModeMsg
void BufferFlightModeMsg(const ff_msgs::FlightMode &flight_mode_msg)
Definition: graph_vio_simulator.cc:36
localization_analysis::GraphVIOSimulator::AddMeasurementsAndUpdateIfReady
bool AddMeasurementsAndUpdateIfReady(const localization_common::Time &current_time)
Definition: graph_vio_simulator.cc:40
graph_vio_simulator_params.h
localization_analysis::GraphVIOSimulatorParams
Definition: graph_vio_simulator_params.h:22
time.h
localization_analysis::GraphVIOSimulator::BufferImuMsg
void BufferImuMsg(const sensor_msgs::Imu &imu_msg)
Definition: graph_vio_simulator.cc:34
localization_analysis::GraphVIOSimulator::BufferOpticalFlowMsg
void BufferOpticalFlowMsg(const ff_msgs::Feature2dArray &feature_array_msg)
Definition: graph_vio_simulator.cc:26
localization_common::Time
double Time
Definition: time.h:23