Skip to content

Commit 422df1a

Browse files
committed
add sensors to android tutorial
1 parent 7c1a642 commit 422df1a

2 files changed

Lines changed: 150 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ instance/
144144
.scrapy
145145

146146
# Sphinx documentation
147-
docs/_build/
147+
docs/build/
148148

149149
# PyBuilder
150150
target/

notebooks/tutorials/android.ipynb

Lines changed: 149 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@
1313
"id": "7954f8b9-22f3-44ba-bf04-8dfedb40250b",
1414
"metadata": {},
1515
"source": [
16-
"This tutorial walks through how to parse the files obtained from [Google's GNSSLogger Android App](https://play.google.com/store/apps/details?id=com.google.android.apps.location.gps.gnsslogger&pcampaignid=web_share). Details for each data type can be found in Google's [gps-measurement-tools](https://github.com/google/gps-measurement-tools/blob/master/LOGGING_FORMAT.md) repository."
16+
"This tutorial walks through how to parse the files obtained from [Google's GNSSLogger Android App](https://play.google.com/store/apps/details?id=com.google.android.apps.location.gps.gnsslogger&pcampaignid=web_share). Details for each data type can be found in Google's [gps-measurement-tools](https://github.com/google/gps-measurement-tools/blob/master/LOGGING_FORMAT.md) repository.\n",
17+
"\n",
18+
"The toggle switches on the \"Home\" tab of the GNSSLogger app need to be set based on the type(s) of measurements you want to log: fixes, raw, NMEA, Rinex, sensors, etc.\n",
19+
"\n",
20+
"After data is logged, the measurements can be saved immediately or retrieved at a later time within Android's internal storage. Data can be found on the phone under a directory similar to: ``<phone>/Internal shared storage/Android/data/com.google.android.apps.location.gps.gnsslogger/files/gnss_log/``"
21+
]
22+
},
23+
{
24+
"cell_type": "markdown",
25+
"id": "16a92bd3-daf2-42e5-9eeb-0a5abb6c2d49",
26+
"metadata": {},
27+
"source": [
28+
"![GnssLogger screenshot](https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/derek/android_raw/docs/source/img/gnss_logger_app.jpg)"
1729
]
1830
},
1931
{
@@ -569,6 +581,142 @@
569581
"raw_fig = glp.plot_map(wls_estimate)\n",
570582
"raw_fig.show()"
571583
]
584+
},
585+
{
586+
"cell_type": "markdown",
587+
"id": "928c06d2-56a2-4346-9b1f-5404bf019d1c",
588+
"metadata": {},
589+
"source": [
590+
"## Sensor Measurements gnss_log*.txt"
591+
]
592+
},
593+
{
594+
"cell_type": "markdown",
595+
"id": "02d00300-27a2-4b29-bcd7-143f988de1c0",
596+
"metadata": {},
597+
"source": [
598+
"If the \"sensors\" option is toggled in the GNSSLogger app, then the gnss_log*.txt log file will contain a number of sensor measurements that can be extracted with built in Python classes."
599+
]
600+
},
601+
{
602+
"cell_type": "markdown",
603+
"id": "3a5b5e04-5829-4619-9b81-39e5ce5233ac",
604+
"metadata": {},
605+
"source": [
606+
"### Accelerometer Measurements from gnss_log*.txt"
607+
]
608+
},
609+
{
610+
"cell_type": "code",
611+
"execution_count": null,
612+
"id": "6986845b-fc8f-4f43-b870-6cc706d5ca3a",
613+
"metadata": {},
614+
"outputs": [],
615+
"source": [
616+
"raw_data = glp.AndroidRawAccel(input_path=\"gnss_log.txt\")"
617+
]
618+
},
619+
{
620+
"cell_type": "code",
621+
"execution_count": null,
622+
"id": "67178fcd-7a47-4484-a15d-c772e052680c",
623+
"metadata": {},
624+
"outputs": [],
625+
"source": [
626+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"acc_x_uncal_mps2\",label=\"x\")\n",
627+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"acc_y_uncal_mps2\",label=\"y\",fig=fig)\n",
628+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"acc_z_uncal_mps2\",label=\"z\",fig=fig)"
629+
]
630+
},
631+
{
632+
"cell_type": "markdown",
633+
"id": "1f7d84f2-10c5-43be-9b33-b4c222533e9c",
634+
"metadata": {},
635+
"source": [
636+
"### Gyro Measurements from gnss_log*.txt"
637+
]
638+
},
639+
{
640+
"cell_type": "code",
641+
"execution_count": null,
642+
"id": "a5263791-c5b5-4332-bfef-4a6204aa945a",
643+
"metadata": {},
644+
"outputs": [],
645+
"source": [
646+
"raw_data = glp.AndroidRawGyro(input_path=\"gnss_log.txt\")"
647+
]
648+
},
649+
{
650+
"cell_type": "code",
651+
"execution_count": null,
652+
"id": "f36ffe54-fd86-4471-8dfc-f8eca7b67e8c",
653+
"metadata": {},
654+
"outputs": [],
655+
"source": [
656+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"ang_vel_x_uncal_radps\",label=\"x\")\n",
657+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"ang_vel_y_uncal_radps\",label=\"y\",fig=fig)\n",
658+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"ang_vel_z_uncal_radps\",label=\"z\",fig=fig)"
659+
]
660+
},
661+
{
662+
"cell_type": "markdown",
663+
"id": "1dedf8c6-66ec-4862-8e6e-b44610647bb1",
664+
"metadata": {},
665+
"source": [
666+
"### Magnetometer Measurements from gnss_log*.txt"
667+
]
668+
},
669+
{
670+
"cell_type": "code",
671+
"execution_count": null,
672+
"id": "39d176d5-f11f-441f-8b58-70de6f0389ce",
673+
"metadata": {},
674+
"outputs": [],
675+
"source": [
676+
"raw_data = glp.AndroidRawMag(input_path=\"gnss_log.txt\")"
677+
]
678+
},
679+
{
680+
"cell_type": "code",
681+
"execution_count": null,
682+
"id": "cc717014-1902-4fff-8e1b-3712916906bd",
683+
"metadata": {},
684+
"outputs": [],
685+
"source": [
686+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"mag_x_uncal_microt\",label=\"x\")\n",
687+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"mag_y_uncal_microt\",label=\"y\",fig=fig)\n",
688+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"mag_z_uncal_microt\",label=\"z\",fig=fig)"
689+
]
690+
},
691+
{
692+
"cell_type": "markdown",
693+
"id": "a770c7ea-02fc-43b7-b3d3-93b0e79855be",
694+
"metadata": {},
695+
"source": [
696+
"### Orientation Measurements from gnss_log*.txt"
697+
]
698+
},
699+
{
700+
"cell_type": "code",
701+
"execution_count": null,
702+
"id": "cd945c3f-5ee7-459d-8b7b-bee7320863fb",
703+
"metadata": {},
704+
"outputs": [],
705+
"source": [
706+
"raw_data = glp.AndroidRawOrientation(input_path=\"gnss_log.txt\")"
707+
]
708+
},
709+
{
710+
"cell_type": "code",
711+
"execution_count": null,
712+
"id": "90d9065b-7573-446a-b20e-9445158a76ca",
713+
"metadata": {},
714+
"outputs": [],
715+
"source": [
716+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"roll_rx_deg\",label=\"roll\")\n",
717+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"pitch_rx_deg\",label=\"pitch\",fig=fig)\n",
718+
"fig = glp.plot_metric(raw_data, \"gps_millis\",\"yaw_rx_deg\",label=\"yaw\",fig=fig)"
719+
]
572720
}
573721
],
574722
"metadata": {

0 commit comments

Comments
 (0)