Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-gps
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-apps-gps
Commits
e10630db
Commit
e10630db
authored
Oct 25, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated event log operation and set up
parent
4eb05bc1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
read_imu_log.php
src/read_imu_log.php
+16
-9
start_gps_compass.php
src/start_gps_compass.php
+1
-1
No files found.
src/read_imu_log.php
View file @
e10630db
...
@@ -6,7 +6,8 @@ if (!isset($_GET['file'])){
...
@@ -6,7 +6,8 @@ if (!isset($_GET['file'])){
exit
(
0
);
exit
(
0
);
}
}
$timeShift
=
21600
;
//$timeShift = 21600; // 6 hrs
$timeShift
=
0
;
// 6 hrs
$file
=
$_GET
[
'file'
];
$file
=
$_GET
[
'file'
];
$numRecordsInFile
=
filesize
(
$file
)
/
64
;
$numRecordsInFile
=
filesize
(
$file
)
/
64
;
...
@@ -63,7 +64,7 @@ function imuLogParse($handle,$record,$nSamples,$filter,$tryNumber=10000){
...
@@ -63,7 +64,7 @@ function imuLogParse($handle,$record,$nSamples,$filter,$tryNumber=10000){
global
$timeShift
;
global
$timeShift
;
global
$averageIMU
;
global
$averageIMU
;
$showAll
=
(
$nSamples
<=
10000
);
$showAll
=
(
$nSamples
<=
10000
0
);
$gpsFilter
=
$filter
&
0xf
;
$gpsFilter
=
$filter
&
0xf
;
$typeFilter
=
((
$gpsFilter
!=
0
)
?
2
:
0
)
|
(((
$filter
&
0x10
)
!=
0
)
?
1
:
0
)
|
(((
$filter
&
0x20
)
!=
0
)
?
4
:
0
)
|
(((
$filter
&
0x20
)
!=
0
)
?
8
:
0
);
$typeFilter
=
((
$gpsFilter
!=
0
)
?
2
:
0
)
|
(((
$filter
&
0x10
)
!=
0
)
?
1
:
0
)
|
(((
$filter
&
0x20
)
!=
0
)
?
4
:
0
)
|
(((
$filter
&
0x20
)
!=
0
)
?
8
:
0
);
fseek
(
$handle
,
64
*
$record
,
SEEK_SET
);
fseek
(
$handle
,
64
*
$record
,
SEEK_SET
);
...
@@ -126,7 +127,8 @@ function imuLogParse($handle,$record,$nSamples,$filter,$tryNumber=10000){
...
@@ -126,7 +127,8 @@ function imuLogParse($handle,$record,$nSamples,$filter,$tryNumber=10000){
// Master (Sync) record
// Master (Sync) record
case
2
:
case
2
:
$masterTime
=
((
$arr32
[
3
]
&
0xfffff
)
/
1000000
)
+
$arr32
[
4
];
$masterTime
=
((
$arr32
[
3
]
&
0xfffff
)
/
1000000
)
+
$arr32
[
4
];
echo
"MasterTimeStamp: <b>"
.
(
$masterTime
+
$timeShift
)
.
"</b> TimeStamp: <b>"
.
(
$time
+
$timeShift
)
.
"</b> MasterTimeStamp(precise): 0x"
.
dechex
(
$arr32
[
4
])
.
"+"
.
dechex
(
$arr32
[
3
])
.
" TimeStamp(precise): 0x"
.
dechex
(
$arr32
[
2
])
.
"+"
.
dechex
(
$arr32
[
1
])
.
"
$masterTime
- "
.
gmdate
(
DATE_RFC850
,
$masterTime
)
.
" [local timestamp - "
.
gmdate
(
DATE_RFC850
,
$time
)
.
"]
\n
"
;
$subchannel
=
(
$arr32
[
3
]
>>
24
);
echo
"Subchannel: <b>"
.
$subchannel
.
"</b> MasterTimeStamp: <b>"
.
(
$masterTime
+
$timeShift
)
.
"</b> TimeStamp: <b>"
.
(
$time
+
$timeShift
)
.
"</b> MasterTimeStamp(precise): 0x"
.
dechex
(
$arr32
[
4
])
.
"+"
.
dechex
(
$arr32
[
3
])
.
" TimeStamp(precise): 0x"
.
dechex
(
$arr32
[
2
])
.
"+"
.
dechex
(
$arr32
[
1
])
.
"
$masterTime
- "
.
gmdate
(
DATE_RFC850
,
$masterTime
)
.
" [local timestamp - "
.
gmdate
(
DATE_RFC850
,
$time
)
.
"]
\n
"
;
break
;
break
;
// Show hex data
// Show hex data
case
3
:
print_r
(
$arr32
);
case
3
:
print_r
(
$arr32
);
...
@@ -134,12 +136,17 @@ function imuLogParse($handle,$record,$nSamples,$filter,$tryNumber=10000){
...
@@ -134,12 +136,17 @@ function imuLogParse($handle,$record,$nSamples,$filter,$tryNumber=10000){
}
}
}
}
}
}
foreach
(
$averageIMU
as
$key
=>
$value
)
if
(
$key
!=
'number'
)
$averageIMU
[
$key
]
/=
$averageIMU
[
'number'
];
if
(
$averageIMU
[
'number'
]
>
0
)
{
print_r
(
$averageIMU
);
foreach
(
$averageIMU
as
$key
=>
$value
)
echo
"</pre>
\n
"
;
if
(
$key
!=
'number'
)
$averageIMU
[
$key
]
/=
$averageIMU
[
'number'
];
print_r
(
$averageIMU
);
echo
"</pre>
\n
"
;
echo
"<table>
\n
"
;
echo
"<table>
\n
"
;
foreach
(
$averageIMU
as
$key
=>
$value
)
echo
"<tr><td>
$key
</td><td>
$value
</td></tr>
\n
"
;
foreach
(
$averageIMU
as
$key
=>
$value
)
echo
"<tr><td>
$key
</td><td>
$value
</td></tr>
\n
"
;
echo
"</table>
\n
"
;
echo
"</table>
\n
"
;
}
}
}
function
parseGPS
(
$sample
){
function
parseGPS
(
$sample
){
...
...
src/start_gps_compass.php
View file @
e10630db
...
@@ -64,7 +64,7 @@ $b_index = indexGrandDaughters ( $ids );
...
@@ -64,7 +64,7 @@ $b_index = indexGrandDaughters ( $ids );
// print_r($ids);
// print_r($ids);
// print_r($b_index);
// print_r($b_index);
$baud
=
null
;
$baud
=
null
;
$binfile
=
"/var/imu_config.bin"
;
// comment out if not needed - debug feature
//
$binfile = "/var/imu_config.bin"; // comment out if not needed - debug feature
if
(
isset
(
$b_index
[
103696
]
))
{
if
(
isset
(
$b_index
[
103696
]
))
{
$baud
=
$ids
[
$b_index
[
103696
]]
[
'baud'
];
$baud
=
$ids
[
$b_index
[
103696
]]
[
'baud'
];
if
(
$baud
===
0
)
if
(
$baud
===
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment