Skip to content

Commit

Permalink
updated tof sensor tool
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNASC20 committed Nov 20, 2024
1 parent 5b49e5d commit aa58490
Show file tree
Hide file tree
Showing 18 changed files with 2,481 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Drive]
folder = 1Gtv32djO-5RwEse8uSRRZN52drWGYjiW
credentials = C:\Users\TonyNgumah\Desktop\TOF\credentials.json
email = [email protected]
16 changes: 16 additions & 0 deletions hardware-testing/hardware_testing/drivers/TOF/configs/poc2a(1).ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Drive]
folder = 1Gtv32djO-5RwEse8uSRRZN52drWGYjiW
email = [email protected]
[Robot]
name = POC2-A
[Z]
serial = A0014
cover = No Cover
[X]
serial = A0013
cover = Cover
[Labware]
name = Nest 12 Well Reservoir 15 mL
samples = 1
[Test]
test = Home
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Drive]
folder = 1Gtv32djO-5RwEse8uSRRZN52drWGYjiW
email = [email protected]
[Robot]
name = POC2-A (Z increase)
[Z]
serial = A0014
cover = No Cover
[X]
serial = A0013
cover = Cover
[Labware]
name = Bio Rad Hard-Shell 384 Well Plate 50 uL
samples = 1
[Test]
test = Gripper
16 changes: 16 additions & 0 deletions hardware-testing/hardware_testing/drivers/TOF/configs/poc2c(1).ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Drive]
folder = 1Gtv32djO-5RwEse8uSRRZN52drWGYjiW
email = [email protected]
[Robot]
name = POC2-C
[Z]
serial = A0006
cover = No Cover
[X]
serial = A0012
cover = Cover
[Labware]
name = Corning 24 Well Plate 3.4 ml + Lid
samples = 1
[Test]
test = Gripper
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Drive]
folder = 1Gtv32djO-5RwEse8uSRRZN52drWGYjiW
email = [email protected]
[Robot]
name = POC2-C
[Z]
serial = A0006
cover = No Cover
[X]
serial = A0012
cover = Cover
[Labware]
name = Corning 96 Well Plate 360 uL (clear)
samples = 1
[Test]
test = Gripper
11 changes: 11 additions & 0 deletions hardware-testing/hardware_testing/drivers/TOF/file_manager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import os
import traceback
def remove_folder(folder):
for file in os.listdir(folder):
try:
file_path = os.path.join(folder, file)
os.remove(file_path)
except:
print("Can not remove file")
traceback.print_exc()
os.rmdir(folder)
49 changes: 49 additions & 0 deletions hardware-testing/hardware_testing/drivers/TOF/firmware/CAL.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//cal#1
static struct tmf882x_mode_app_calib cal_data_1 = {
.data = {
1, 1, 1, 0, 1, 255, 160, 15, 134, 86, 52, 18, 149, 223, 16, 20, 152, 70, 7, 0, 38, 53, 7, 0, 5, 97, 7, 0, 31, 102, 7, 0, 152, 70, 7, 0, 152, 70, 7, 0, 152, 70, 7, 0, 152, 70, 7, 0, 152, 70, 7, 0, 152, 70, 7, 0, 17, 137, 9, 0, 11, 1, 0, 0, 249, 2, 0, 0, 88, 5, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 7, 0, 160, 15, 0, 0, 160, 15, 0, 0, 160, 15, 0, 0, 160, 15, 0, 0, 160, 15, 0, 0, 160, 15, 0, 0, 160, 15, 0, 0, 160, 15, 0, 0, 160, 15, 0, 0, 160, 15, 0, 0, 49, 0, 208, 123
},
.calib_len = 188,
};

//taken in dark in EE lab with 0.5mm coverglass
//A0012
//cal#2
static struct tmf882x_mode_app_calib cal_data_2 = {
.data = {
1,1,1,0,1,255,160,15,134,86,52,18,149,223,16,20,94,69,7,0,255,42,7,0,244,105,7,0,20,103,7,0,94,69,7,0,94,69,7,0,94,69,7,0,94,69,7,0,94,69,7,0,94,69,7,0,21,138,9,0,249,0,0,0,236,2,0,0,219,4,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,49,0,221,123
},
.calib_len = 188,
};

//taken in dark in EE lab with 0.5mm coverglass
//A0018
//cal#3
static struct tmf882x_mode_app_calib cal_data_3 = {
.data = {
1,1,1,0,1,255,160,15,134,86,52,18,131,223,16,20,255,170,7,0,115,153,7,0,123,168,7,0,205,164,7,0,255,170,7,0,255,170,7,0,255,170,7,0,255,170,7,0,255,170,7,0,255,170,7,0,253,154,9,0,197,0,0,0,67,2,0,0,183,3,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,49,0,14,123
},
.calib_len = 188,
};

//taken in bright in lab with 0.5mm coverglass
//using x spad mask
//A0012
//cal#4
static struct tmf882x_mode_app_calib cal_data_4 = {
.data = {
1,1,1,0,1,255,160,15,134,86,52,18,151,89,240,133,177,65,7,0,16,48,7,0,188,92,7,0,177,65,7,0,177,65,7,0,177,65,7,0,177,65,7,0,177,65,7,0,177,65,7,0,177,65,7,0,150,174,9,0,134,1,0,0,36,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,49,0,226,123
},
.calib_len = 188,
};

//taken in bright in lab with 0.5mm coverglass
//using x_2 spad mask
//A0012
//cal#4
static struct tmf882x_mode_app_calib cal_data = {
.data = {
1,1,1,0,1,255,160,15,134,86,52,18,126,239,181,199,177,65,7,0,177,65,7,0,215,93,7,0,10,104,7,0,255,104,7,0,20,103,7,0,124,124,7,0,197,107,7,0,0,128,7,0,177,65,7,0,34,134,9,0,1,0,0,0,57,2,0,0,170,0,0,0,169,0,0,0,196,0,0,0,139,0,0,0,151,0,0,0,253,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,160,15,0,0,49,0,251,123,
},
.calib_len = 188,
};
192 changes: 192 additions & 0 deletions hardware-testing/hardware_testing/drivers/TOF/firmware/SPADMAP.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
/*
Example-10_CustomSPADMap.ino
This example shows how to create a custom SPAD Map and enable it on the
connected TMF882X device.
Supported Boards:
SparkFun Qwiic dToF Imager - TMF8820 https://www.sparkfun.com/products/19036
SparkFun Qwiic Mini dToF Imager - TMF8820 https://www.sparkfun.com/products/19218
SparkFun Qwiic Mini dToF Imager - TMF8821 https://www.sparkfun.com/products/19451
SparkFun Qwiic dToF Imager - TMF8821 https://www.sparkfun.com/products/19037
Written by Kirk Benell @ SparkFun Electronics, April 2022
Repository:
https://github.com/sparkfun/SparkFun_Qwiic_TMF882X_Arduino_Library
Documentation:
https://sparkfun.github.io/SparkFun_Qwiic_TMF882X_Arduino_Library/
SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).
*/
#pragma once

// Define a custom SPAD map (from the AMS TMF882x SDK Examples)

static struct tmf882x_mode_app_spad_config spadConfig = {

/* Custom SPAD mask and map configuration for first measurement
* in time multiplex mode
*/
.spad_configs = {
{
.xoff_q1 = 0,
.yoff_q1 = 0,
.xsize = TMF8X2X_COM_MAX_SPAD_XSIZE,
.ysize = TMF8X2X_COM_MAX_SPAD_YSIZE,
// SPAD mask to enable the top half for the first measurement
.spad_mask = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
},
.spad_map = {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7,
6, 6, 6, 6, 6, 6, 3, 2, 2, 2, 2, 3, 7, 7, 7, 7, 7, 7,
6, 6, 6, 6, 6, 6, 3, 2, 1, 1, 2, 3, 7, 7, 7, 7, 7, 7,
6, 6, 6, 6, 6, 6, 3, 2, 1, 1, 2, 3, 7, 7, 7, 7, 7, 7,
6, 6, 6, 6, 6, 6, 3, 2, 2, 2, 2, 3, 7, 7, 7, 7, 7, 7,
6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
},
},
},
.num_spad_configs = 1,

};

static struct tmf882x_mode_app_spad_config spadConfig_x = {

/* Custom SPAD mask and map configuration for first measurement
* in time multiplex mode
*/
.spad_configs = {
{
.xoff_q1 = 0,
.yoff_q1 = 0,
.xsize = TMF8X2X_COM_MAX_SPAD_XSIZE,
.ysize = TMF8X2X_COM_MAX_SPAD_YSIZE,
// SPAD mask to enable the top half for the first measurement
.spad_mask = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
},
.spad_map = {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 1, 1, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
6, 6, 6, 1, 1, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
6, 6, 6, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
6, 6, 6, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
},
},
},
.num_spad_configs = 1,
};

static struct tmf882x_mode_app_spad_config spadConfig_x_2 = {

/* Custom SPAD mask and map configuration for first measurement
* in time multiplex mode
*/
.spad_configs = {
{
.xoff_q1 = 0,
.yoff_q1 = 0,
.xsize = TMF8X2X_COM_MAX_SPAD_XSIZE,
.ysize = TMF8X2X_COM_MAX_SPAD_YSIZE,
// SPAD mask to enable the top half for the first measurement
.spad_mask = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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x_mode_app_spad_config spadConfig_x_3 = {

/* Custom SPAD mask and map configuration for first measurement
* in time multiplex mode
*/
.spad_configs = {
{
.xoff_q1 = 0,
.yoff_q1 = 0,
.xsize = TMF8X2X_COM_MAX_SPAD_XSIZE,
.ysize = TMF8X2X_COM_MAX_SPAD_YSIZE,
// SPAD mask to enable the top half for the first measurement
.spad_mask = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
},
.spad_map = {
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 7, 6, 5, 4, 3, 2, 2,
9, 9, 9, 9, 9, 9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