convert_ins.cpp
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright (c) 2014-2020 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #include "convert_ins.h"
14 #include "ISPose.h"
15 #include "ISEarth.h"
16 
17 
18 void convertIns2ToIns1(ins_2_t *ins2, ins_1_t *result)
19 {
20  result->week = ins2->week;
21  result->timeOfWeek = ins2->timeOfWeek;
22  result->insStatus = ins2->insStatus;
23  result->hdwStatus = ins2->hdwStatus;
24  quat2euler(ins2->qn2b, result->theta);
25  memcpy(result->uvw, ins2->uvw, sizeof(Vector3));
26  memcpy(result->lla, ins2->lla, sizeof(Vector3d));
27  memset(result->ned, 0, sizeof(Vector3));
28 }
29 
30 void convertIns3ToIns1(ins_3_t *ins3, ins_1_t *result)
31 {
32  result->week = ins3->week;
33  result->timeOfWeek = ins3->timeOfWeek;
34  result->insStatus = ins3->insStatus;
35  result->hdwStatus = ins3->hdwStatus;
36  quat2euler(ins3->qn2b, result->theta);
37  memcpy(result->uvw, ins3->uvw, sizeof(Vector3));
38  memcpy(result->lla, ins3->lla, sizeof(Vector3d));
39  memset(result->ned, 0, sizeof(Vector3));
40 }
41 
42 void convertIns4ToIns1(ins_4_t *ins4, ins_1_t *result)
43 {
44  Vector3d llaRad;
45 
46  result->week = ins4->week;
47  result->timeOfWeek = ins4->timeOfWeek;
48  result->insStatus = ins4->insStatus;
49  result->hdwStatus = ins4->hdwStatus;
50 
51  quatConjRot(result->uvw, ins4->qe2b, ins4->ve);
52  ecef2lla(ins4->ecef, llaRad, 5);
53  qe2b2EulerNedLLA(result->theta, ins4->qe2b, llaRad);
54  lla_Rad2Deg_d(result->lla, llaRad);
55  memset(result->ned, 0, sizeof(Vector3));
56 }
void convertIns2ToIns1(ins_2_t *ins2, ins_1_t *result)
Definition: convert_ins.cpp:18
is_can_ve ve
Definition: CAN_comm.h:258
void convertIns4ToIns1(ins_4_t *ins4, ins_1_t *result)
Definition: convert_ins.cpp:42
void convertIns3ToIns1(ins_3_t *ins3, ins_1_t *result)
Definition: convert_ins.cpp:30
float qn2b[4]
Definition: data_sets.h:534
is_can_uvw uvw
Definition: CAN_comm.h:257
void quatConjRot(Vector3_t result, const Quat_t q, const Vector3_t v)
Definition: ISPose.c:161
uint32_t week
Definition: CAN_comm.h:26
double timeOfWeek
Definition: data_sets.h:417
uint32_t hdwStatus
Definition: CAN_comm.h:40
void lla_Rad2Deg_d(double result[3], double lla[3])
Definition: ISEarth.c:310
def quat2euler(q)
Definition: pose.py:126
double lla[3]
Definition: data_sets.h:511
double Vector3d[3]
Definition: ISConstants.h:790
uint32_t insStatus
Definition: CAN_comm.h:37
float theta[3]
Definition: data_sets.h:505
void qe2b2EulerNedLLA(Vector3 eul, const Vector4 qe2b, const Vector3d lla)
Definition: ISPose.c:294
void ecef2lla(const double *Pe, double *LLA, const int Niter)
Definition: ISEarth.c:54
float ned[3]
Definition: data_sets.h:514
double ecef[3]
Definition: data_sets.h:420
float qe2b[4]
Definition: data_sets.h:589


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04