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 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// You can contact the authors at <alessandro.fornasier@ieee.org>
19
20#ifndef MSCEQF_ROS_H
21#define MSCEQF_ROS_H
22
23#include <ros/ros.h>
24#include <Eigen/Eigen>
25#include <atomic>
26#include <sensor_msgs/Image.h>
27#include <sensor_msgs/Imu.h>
28#include <sensor_msgs/CameraInfo.h>
29#include <sensor_msgs/PointCloud.h>
30#include <geometry_msgs/PoseWithCovarianceStamped.h>
31#include <nav_msgs/Path.h>
32#include <opencv2/opencv.hpp>
33#include <cv_bridge/cv_bridge.h>
34#include <rosbag/bag.h>
35
36#include "msceqf/msceqf.hpp"
37
39{
40 public:
55 MSCEqFRos(const ros::NodeHandle &nh,
56 const std::string &msceqf_config_filepath,
57 const std::string &imu_topic,
58 const std::string &cam_topic,
59 const std::string &pose_topic,
60 const std::string &path_topic,
61 const std::string &image_topic,
62 const std::string &extrinsics_topic,
63 const std::string &intrinsics_topic,
64 const std::string &origin_topic,
65 const bool &record,
66 const std::string &bagfile);
67
72 void callback_image(const sensor_msgs::Image::ConstPtr &msg);
73
78 void callback_imu(const sensor_msgs::Imu::ConstPtr &msg);
79
80 private:
86 void publish(const msceqf::Camera &cam);
87
88 ros::NodeHandle nh_;
89
90 msceqf::MSCEqF sys_;
91
92 ros::Subscriber sub_cam_;
93 ros::Subscriber sub_imu_;
94
95 ros::Publisher pub_pose_;
96 ros::Publisher pub_image_;
97 ros::Publisher pub_path_;
98 ros::Publisher pub_extrinsics_;
99 ros::Publisher pub_intrinsics_;
100 ros::Publisher pub_origin_;
101
102 geometry_msgs::PoseWithCovarianceStamped pose_;
103 nav_msgs::Path path_;
104 geometry_msgs::PoseStamped extrinsics_;
105 sensor_msgs::CameraInfo intrinsics_;
106 geometry_msgs::PoseStamped origin_;
107
108 std::deque<msceqf::Camera> cams_;
109 std::mutex mutex_;
110 std::atomic<bool> processing_ = false;
111
112 bool record_;
113 rosbag::Bag bag_;
114
115 uint seq_ = 0;
116};
117
118#endif // MSCEQF_ROS_H
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:37
Definition sensor_data.hpp:86