My Project 1.0
Holistic Fusion: A Generic Framework for Multimodal Sensor Fusion
Loading...
Searching...
No Matches
SmbEstimator.h
Go to the documentation of this file.
1/*
2Copyright 2024 by Julian Nubert, Robotic Systems Lab, ETH Zurich.
3All rights reserved.
4This file is released under the "BSD-3-Clause License".
5Please see the LICENSE file that has been included as part of this package.
6 */
7
8#ifndef Smb_Estimator_H
9#define Smb_Estimator_H
10
11// std
12#include <chrono>
13
14// ROS
15#include <nav_msgs/Odometry.h>
16#include <nav_msgs/Path.h>
17#include <sensor_msgs/Imu.h>
18#include <std_msgs/Float64MultiArray.h>
19#include <tf/transform_listener.h>
20
21// Workspace
23
24// Defined Macros
25#define ROS_QUEUE_SIZE 100
26#define NUM_GNSS_CALLBACKS_UNTIL_START 20 // 0
27
28namespace smb_se {
29
31 public:
32 SmbEstimator(std::shared_ptr<ros::NodeHandle> privateNodePtr);
33 // Destructor
34 ~SmbEstimator() = default;
35 // Setup
36 void setup();
37
38 protected:
39 // Virtual Functions
40 void readParams(const ros::NodeHandle& privateNode) override;
41 void initializePublishers(ros::NodeHandle& privateNode) override;
42 void initializeSubscribers(ros::NodeHandle& privateNode) override;
43 void initializeMessages(ros::NodeHandle& privateNode) override;
44 void initializeServices(ros::NodeHandle& privateNode) override;
45 void imuCallback(const sensor_msgs::Imu::ConstPtr& imuPtr) override;
46
47 private:
48 // Time
49 std::chrono::time_point<std::chrono::high_resolution_clock> startTime_;
50 std::chrono::time_point<std::chrono::high_resolution_clock> currentTime_;
51
52 // Config -------------------------------------
53
54 // Rates
55 double lioOdometryRate_ = 5.0;
58 double vioOdometryRate_ = 50.0;
59
60 // Alignment Parameters
61 Eigen::Matrix<double, 6, 1> initialSe3AlignmentNoise_ = 1.0 * Eigen::Matrix<double, 6, 1>::Ones();
62 Eigen::Matrix<double, 6, 1> lioSe3AlignmentRandomWalk_ = 0.0 * Eigen::Matrix<double, 6, 1>::Ones();
63
64 // Noise
65 // LiDAR Odometry
66 Eigen::Matrix<double, 6, 1> lioPoseUnaryNoise_;
67 // Wheel Odometry
68 // Between
69 Eigen::Matrix<double, 6, 1> wheelPoseBetweenNoise_;
70 // Linear Velocities
71 Eigen::Matrix<double, 3, 1> wheelLinearVelocitiesNoise_;
72 // VIO Odometry
73 Eigen::Matrix<double, 6, 1> vioPoseBetweenNoise_;
74
75 // ROS Related stuff ----------------------------
76
77 // Callbacks
78 // LiDAR
79 void lidarOdometryCallback_(const nav_msgs::Odometry::ConstPtr& lidarOdomPtr);
80 // Wheel Between
81 void wheelOdometryPoseCallback_(const nav_msgs::Odometry::ConstPtr& wheelOdomPtr);
82 // Wheel Linear Velocities
83 void wheelLinearVelocitiesCallback_(const std_msgs::Float64MultiArray::ConstPtr& wheelsSpeedsPtr);
84 // VIO
85 void vioOdometryCallback_(const nav_msgs::Odometry::ConstPtr& vioOdomPtr);
86
87 // Callback Members
89 Eigen::Isometry3d T_O_Bw_km1_;
91
92 // Subscribers
93 // Instances
94 // LIO
95 ros::Subscriber subLioOdometry_;
96 // Wheel Between
97 ros::Subscriber subWheelOdometryBetween_;
98 // Wheel Linear Velocities
100 // VIO
101 ros::Subscriber subVioOdometry_;
102 // TF Listener
103 tf::TransformListener tfListener_;
104
105 // Publishers
106 // Path
107 ros::Publisher pubMeasMapLioPath_;
108 ros::Publisher pubMeasMapVioPath_;
109
110 // Messages
111 nav_msgs::PathPtr measLio_mapImuPathPtr_;
112 nav_msgs::PathPtr measVio_mapImuPathPtr_;
113
114 // Flags
119
120 // Wheel Radius
121 double wheelRadiusMeter_ = 0.195;
122};
123} // namespace smb_se
124#endif // end Smb_Estimator_H
void lidarOdometryCallback_(const nav_msgs::Odometry::ConstPtr &lidarOdomPtr)
void initializeSubscribers(ros::NodeHandle &privateNode) override
ros::Subscriber subVioOdometry_
std::chrono::time_point< std::chrono::high_resolution_clock > startTime_
Eigen::Matrix< double, 6, 1 > initialSe3AlignmentNoise_
void initializeMessages(ros::NodeHandle &privateNode) override
Eigen::Matrix< double, 6, 1 > vioPoseBetweenNoise_
double wheelLinearVelocitiesRate_
nav_msgs::PathPtr measVio_mapImuPathPtr_
void initializePublishers(ros::NodeHandle &privateNode) override
Eigen::Matrix< double, 6, 1 > lioPoseUnaryNoise_
double wheelOdometryBetweenRate_
void wheelOdometryPoseCallback_(const nav_msgs::Odometry::ConstPtr &wheelOdomPtr)
Eigen::Matrix< double, 6, 1 > lioSe3AlignmentRandomWalk_
ros::Subscriber subLioOdometry_
ros::Subscriber subWheelOdometryBetween_
void readParams(const ros::NodeHandle &privateNode) override
Eigen::Matrix< double, 3, 1 > wheelLinearVelocitiesNoise_
void initializeServices(ros::NodeHandle &privateNode) override
void vioOdometryCallback_(const nav_msgs::Odometry::ConstPtr &vioOdomPtr)
SmbEstimator(std::shared_ptr< ros::NodeHandle > privateNodePtr)
ros::Publisher pubMeasMapVioPath_
ros::Publisher pubMeasMapLioPath_
Eigen::Matrix< double, 6, 1 > wheelPoseBetweenNoise_
void wheelLinearVelocitiesCallback_(const std_msgs::Float64MultiArray::ConstPtr &wheelsSpeedsPtr)
ros::Subscriber subWheelLinearVelocities_
Eigen::Isometry3d T_O_Bw_km1_
void imuCallback(const sensor_msgs::Imu::ConstPtr &imuPtr) override
nav_msgs::PathPtr measLio_mapImuPathPtr_
std::chrono::time_point< std::chrono::high_resolution_clock > currentTime_
tf::TransformListener tfListener_