Skip to content

Commit

Permalink
add extrinsics example
Browse files Browse the repository at this point in the history
  • Loading branch information
Serafadam committed Jan 27, 2025
1 parent 8eac045 commit 0b25a81
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "460451aa7290501ea9ce26301b9e421dbd67033d")
set(DEPTHAI_DEVICE_SIDE_COMMIT "5c28512d649be4a8b6b359858d385ff5c228c61e")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
4 changes: 3 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ dai_add_example(warp_mesh Warp/warp_mesh.cpp ON OFF)
# IMU
dai_add_example(imu_gyroscope_accelerometer IMU/imu_gyroscope_accelerometer.cpp ON OFF)
dai_add_example(imu_rotation_vector IMU/imu_rotation_vector.cpp ON OFF)
dai_add_example(imu_extrinsics IMU/imu_extrinsics.cpp ON OFF)
dai_add_example(imu_firmware_update IMU/imu_firmware_update.cpp ON OFF)

# mixed
dai_add_example(mono_depth_mobilenetssd mixed/mono_depth_mobilenetssd.cpp ON OFF)
Expand Down Expand Up @@ -432,4 +434,4 @@ target_compile_definitions(cast_diff PRIVATE BLOB_PATH="${diff_model}")
dai_add_example(spatial_tiny_yolo_tof_v3 SpatialDetection/spatial_tiny_yolo_tof.cpp OFF OFF)
dai_add_example(spatial_tiny_yolo_tof_v4 SpatialDetection/spatial_tiny_yolo_tof.cpp OFF OFF)
target_compile_definitions(spatial_tiny_yolo_tof_v3 PRIVATE BLOB_PATH="${tiny_yolo_v3_blob}")
target_compile_definitions(spatial_tiny_yolo_tof_v4 PRIVATE BLOB_PATH="${tiny_yolo_v4_blob}")
target_compile_definitions(spatial_tiny_yolo_tof_v4 PRIVATE BLOB_PATH="${tiny_yolo_v4_blob}")
27 changes: 27 additions & 0 deletions examples/IMU/imu_extrinsics.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <cstdio>
#include <iostream>

#include "utility.hpp"

// Includes common necessary includes for development using depthai library
#include "depthai/depthai.hpp"

int main() {
using namespace std;
using namespace std::chrono;



// Pipeline is defined, now we can connect to the device
dai::Device d;

auto imuExtr = d.readCalibration().getImuToCameraExtrinsics(dai::CameraBoardSocket::CAM_B, true);

for(auto& row : imuExtr) {
for(auto& val : row) {
cout << val << " ";
}
cout << endl;
}
return 0;
}

0 comments on commit 0b25a81

Please sign in to comment.