Skip to content

Commit

Permalink
Merge pull request #234 from MissouriMRDT/hotix/zed-bind-error
Browse files Browse the repository at this point in the history
Fix Missing Bind Directory on Container Start
  • Loading branch information
ClayJay3 authored Apr 4, 2024
2 parents 338afca + b75b4ed commit bcb4a58
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Binary file added data/models/zed/neural_depth_2.0.model
Binary file not shown.
2 changes: 1 addition & 1 deletion src/AutonomyConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace constants
// ZedCam Spatial Mapping Config.
const sl::SpatialMappingParameters::SPATIAL_MAP_TYPE ZED_MAPPING_TYPE = sl::SpatialMappingParameters::SPATIAL_MAP_TYPE::MESH; // Mesh or point cloud output.
const float ZED_MAPPING_RANGE_METER = 20.0; // The max range in meters that the ZED cameras should use for mapping. 0 = auto.
const float ZED_MAPPING_RESOLUTION_METER = 0.01; // The approx goal precision for spatial mapping in METERS. Higher = Faster.
const float ZED_MAPPING_RESOLUTION_METER = 0.1; // The approx goal precision for spatial mapping in METERS. Higher = Faster.
const int ZED_MAPPING_MAX_MEMORY = 4096; // The max amount of CPU RAM (MB) that can be allocated for spatial mapping.
const bool ZED_MAPPING_USE_CHUNK_ONLY = true; // Only update chunks that have probably changed or have new data. Faster, less accurate.
const int ZED_MAPPING_STABILITY_COUNTER = 4; // Number of times that a point should be seen before adding to mesh.
Expand Down
13 changes: 13 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ int main()

// Camera and TagDetector config.
pMainCam->EnablePositionalTracking(); // Enable positional tracking for main ZED cam.
pMainCam->EnableSpatialMapping();

/*
This while loop is the main periodic loop for the Autonomy_Software program.
Expand Down Expand Up @@ -213,6 +214,18 @@ int main()
/////////////////////////////////////////
// Cleanup.
/////////////////////////////////////////

// Check if ZED spatial map was enabled.
if (pMainCam->GetSpatialMappingState() == sl::SPATIAL_MAPPING_STATE::OK)
{
// Extract and save spatial map.
std::future<sl::Mesh> fuSpatialMap;
pMainCam->ExtractSpatialMapAsync(fuSpatialMap);
sl::Mesh slSpatialMap = fuSpatialMap.get();
std::string szFilePath = "./logs/" + logging::g_szProgramStartTimeString + "/spatial_map";
slSpatialMap.save(szFilePath.c_str(), sl::MESH_FILE_FORMAT::PLY);
}

// Stop RoveComm quill logging or quill will segfault if trying to output logs to RoveComm.
network::g_bRoveCommUDPStatus = false;
network::g_bRoveCommTCPStatus = false;
Expand Down

0 comments on commit bcb4a58

Please sign in to comment.