Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HighBlueParsers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Best
HighBlueParsers
Commits
9c1c2012
Commit
9c1c2012
authored
8 months ago
by
Philemon Prevot
Browse files
Options
Downloads
Patches
Plain Diff
Add QHBV2 compatibility
parent
a6ce8977
No related branches found
No related tags found
1 merge request
!2
HighBlueParser dev branch merged to empty main branch
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/filewriter.cpp
+15
-19
15 additions, 19 deletions
src/filewriter.cpp
src/filewriter.h
+1
-1
1 addition, 1 deletion
src/filewriter.h
with
16 additions
and
20 deletions
src/filewriter.cpp
+
15
−
19
View file @
9c1c2012
...
@@ -216,7 +216,6 @@ void IMUFileWriter::ProcessDecodedMessage(int msgFunction, int msgPayloadLength,
...
@@ -216,7 +216,6 @@ void IMUFileWriter::ProcessDecodedMessage(int msgFunction, int msgPayloadLength,
unsigned
int
timeStamp
=
0
;
unsigned
int
timeStamp
=
0
;
switch
(
static_cast
<
short
>
(
msgFunction
))
{
switch
(
static_cast
<
short
>
(
msgFunction
))
{
case
static_cast
<
short
>
(
HS_DATA_PACKET_FULL_TIMESTAMP
):
{
case
static_cast
<
short
>
(
HS_DATA_PACKET_FULL_TIMESTAMP
):
{
/*
IMUFileWriter
::
SensorType
sensorType
=
static_cast
<
SensorType
>
(
msgPayload
[
0
]);
IMUFileWriter
::
SensorType
sensorType
=
static_cast
<
SensorType
>
(
msgPayload
[
0
]);
unsigned
char
id
=
msgPayload
[
1
];
unsigned
char
id
=
msgPayload
[
1
];
unsigned
char
nbChannels
=
msgPayload
[
2
];
unsigned
char
nbChannels
=
msgPayload
[
2
];
...
@@ -232,22 +231,22 @@ void IMUFileWriter::ProcessDecodedMessage(int msgFunction, int msgPayloadLength,
...
@@ -232,22 +231,22 @@ void IMUFileWriter::ProcessDecodedMessage(int msgFunction, int msgPayloadLength,
double
magRange
=
4900.0
;
//Fixe
double
magRange
=
4900.0
;
//Fixe
for
(
int
i
=
0
;
i
<
nbSamples
&&
msgPayloadLength
>=
lengthPerSample
*
i
+
9
;
i
++
)
{
for
(
int
i
=
0
;
i
<
nbSamples
&&
msgPayloadLength
>=
lengthPerSample
*
i
+
9
;
i
++
)
{
timeStamp = BUILD_UINT32(9 + i * lengthPerSample
, 9 + i *
9 + i * lengthPerSample+
1,
9 + i * lengthPerSample+
2,
9 + i * lengthPerSample
+3
);
timeStamp
=
BUILD_UINT32
(
msgPayload
[
9
+
i
*
lengthPerSample
+
3
],
msgPayload
[
9
+
i
*
lengthPerSample
+
2
],
msgPayload
[
9
+
i
*
lengthPerSample
+
1
],
msgPayload
[
9
+
i
*
lengthPerSample
]
);
if(timeStamp > lastTimeStamp)
:
{
if
(
timeStamp
>
lastTimeStamp
)
{
lastTimeStamp
=
timeStamp
;
lastTimeStamp
=
timeStamp
;
switch
(
sensorType
)
{
switch
(
sensorType
)
{
case
IMUFileWriter
::
SensorType
::
IMU
:
{
case
IMUFileWriter
::
SensorType
::
IMU
:
{
outfile
<<
timeStamp
;
outfile
<<
timeStamp
;
outfile << ", " << BUILD_UINT16(13 + i * lengthPerSample
,
13 + i * lengthPerSample+1); // AccelX
outfile
<<
", "
<<
BUILD_UINT16
(
msgPayload
[
13
+
i
*
lengthPerSample
],
msgPayload
[
13
+
i
*
lengthPerSample
+
1
]
);
// AccelX
outfile << ", " << BUILD_UINT16(15 + i * lengthPerSample
,
15 + i * lengthPerSample+1); // AccelY
outfile
<<
", "
<<
BUILD_UINT16
(
msgPayload
[
15
+
i
*
lengthPerSample
],
msgPayload
[
15
+
i
*
lengthPerSample
+
1
]
);
// AccelY
outfile << ", " << BUILD_UINT16(17 + i * lengthPerSample
,
17 + i * lengthPerSample+1); // AccelZ
outfile
<<
", "
<<
BUILD_UINT16
(
msgPayload
[
17
+
i
*
lengthPerSample
],
msgPayload
[
17
+
i
*
lengthPerSample
+
1
]
);
// AccelZ
outfile << ", " << BUILD_UINT16(19 + i * lengthPerSample
,
19 + i * lengthPerSample+1); // GyroX
outfile
<<
", "
<<
BUILD_UINT16
(
msgPayload
[
19
+
i
*
lengthPerSample
],
msgPayload
[
19
+
i
*
lengthPerSample
+
1
]
);
// GyroX
outfile << ", " << BUILD_UINT16(21 + i * lengthPerSample
,
21 + i * lengthPerSample+1); // GyroY
outfile
<<
", "
<<
BUILD_UINT16
(
msgPayload
[
21
+
i
*
lengthPerSample
],
msgPayload
[
21
+
i
*
lengthPerSample
+
1
]
);
// GyroY
outfile << ", " << BUILD_UINT16(23 + i * lengthPerSample
,
23 + i * lengthPerSample+1); // GyroZ
outfile
<<
", "
<<
BUILD_UINT16
(
msgPayload
[
23
+
i
*
lengthPerSample
],
msgPayload
[
23
+
i
*
lengthPerSample
+
1
]
);
// GyroZ
outfile << ", " << BUILD_UINT16(25 + i * lengthPerSample
,
25 + i * lengthPerSample+1); // MagX
outfile
<<
", "
<<
BUILD_UINT16
(
msgPayload
[
25
+
i
*
lengthPerSample
],
msgPayload
[
25
+
i
*
lengthPerSample
+
1
]
);
// MagX
outfile << ", " << BUILD_UINT16(27 + i * lengthPerSample
,
27 + i * lengthPerSample+1); // MagY
outfile
<<
", "
<<
BUILD_UINT16
(
msgPayload
[
27
+
i
*
lengthPerSample
],
msgPayload
[
27
+
i
*
lengthPerSample
+
1
]
);
// MagY
outfile << ", " << BUILD_UINT16(29 + i * lengthPerSample
,
29 + i * lengthPerSample+1); // MagZ
outfile
<<
", "
<<
BUILD_UINT16
(
msgPayload
[
29
+
i
*
lengthPerSample
],
msgPayload
[
29
+
i
*
lengthPerSample
+
1
]
);
// MagZ
outfile
<<
std
::
endl
;
outfile
<<
std
::
endl
;
}
}
break
;
break
;
...
@@ -269,8 +268,7 @@ void IMUFileWriter::ProcessDecodedMessage(int msgFunction, int msgPayloadLength,
...
@@ -269,8 +268,7 @@ void IMUFileWriter::ProcessDecodedMessage(int msgFunction, int msgPayloadLength,
}
else
{
}
else
{
outfile
<<
"TS IMU Error"
<<
std
::
endl
;
outfile
<<
"TS IMU Error"
<<
std
::
endl
;
}
}
}*/
}
outfile
<<
"Not implemented yet. Deprecated version?"
<<
std
::
endl
;
// Commented block added by Philémon Prévot 29/08/2024
}
}
break
;
break
;
case
static_cast
<
short
>
(
HS_DATA_PACKET_FULL_TIMESTAMP_V2
):
{
case
static_cast
<
short
>
(
HS_DATA_PACKET_FULL_TIMESTAMP_V2
):
{
...
@@ -452,10 +450,8 @@ void IMUFileWriter::ProcessDecodedMessage(int msgFunction, int msgPayloadLength,
...
@@ -452,10 +450,8 @@ void IMUFileWriter::ProcessDecodedMessage(int msgFunction, int msgPayloadLength,
void
IMUFileWriter
::
write
(
uint8_t
*
sample
,
size_t
size
,
uint8_t
*
imu_data
)
{
void
IMUFileWriter
::
write
(
uint8_t
*
sample
,
size_t
size
,
uint8_t
*
imu_data
)
{
uint8_t
*
imu_data_cur
(
imu_data
);
uint8_t
*
imu_data_cur
(
imu_data
);
uint8_t
softwareMajorRev
=
imu_data
[
0
];
if
(
!
(
imu_data
[
0
]
==
0xFE
)
&&
(
imu_data
[
0
]
>=
2
))
{
uint8_t
softwareMinorRev
=
imu_data
[
1
];
std
::
cerr
<<
"Pantoufle"
<<
std
::
endl
;
if
(
softwareMajorRev
>=
2
)
{
for
(
int
i
=
1
;
i
<
size
-
1
;
i
++
)
for
(
int
i
=
1
;
i
<
size
-
1
;
i
++
)
{
{
DecodeMessage
(
imu_data
[
i
]);
DecodeMessage
(
imu_data
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
src/filewriter.h
+
1
−
1
View file @
9c1c2012
...
@@ -192,7 +192,7 @@ private:
...
@@ -192,7 +192,7 @@ private:
unsigned
int
lastLightTimeStamp
;
unsigned
int
lastLightTimeStamp
;
unsigned
int
lastPressureTimeStamp
=
0
;
unsigned
int
lastPressureTimeStamp
=
0
;
unsigned
int
lastTemperatureTimeStamp
;
unsigned
int
lastTemperatureTimeStamp
;
unsigned
int
lastTimeStamp
;
unsigned
int
lastTimeStamp
=
0
;
DateTime
lastGPSDate
;
DateTime
lastGPSDate
;
double
lastPPSTimeStampNS
;
double
lastPPSTimeStampNS
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment