-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.mit.edu:SPARK/Kimera-VIO-ROS into fea…
…ture/mono_slam/base
- Loading branch information
Showing
23 changed files
with
938 additions
and
387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# iOS things | ||
.DS_Store | ||
|
||
# Qt things | ||
*.user* | ||
|
||
|
@@ -35,4 +38,4 @@ | |
*.app | ||
|
||
# Vscode files | ||
.vscode/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/** | ||
* @file RosLoopClosureVisualizer.h | ||
* @brief Publishes Loop closure and pose graph data to ROS. | ||
* @author Yun Chang | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#define PCL_NO_PRECOMPILE // Define this before you include any PCL headers | ||
// to include the templated algorithms | ||
#include <pcl/point_types.h> | ||
#include <pcl_ros/point_cloud.h> | ||
|
||
#include <opencv2/opencv.hpp> | ||
|
||
#include <glog/logging.h> | ||
|
||
#include <ros/ros.h> | ||
#include <tf/transform_broadcaster.h> | ||
|
||
#include <pose_graph_tools/PoseGraph.h> | ||
#include <pose_graph_tools/PoseGraphEdge.h> | ||
#include <pose_graph_tools/PoseGraphNode.h> | ||
|
||
#include <kimera-vio/backend/VioBackend-definitions.h> | ||
#include <kimera-vio/frontend/StereoVisionImuFrontend-definitions.h> | ||
#include <kimera-vio/loopclosure/LoopClosureDetector-definitions.h> | ||
#include <kimera-vio/loopclosure/LoopClosureDetector.h> | ||
#include <kimera-vio/mesh/Mesher-definitions.h> | ||
|
||
#include "kimera_vio_ros/RosPublishers.h" | ||
|
||
namespace VIO { | ||
|
||
class RosLoopClosureVisualizer { | ||
public: | ||
KIMERA_POINTER_TYPEDEFS(RosLoopClosureVisualizer); | ||
KIMERA_DELETE_COPY_CONSTRUCTORS(RosLoopClosureVisualizer); | ||
|
||
public: | ||
RosLoopClosureVisualizer(); | ||
~RosLoopClosureVisualizer() = default; | ||
|
||
void publishLcdOutput(const LcdOutput::ConstPtr& lcd_output); | ||
|
||
private: | ||
void publishTf(const LcdOutput::ConstPtr& lcd_output); | ||
|
||
void publishOptimizedTrajectory(const LcdOutput::ConstPtr& lcd_output); | ||
|
||
void publishPoseGraph(const LcdOutput::ConstPtr& lcd_output); | ||
|
||
void updateNodesAndEdges(const gtsam::NonlinearFactorGraph& nfg, | ||
const gtsam::Values& values); | ||
|
||
void updateRejectedEdges(); | ||
|
||
void publishNewNodesAndEdges(const LcdOutput::ConstPtr& lcd_output); | ||
|
||
pose_graph_tools::PoseGraph getPosegraphMsg(); | ||
|
||
private: | ||
// ROS handles | ||
ros::NodeHandle nh_; | ||
ros::NodeHandle nh_private_; | ||
|
||
// ROS publishers | ||
ros::Publisher trajectory_pub_; | ||
ros::Publisher posegraph_pub_; | ||
ros::Publisher odometry_pub_; | ||
ros::Publisher posegraph_incremental_pub_; | ||
|
||
//! Define tf broadcaster for world to base_link (IMU) and to map (PGO). | ||
tf::TransformBroadcaster tf_broadcaster_; | ||
|
||
//! Stored pose graph related objects | ||
std::vector<pose_graph_tools::PoseGraphEdge> loop_closure_edges_; | ||
std::vector<pose_graph_tools::PoseGraphEdge> odometry_edges_; | ||
std::vector<pose_graph_tools::PoseGraphEdge> inlier_edges_; | ||
std::vector<pose_graph_tools::PoseGraphNode> pose_graph_nodes_; | ||
|
||
private: | ||
//! Define frame ids for odometry message | ||
std::string world_frame_id_; | ||
std::string base_link_frame_id_; | ||
std::string map_frame_id_; | ||
}; | ||
|
||
} // namespace VIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/** | ||
* @file CsvPublisher.h | ||
* @brief Publishes a 3D trajectory provided as a CSV file (Euroc format) | ||
* at the same pace than a given odometry topic, and aligns the CSV trajectory | ||
* with the odometry. | ||
* This is nice to visualize a ground-truth trajectory displayed at the same | ||
* time that we get | ||
* VIO's results so that we can compare both trajectories visually. | ||
* @author Antoni Rosinol | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <geometry_msgs/PoseStamped.h> | ||
#include <nav_msgs/Odometry.h> | ||
#include <nav_msgs/Path.h> | ||
#include <ros/ros.h> | ||
#include <tf/transform_broadcaster.h> | ||
|
||
#include <Eigen/Core> | ||
|
||
#include <gtsam/geometry/Pose3.h> | ||
#include <gtsam/geometry/Point3.h> | ||
|
||
#include <kimera-vio/utils/Macros.h> | ||
#include <kimera-vio/common/vio_types.h> | ||
#include <kimera-vio/common/VioNavState.h> | ||
#include <kimera-vio/pipeline/Pipeline-definitions.h> | ||
#include <kimera-vio/dataprovider/EurocDataProvider.h> | ||
|
||
namespace VIO { | ||
|
||
class EurocDataProvider; | ||
|
||
namespace utils { | ||
|
||
class CsvPublisher { | ||
public: | ||
KIMERA_POINTER_TYPEDEFS(CsvPublisher); | ||
KIMERA_DELETE_COPY_CONSTRUCTORS(CsvPublisher); | ||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | ||
using MapIterator = std::map<Timestamp, VioNavState>::iterator; | ||
|
||
public: | ||
/** | ||
* @brief CsvPublisher | ||
* The path to the csv dataset published is given by the dataset_path gflag. | ||
*/ | ||
CsvPublisher(); | ||
virtual ~CsvPublisher() = default; | ||
|
||
protected: | ||
void callbackOdometry(const nav_msgs::OdometryConstPtr& odom_msg); | ||
|
||
void fillOdometryMsg(const Timestamp& timestamp, | ||
const gtsam::Pose3& pose, | ||
const gtsam::Vector3& velocity, | ||
nav_msgs::Odometry* odometry) const; | ||
|
||
protected: | ||
ros::NodeHandle nh_; | ||
ros::NodeHandle nh_private_; | ||
|
||
ros::Publisher aligned_gt_odometry_pub_; | ||
ros::Publisher aligned_gt_path_pub_; | ||
ros::Publisher gt_path_pub_; | ||
ros::Publisher vio_path_pub_; | ||
|
||
ros::Subscriber odometry_sub_; | ||
|
||
nav_msgs::Path aligned_gt_trajectory_path_; | ||
nav_msgs::Path gt_trajectory_path_; | ||
nav_msgs::Path vio_trajectory_path_; | ||
|
||
/// This label is prepended to the published topics and used as | ||
/// the child frame id for the published odometry. | ||
std::string trajectory_label_ = "aligned_gt"; | ||
std::string world_frame_id_ = "world"; | ||
|
||
VioParams vio_params_; | ||
EurocDataProvider::UniquePtr euroc_data_provider_; | ||
|
||
MapIterator csv_odometry_map_it_; | ||
|
||
Eigen::Matrix3Xd src_; | ||
Eigen::Matrix3Xd dst_; | ||
std::shared_ptr<gtsam::Pose3> T_viow_gtw_ = nullptr; | ||
|
||
// Align trajectories | ||
static constexpr int n_alignment_frames_ = 30; | ||
static constexpr int n_discard_frames_ = 20; | ||
int odometry_msgs_count_ = 0; | ||
}; | ||
|
||
} // namespace utils | ||
|
||
} // namespace VIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
- git: | ||
local-name: gtsam | ||
uri: [email protected]:borglab/gtsam.git | ||
version: master | ||
version: develop | ||
- git: | ||
local-name: opencv3_catkin | ||
uri: [email protected]:ethz-asl/opencv3_catkin.git | ||
|
Oops, something went wrong.