Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass options to store calibration and board parameters in EEPROM #6

Merged
merged 1 commit into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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