This repository, is for transforming the t265 data within the Visual Experience Database with the headCalibrate.py
script. This script is designed to perform the calibration of VEDB T265 odometry data from sensor coordinates to head coordinates. It uses the Pupil Recording Interface (pupil_recording_interface
) and Rigid Body Motion (rigid_body_motion
) custom libraries, along with other Python modules, to process and calibrate the T265 data.
Ensure you have the following dependencies installed:
numpy
pandas
xarray
matplotlib
pupil_recording_interface
rigid_body_motion
os
yaml
scipy
datetime
plotly
You can install them using:
pip install numpy pandas xarray matplotlib pupil_recording_interface rigid_body_motion scipy plotly
This can be done in a conda environment note: use pip 21.3.1, not version 22
-
Clone the repository:
git clone https://github.com/bszek213/odopy.git
-
Import the
headCalibrate
class into your Python script:from odopy import headCalibrate
-
Create an instance of the
headCalibrate
class:odo = headCalibrate.headCalibrate()
-
Set the path to the folder containing T265 data:
curr_dir = getcwd() folder = path.join(curr_dir, 'your_data_folder') odo.set_odometry_local(folder)
-
Plot and select start and end timestamps for calibration:
""" This is only necessary if there is no yaml of start and end segments of head shakes and nods. the code expects the yaml file (odo_times.yaml) to be formated as follows: - calibration: pitch_end: 2022-05-31 17:12:49 pitch_start: 2022-05-31 17:12:35 yaw_end: 2022-05-31 17:12:49 yaw_start: 2022-05-31 17:12:50 """ odo.start_end_plot()
-
Perform T265 to head transformation:
odo.t265_to_head_trans()
-
Calculate head orientation:
odo.calc_head_orientation() head_roll, head_pitch, head_yaw = odo.get_head_orientation()
-
Visualize calibrated data:
odo.plot()
The script also provides additional functionality, such as calculating gait variability and instantaneous force. You can explore and use these features based on your specific needs.
An example usage script is provided in the test_odo.py
file. You can modify this script to suit your dataset and requirements.
Feel free to contribute or report issues by creating pull requests or raising issues.