gyro_bias_remover.h
Go to the documentation of this file.
1 #pragma once
2 
11 #include <memory>
12 
13 #include <geometry_msgs/Twist.h>
14 #include <geometry_msgs/Vector3Stamped.h>
15 #include <nav_msgs/Odometry.h>
16 #include <ros/console.h>
17 #include <ros/publisher.h>
18 #include <ros/subscriber.h>
19 #include <sensor_msgs/Imu.h>
20 #include <std_msgs/Bool.h>
22 
24 
25 namespace cras
26 {
27 
29 {
31  MOVING,
34 };
35 
37 {
38 protected:
39  void onInit() override;
40 
41  void onImuMsg(const sensor_msgs::ImuConstPtr& msg);
42  void onOdomMsg(const nav_msgs::OdometryConstPtr& msg);
43  void estimateBias(const sensor_msgs::Imu& msg);
44 
45  void produceDiagnostics(diagnostic_updater::DiagnosticStatusWrapper& stat);
46  void reportBiasChange();
47 
48  void speak(const std::string& message, ros::console::levels::Level level);
49 
50  void onReset(const topic_tools::ShapeShifter&);
51  void reset();
52 
53 private:
54  std::unique_ptr<cras::DiagnosedPublisher<sensor_msgs::Imu>> imuPub;
64 
65  geometry_msgs::Vector3Stamped gyroBias;
66  geometry_msgs::Twist stopCommand;
67  std_msgs::Bool stopLockMsg;
68  std_msgs::Bool stopUnlockMsg;
69 
71 
73  size_t minCalibrationSamples {1000};
74  double gyroBiasEstimationRate {0.01};
75  bool skipCalibration {false};
76  bool shouldProduceDiagnostics {true};
77 
78  double gyroThreshold {0};
79  double cmdVelThreshold {0};
81 
85  size_t numCalibrationSamples {0};
87  bool hasOdomMsg {false};
88 };
89 
90 }
msg
ros::Duration initialCalibrationDuration
geometry_msgs::Twist stopCommand
std::unique_ptr< cras::DiagnosedPublisher< sensor_msgs::Imu > > imuPub
ros::Duration notMovingDurationThreshold
geometry_msgs::Vector3Stamped gyroBias


cras_imu_tools
Author(s): Martin Pecka
autogenerated on Fri Jun 23 2023 02:44:02