Skip to content

Commit

Permalink
Merge pull request #6 from luxonis/eeprom_calib
Browse files Browse the repository at this point in the history
Pass options to store calibration and board parameters in EEPROM
  • Loading branch information
alex-luxonis authored Apr 13, 2020
2 parents b34045c + 8c6328c commit c722ebd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions host/core/pipeline/host_pipeline_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ bool HostPipelineConfig::initWithJSON(const json &json_obj)
{
auto& board_conf_obj = json_obj.at("board_config");

if (board_conf_obj.contains("store_to_eeprom"))
{
board_config.store_to_eeprom = board_conf_obj.at("store_to_eeprom").get<bool>();
}

if (board_conf_obj.contains("clear_eeprom"))
{
board_config.clear_eeprom = board_conf_obj.at("clear_eeprom").get<bool>();
}

if (board_conf_obj.contains("override_eeprom_calib"))
{
board_config.override_eeprom_calib = board_conf_obj.at("override_eeprom_calib").get<bool>();
}

// "blob_file_config"
if (board_conf_obj.contains("swap_left_and_right_cameras"))
{
Expand Down
3 changes: 3 additions & 0 deletions host/core/pipeline/host_pipeline_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ struct HostPipelineConfig

struct BoardConfig
{
bool clear_eeprom = false;
bool store_to_eeprom = false;
bool override_eeprom_calib = false;
bool swap_left_and_right_cameras = false;
float left_fov_deg = 69.f;
float left_to_right_distance_m = 0.035f; // meters, not centimeters
Expand Down
3 changes: 3 additions & 0 deletions host/py_module/py_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ std::shared_ptr<CNNHostPipeline> create_pipeline(
}

json json_config_obj;
json_config_obj["board"]["clear-eeprom"] = config.board_config.clear_eeprom;
json_config_obj["board"]["store-to-eeprom"] = config.board_config.store_to_eeprom;
json_config_obj["board"]["override-eeprom"] = config.board_config.override_eeprom_calib;
json_config_obj["board"]["swap-left-and-right-cameras"] = config.board_config.swap_left_and_right_cameras;
json_config_obj["board"]["left_fov_deg"] = config.board_config.left_fov_deg;
json_config_obj["board"]["left_to_right_distance_m"] = config.board_config.left_to_right_distance_m;
Expand Down

0 comments on commit c722ebd

Please sign in to comment.