MSCEqF 1.0
Multi State Constraint Equivariant Filter for visual inertial navigation
Loading...
Searching...
No Matches
msceqf_ros.hpp
1// Copyright (C) 2023 Alessandro Fornasier.
2// Control of Networked Systems, University of Klagenfurt, Austria.
3//
4// All rights reserved.
5//
6// This software is licensed under the terms of the BSD-2-Clause-License with
7// no commercial use allowed, the full terms of which are made available
8// in the LICENSE file. No license in patents is granted.
9//
10// You can contact the authors at <alessandro.fornasier@ieee.org>
11
12#ifndef MSCEQF_ROS_H
13#define MSCEQF_ROS_H
14
15#include <ros/ros.h>
16#include <Eigen/Eigen>
17#include <atomic>
18#include <sensor_msgs/Image.h>
19#include <sensor_msgs/Imu.h>
20#include <sensor_msgs/CameraInfo.h>
21#include <sensor_msgs/PointCloud.h>
22#include <geometry_msgs/PoseWithCovarianceStamped.h>
23#include <nav_msgs/Path.h>
24#include <opencv2/opencv.hpp>
25#include <cv_bridge/cv_bridge.h>
26#include <rosbag/bag.h>
27
28#include "msceqf/msceqf.hpp"
29
31{
32 public:
47 MSCEqFRos(const ros::NodeHandle &nh,
48 const std::string &msceqf_config_filepath,
49 const std::string &imu_topic,
50 const std::string &cam_topic,
51 const std::string &pose_topic,
52 const std::string &path_topic,
53 const std::string &image_topic,
54 const std::string &extrinsics_topic,
55 const std::string &intrinsics_topic,
56 const std::string &origin_topic,
57 const bool &record,
58 const std::string &bagfile);
59
64 void callback_image(const sensor_msgs::Image::ConstPtr &msg);
65
70 void callback_imu(const sensor_msgs::Imu::ConstPtr &msg);
71
72 private:
78 void publish(const msceqf::Camera &cam);
79
80 ros::NodeHandle nh_;
81
82 msceqf::MSCEqF sys_;
83
84 ros::Subscriber sub_cam_;
85 ros::Subscriber sub_imu_;
86
87 ros::Publisher pub_pose_;
88 ros::Publisher pub_image_;
89 ros::Publisher pub_path_;
90 ros::Publisher pub_extrinsics_;
91 ros::Publisher pub_intrinsics_;
92 ros::Publisher pub_origin_;
93
94 geometry_msgs::PoseWithCovarianceStamped pose_;
95 nav_msgs::Path path_;
96 geometry_msgs::PoseStamped extrinsics_;
97 sensor_msgs::CameraInfo intrinsics_;
98 geometry_msgs::PoseStamped origin_;
99
100 std::deque<msceqf::Camera> cams_;
101 std::mutex mutex_;
102 std::atomic<bool> processing_ = false;
103
104 bool record_;
105 rosbag::Bag bag_;
106
107 uint seq_ = 0;
108};
109
110#endif // MSCEQF_ROS_H
Definition msceqf_ros.hpp:31
MSCEqFRos(const ros::NodeHandle &nh, const std::string &msceqf_config_filepath, const std::string &imu_topic, const std::string &cam_topic, const std::string &pose_topic, const std::string &path_topic, const std::string &image_topic, const std::string &extrinsics_topic, const std::string &intrinsics_topic, const std::string &origin_topic, const bool &record, const std::string &bagfile)
Constructor.
void callback_imu(const sensor_msgs::Imu::ConstPtr &msg)
IMU callback.
void callback_image(const sensor_msgs::Image::ConstPtr &msg)
Image callback.
Definition msceqf.hpp:29
Definition sensor_data.hpp:78