Main Page
Classes
Files
File List
File Members
include
watson_ins
watson_ins_driver.h
Go to the documentation of this file.
1
/*
2
* This file is part of https://github.com/AutonomousVehicleLaboratory/watson_ins.git
3
* Copyright 2019 AVL
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, version 3.
8
*
9
* This program is distributed in the hope that it will be useful, but
10
* WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
#ifndef WATSON_INS_H
18
#define WATSON_INS_H
19
#include <
serial/serial.h
>
20
#include "sensor_msgs/NavSatFix.h"
21
#include "sensor_msgs/Imu.h"
22
23
// NOTE: Change this data structure depending on the enabled Watson channels.
24
// Yes, I know, unfortunately, for sake of code compactness, the driver will
25
// have to be recompiled everytime the INS output channels are modified.
26
//
27
// This struct is overlayed on top of the received buffer from the INS, and the
28
// string fields can then be directly accessed.
29
//
30
struct
ins_data_t
{
31
char
dataType
[2];
// 0
32
char
timestamp
[9];
// 1
33
char
roll
[7];
// 4
34
char
pitch
[6];
// 3
35
char
yaw
[6];
// 2
36
char
xAccel
[6];
// 5
37
char
yAccel
[6];
// 6
38
char
zAccel
[6];
// 7
39
char
forwardAccel
[6];
// 8, NOTE: not used
40
char
lateralAccel
[6];
// 9, NOTE: not used
41
char
verticalAccel
[6];
// 10, NOTE: not used
42
char
xAngleRate
[6];
// 11
43
char
yAngleRate
[6];
// 12
44
char
zAngleRate
[6];
// 13
45
char
hedingRate
[6];
// 14, NOTE: not used
46
char
forwardVel
[7];
// 15, NOTE: not used
47
char
lat
[10];
// 16
48
char
lon
[11];
// 17
49
char
alt
[5];
// 18
50
char
_cr
[1];
// 19
51
};
52
53
class
WatsonINSDriver
{
54
public
:
55
WatsonINSDriver
(std::string path,
int
baud,
int
timeout_ms);
56
~
WatsonINSDriver
();
57
void
read(sensor_msgs::Imu &imuMsg,
58
sensor_msgs::NavSatFix &fixMsg,
59
bool
&validImu,
bool
&validFix);
60
61
private
:
62
static
const
int
readRetryCount = 10;
63
serial::Serial
*
serDev
;
64
int
gpsMsgSeq
;
65
struct
ins_data_t
insData;
66
67
bool
validCmd(
void
);
68
void
parseIMU(sensor_msgs::Imu &imuMsg);
69
void
parseGPS(sensor_msgs::NavSatFix &gpsMsg);
70
};
71
#endif
/* WATSON_INS_H */
ins_data_t::_cr
char _cr[1]
Definition:
watson_ins_driver.h:50
ins_data_t::timestamp
char timestamp[9]
Definition:
watson_ins_driver.h:32
ins_data_t::hedingRate
char hedingRate[6]
Definition:
watson_ins_driver.h:45
ins_data_t::zAccel
char zAccel[6]
Definition:
watson_ins_driver.h:38
ins_data_t::xAngleRate
char xAngleRate[6]
Definition:
watson_ins_driver.h:42
ins_data_t::verticalAccel
char verticalAccel[6]
Definition:
watson_ins_driver.h:41
ins_data_t::alt
char alt[5]
Definition:
watson_ins_driver.h:49
ins_data_t::yaw
char yaw[6]
Definition:
watson_ins_driver.h:35
ins_data_t::yAccel
char yAccel[6]
Definition:
watson_ins_driver.h:37
ins_data_t::pitch
char pitch[6]
Definition:
watson_ins_driver.h:34
ins_data_t::yAngleRate
char yAngleRate[6]
Definition:
watson_ins_driver.h:43
ins_data_t::xAccel
char xAccel[6]
Definition:
watson_ins_driver.h:36
ins_data_t::lateralAccel
char lateralAccel[6]
Definition:
watson_ins_driver.h:40
ins_data_t::forwardAccel
char forwardAccel[6]
Definition:
watson_ins_driver.h:39
ins_data_t::lon
char lon[11]
Definition:
watson_ins_driver.h:48
serial::Serial
ins_data_t::zAngleRate
char zAngleRate[6]
Definition:
watson_ins_driver.h:44
ins_data_t::lat
char lat[10]
Definition:
watson_ins_driver.h:47
serial.h
ins_data_t
Definition:
watson_ins_driver.h:30
WatsonINSDriver
Definition:
watson_ins_driver.h:53
WatsonINSDriver::gpsMsgSeq
int gpsMsgSeq
Definition:
watson_ins_driver.h:64
ins_data_t::forwardVel
char forwardVel[7]
Definition:
watson_ins_driver.h:46
ins_data_t::roll
char roll[7]
Definition:
watson_ins_driver.h:33
ins_data_t::dataType
char dataType[2]
Definition:
watson_ins_driver.h:31
WatsonINSDriver::serDev
serial::Serial * serDev
Definition:
watson_ins_driver.h:63
watson_ins
Author(s): David Paz
, Nathan Chan
autogenerated on Sat Jan 11 2020 03:23:08