ellipse.h
Go to the documentation of this file.
1 #ifndef ELLIPSE_HEADER
2 #define ELLIPSE_HEADER
3 
4 #include "ros/ros.h"
5 #include "ellipse_msg.h"
6 #include <sbgEComLib.h>
7 #include <sbgEComIds.h>
8 #include <sbgErrorCodes.h>
9 
10 #include <iostream>
11 #include <map>
12 #include <string>
13 
14 class Ellipse
15 {
16  public:
17 
19 
20  ~Ellipse();
21 
22  void init_publishers();
23  void init_callback();
24  void publish();
25  void connect();
26  void load_param();
27  void configure();
28  void save_config();
29 
30  bool start_mag_calibration();
31  bool end_mag_calibration();
32  bool save_mag_calibration();
33 
36  bool set_cmd_imu_lever_arm();
38  bool set_cmd_mag_model();
40  bool set_cmd_gnss_model();
43  bool set_cmd_odom_conf();
46  bool set_cmd_output();
47 
48  private:
49 
51 
52  // *************** Publishers *************** //
53  public:
54  sbg_driver::SbgStatus m_sbgStatus_msg;
55  sbg_driver::SbgUtcTime m_sbgUtcTime_msg;
56  sbg_driver::SbgImuData m_sbgImuData_msg;
57  sbg_driver::SbgEkfEuler m_sbgEkfEuler_msg;
58  sbg_driver::SbgEkfQuat m_sbgEkfQuat_msg;
59  sbg_driver::SbgEkfNav m_sbgEkfNav_msg;
60  sbg_driver::SbgShipMotion m_sbgShipMotion_msg;
61  sbg_driver::SbgMag m_sbgMag_msg;
62  sbg_driver::SbgMagCalib m_sbgMagCalib_msg;
63  sbg_driver::SbgGpsVel m_sbgGpsVel_msg;
64  sbg_driver::SbgGpsPos m_sbgGpsPos_msg;
65  sbg_driver::SbgGpsHdt m_sbgGpsHdt_msg;
66  sbg_driver::SbgGpsRaw m_sbgGpsRaw_msg;
67  sbg_driver::SbgOdoVel m_sbgOdoVel_msg;
68  sbg_driver::SbgEvent m_sbgEventA_msg;
69  sbg_driver::SbgEvent m_sbgEventB_msg;
70  sbg_driver::SbgEvent m_sbgEventC_msg;
71  sbg_driver::SbgEvent m_sbgEventD_msg;
72  sbg_driver::SbgPressure m_sbgPressure_msg;
73 
74  public:
94 
96 
97  private:
117 
118  // *************** SBG TOOLS *************** //
121 
122  // *************** SBG Params *************** //
123  // connection param
124  std::string m_uartPortName;
127 
128  double m_initLat;
129  double m_initLong;
130  double m_initAlt;
135 
140  float m_imuMisYaw;
141  float m_imuLeverArm[3];
142 
147 
150  float m_magOffset[3];
151  float m_magMatrix[3][3];
152 
154 
161 
165 
166  float m_odomGain;
169  float m_odomLever[3];
171 
173 
193 
197 };
198 
208  SbgErrorCode onLogReceived(SbgEComHandle *pHandle, SbgEComClass msgClass, SbgEComMsgId msg, const SbgBinaryLogData *pLogData, void *pUserArg);
209 
210  static std::map<int, int> MODE_DIV_2_FREQ = {{0,0},{1,200},{2,100},{4,50},{5,40},{8,25},{10,20},{20,10},{40,5},{200,1}};
211 
212  static std::map<SbgEComMagCalibQuality, std::string> MAG_CALIB_QUAL= {{SBG_ECOM_MAG_CALIB_QUAL_OPTIMAL, "Quality: optimal"},
213  {SBG_ECOM_MAG_CALIB_QUAL_GOOD, "Quality: good"},
214  {SBG_ECOM_MAG_CALIB_QUAL_POOR, "Quality: poor"}};
215 
216  static std::map<SbgEComMagCalibConfidence, std::string> MAG_CALIB_CONF = {{SBG_ECOM_MAG_CALIB_TRUST_HIGH, "Confidence: high"},
217  {SBG_ECOM_MAG_CALIB_TRUST_MEDIUM, "Confidence: medium"},
218  {SBG_ECOM_MAG_CALIB_TRUST_LOW, "Confidence: low"}};
219 
220  static std::map<SbgEComMagCalibMode, std::string> MAG_CALIB_MODE = {{SBG_ECOM_MAG_CALIB_MODE_2D, "Mode 2D"},
221  {SBG_ECOM_MAG_CALIB_MODE_3D, "Mode 3D"}};
222 
223  static std::map<SbgEComMagCalibBandwidth, std::string> MAG_CALIB_BW = {{SBG_ECOM_MAG_CALIB_HIGH_BW, "High Bandwidth"},
224  {SBG_ECOM_MAG_CALIB_MEDIUM_BW, "Medium Bandwidth"},
225  {SBG_ECOM_MAG_CALIB_LOW_BW, "Low Bandwidth"}};
226 
227 
228 
229 
230 #endif
float m_gnss1LeverArmY
Definition: ellipse.h:156
ros::Publisher m_sbgEventC_pub
Definition: ellipse.h:114
float m_imuMisRoll
Definition: ellipse.h:138
int m_log_imu_data
Definition: ellipse.h:175
float m_imuLeverArm[3]
Definition: ellipse.h:141
double m_initLat
Definition: ellipse.h:128
int m_gnss1ModulePortAssignment
Definition: ellipse.h:143
sbg_driver::SbgEvent m_sbgEventD_msg
Definition: ellipse.h:71
int m_log_pressure
Definition: ellipse.h:192
bool set_cmd_mag_model()
Definition: ellipse.cpp:526
bool m_new_sbgMag
Definition: ellipse.h:82
int m_log_ekf_euler
Definition: ellipse.h:176
unsigned int uint32
Definition: sbgTypes.h:58
bool m_new_sbgEventB
Definition: ellipse.h:90
bool end_mag_calibration()
Definition: ellipse.cpp:820
bool m_new_sbgGpsRaw
Definition: ellipse.h:87
bool save_mag_calibration()
Definition: ellipse.cpp:897
SbgEComHandle m_comHandle
Definition: ellipse.h:119
bool set_cmd_init_parameters()
Definition: ellipse.cpp:446
int m_gnss1ModuleSyncAssignment
Definition: ellipse.h:144
Header file that defines all error codes for SBG Systems libraries.
ros::Publisher m_sbgEventB_pub
Definition: ellipse.h:113
sbg_driver::SbgMag m_sbgMag_msg
Definition: ellipse.h:61
bool m_new_sbgShipMotion
Definition: ellipse.h:81
SbgInterface m_sbgInterface
Definition: ellipse.h:120
bool set_cmd_gnss_lever_arm()
Definition: ellipse.cpp:560
void publish()
Definition: ellipse.cpp:242
sbg_driver::SbgEkfQuat m_sbgEkfQuat_msg
Definition: ellipse.h:58
bool m_new_sbgPressure
Definition: ellipse.h:93
static std::map< SbgEComMagCalibConfidence, std::string > MAG_CALIB_CONF
Definition: ellipse.h:216
bool set_cmd_gnss_reject_mode()
Definition: ellipse.cpp:582
int m_log_mag_calib
Definition: ellipse.h:182
bool set_cmd_aiding_assignement()
Definition: ellipse.cpp:507
uint32 m_gnssModelId
Definition: ellipse.h:153
double m_initAlt
Definition: ellipse.h:130
float m_imuMisYaw
Definition: ellipse.h:140
int m_gnss1HdtRejectMode
Definition: ellipse.h:164
sbg_driver::SbgOdoVel m_sbgOdoVel_msg
Definition: ellipse.h:67
ros::Publisher m_sbgPressure_pub
Definition: ellipse.h:116
int m_rate_frequency
Definition: ellipse.h:95
Ellipse(ros::NodeHandle *n)
Definition: ellipse.cpp:29
int m_log_event_c
Definition: ellipse.h:190
uint8 m_odomGainError
Definition: ellipse.h:167
int m_log_gps1_raw
Definition: ellipse.h:186
ros::Publisher m_sbgGpsHdt_pub
Definition: ellipse.h:109
bool m_odomDirection
Definition: ellipse.h:168
float m_gnss1AntennaDistance
Definition: ellipse.h:160
bool m_new_sbgGpsPos
Definition: ellipse.h:85
Defines all sbgECom commands identifiers.
ros::Publisher m_sbgShipMotion_pub
Definition: ellipse.h:104
int m_gnss1PosRejectMode
Definition: ellipse.h:162
bool m_new_sbgEventA
Definition: ellipse.h:89
int m_odomRejectMode
Definition: ellipse.h:170
SbgErrorCode onLogReceived(SbgEComHandle *pHandle, SbgEComClass msgClass, SbgEComMsgId msg, const SbgBinaryLogData *pLogData, void *pUserArg)
Definition: ellipse.cpp:341
int m_log_odo_vel
Definition: ellipse.h:187
int m_log_ekf_quat
Definition: ellipse.h:177
ros::Publisher m_sbgEkfQuat_pub
Definition: ellipse.h:102
sbg_driver::SbgUtcTime m_sbgUtcTime_msg
Definition: ellipse.h:55
static std::map< SbgEComMagCalibQuality, std::string > MAG_CALIB_QUAL
Definition: ellipse.h:212
bool m_new_sbgEkfNav
Definition: ellipse.h:80
ros::Publisher m_sbgMagCalib_pub
Definition: ellipse.h:106
bool m_new_sbgOdoVel
Definition: ellipse.h:88
float m_gnss1YawOffset
Definition: ellipse.h:159
int m_log_mag
Definition: ellipse.h:181
sbg_driver::SbgStatus m_sbgStatus_msg
Definition: ellipse.h:54
sbg_driver::SbgGpsVel m_sbgGpsVel_msg
Definition: ellipse.h:63
bool set_cmd_odom_reject_mode()
Definition: ellipse.cpp:635
int m_magnetic_calibration_mode
Definition: ellipse.h:194
ros::Publisher m_sbgUtcTime_pub
Definition: ellipse.h:99
sbg_driver::SbgEvent m_sbgEventA_msg
Definition: ellipse.h:68
ros::Publisher m_sbgImuData_pub
Definition: ellipse.h:100
sbg_driver::SbgEkfNav m_sbgEkfNav_msg
Definition: ellipse.h:59
float m_gnss1PitchOffset
Definition: ellipse.h:158
double m_initLong
Definition: ellipse.h:129
int m_magnetic_calibration_bandwidth
Definition: ellipse.h:195
uint32 m_motionProfileId
Definition: ellipse.h:134
bool set_cmd_mag_reject_mode()
Definition: ellipse.cpp:537
int m_log_utc_time
Definition: ellipse.h:180
bool m_new_sbgEventC
Definition: ellipse.h:91
int m_log_ship_motion
Definition: ellipse.h:179
ros::Publisher m_sbgGpsPos_pub
Definition: ellipse.h:108
bool m_new_sbgStatus
Definition: ellipse.h:75
uint8 m_initDay
Definition: ellipse.h:133
bool start_mag_calibration()
Definition: ellipse.cpp:807
~Ellipse()
Definition: ellipse.cpp:34
bool set_cmd_imu_lever_arm()
Definition: ellipse.cpp:479
ros::Publisher m_sbgEkfEuler_pub
Definition: ellipse.h:101
int m_log_gps1_vel
Definition: ellipse.h:183
float m_odomGain
Definition: ellipse.h:166
bool m_new_sbgEkfQuat
Definition: ellipse.h:79
ros::Publisher m_sbgEventA_pub
Definition: ellipse.h:112
ros::Publisher m_sbgEkfNav_pub
Definition: ellipse.h:103
void configure()
Definition: ellipse.cpp:100
int m_magRejectMode
Definition: ellipse.h:149
float m_gnss1LeverArmZ
Definition: ellipse.h:157
bool m_new_sbgEventD
Definition: ellipse.h:92
float m_magMatrix[3][3]
Definition: ellipse.h:151
ros::Publisher m_sbgMag_pub
Definition: ellipse.h:105
sbg_driver::SbgShipMotion m_sbgShipMotion_msg
Definition: ellipse.h:60
sbg_driver::SbgImuData m_sbgImuData_msg
Definition: ellipse.h:56
sbg_driver::SbgMagCalib m_sbgMagCalib_msg
Definition: ellipse.h:62
bool set_cmd_odom_lever_arm()
Definition: ellipse.cpp:618
sbg_driver::SbgGpsHdt m_sbgGpsHdt_msg
Definition: ellipse.h:65
int m_rtcmPortAssignment
Definition: ellipse.h:145
float m_imuMisPitch
Definition: ellipse.h:139
ros::Publisher m_sbgStatus_pub
Definition: ellipse.h:98
sbg_driver::SbgGpsPos m_sbgGpsPos_msg
Definition: ellipse.h:64
uint8 SbgEComMsgId
Definition: sbgEComIds.h:278
bool m_new_sbgEkfEuler
Definition: ellipse.h:78
int m_imuAxisDirectionX
Definition: ellipse.h:136
uint8 m_initMonth
Definition: ellipse.h:132
int m_imuAxisDirectionY
Definition: ellipse.h:137
static std::map< int, int > MODE_DIV_2_FREQ
Definition: ellipse.h:210
void save_config()
Definition: ellipse.cpp:122
bool set_cmd_output()
Definition: ellipse.cpp:647
std::string m_uartPortName
Definition: ellipse.h:124
enum _SbgEComOutputPort SbgEComOutputPort
bool m_new_sbgGpsVel
Definition: ellipse.h:84
int m_log_event_b
Definition: ellipse.h:189
void connect()
Definition: ellipse.cpp:39
unsigned char uint8
Definition: sbgTypes.h:56
int m_log_event_a
Definition: ellipse.h:188
ros::NodeHandle * m_node
Definition: ellipse.h:50
bool set_cmd_odom_conf()
Definition: ellipse.cpp:600
sbg_driver::SbgEkfEuler m_sbgEkfEuler_msg
Definition: ellipse.h:57
void init_publishers()
Definition: ellipse.cpp:59
sbg_driver::SbgGpsRaw m_sbgGpsRaw_msg
Definition: ellipse.h:66
uint16 m_initYear
Definition: ellipse.h:131
SbgEComMagCalibResults m_magCalibResults
Definition: ellipse.h:196
bool set_cmd_gnss_model()
Definition: ellipse.cpp:549
uint32 m_magModelId
Definition: ellipse.h:148
int m_gnss1VelRejectMode
Definition: ellipse.h:163
enum _SbgEComClass SbgEComClass
void init_callback()
Definition: ellipse.cpp:54
uint32 m_uartBaudRate
Definition: ellipse.h:125
void load_param()
Definition: ellipse.cpp:131
bool m_new_sbgImuData
Definition: ellipse.h:77
int m_log_event_d
Definition: ellipse.h:191
int m_log_status
Definition: ellipse.h:174
sbg_driver::SbgPressure m_sbgPressure_msg
Definition: ellipse.h:72
int m_odometerPinAssignment
Definition: ellipse.h:146
static std::map< SbgEComMagCalibBandwidth, std::string > MAG_CALIB_BW
Definition: ellipse.h:223
unsigned short uint16
Definition: sbgTypes.h:57
bool m_new_sbgGpsHdt
Definition: ellipse.h:86
int m_log_gps1_pos
Definition: ellipse.h:184
bool set_cmd_motion_profile()
Definition: ellipse.cpp:468
float m_odomLever[3]
Definition: ellipse.h:169
enum _SbgErrorCode SbgErrorCode
bool m_new_sbgMagCalib
Definition: ellipse.h:83
float m_gnss1LeverArmX
Definition: ellipse.h:155
Main header file for the SBG Systems Enhanced Communication Library.
sbg_driver::SbgEvent m_sbgEventB_msg
Definition: ellipse.h:69
sbg_driver::SbgEvent m_sbgEventC_msg
Definition: ellipse.h:70
uint8 m_timeReference
Definition: ellipse.h:172
ros::Publisher m_sbgGpsRaw_pub
Definition: ellipse.h:110
static std::map< SbgEComMagCalibMode, std::string > MAG_CALIB_MODE
Definition: ellipse.h:220
ros::Publisher m_sbgOdoVel_pub
Definition: ellipse.h:111
int m_log_ekf_nav
Definition: ellipse.h:178
SbgEComOutputPort m_portOutput
Definition: ellipse.h:126
ros::Publisher m_sbgEventD_pub
Definition: ellipse.h:115
float m_magOffset[3]
Definition: ellipse.h:150
ros::Publisher m_sbgGpsVel_pub
Definition: ellipse.h:107
bool m_new_sbgUtcTime
Definition: ellipse.h:76
int m_log_gps1_hdt
Definition: ellipse.h:185


sbg_driver
Author(s):
autogenerated on Sun Jan 27 2019 03:42:19