Skip to content

Commit

Permalink
Updated according to DSO-18454 requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
OhadMeir committed Oct 18, 2022
1 parent 0d72af3 commit e6977b9
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions common/on-chip-calib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ namespace rs2
break;
}
}

}
else if (action == RS2_CALIB_ACTION_UVMAPPING_CALIB)
{
Expand Down Expand Up @@ -1122,8 +1121,23 @@ namespace rs2
else
try_start_viewer(256, 144, 90, invoke);

if (action == RS2_CALIB_ACTION_TARE_GROUND_TRUTH)
if ( action == RS2_CALIB_ACTION_TARE_GROUND_TRUTH )
{
//Laser should be turned off during ground truth calculation
if ( _sub->s->supports( RS2_OPTION_EMITTER_ENABLED ) )
{
laser_status_prev = _sub->s->get_option( RS2_OPTION_EMITTER_ENABLED );
_sub->s->set_option( RS2_OPTION_EMITTER_ENABLED, 0.0f );
}

get_ground_truth();

//Restore laser
if ( _sub->s->supports( RS2_OPTION_EMITTER_ENABLED ) )
{
_sub->s->set_option( RS2_OPTION_EMITTER_ENABLED, laser_status_prev );
}
}
else
{
try
Expand All @@ -1132,7 +1146,7 @@ namespace rs2
if (_sub->s->supports( RS2_OPTION_EMITTER_ENABLED ))
{
laser_status_prev = _sub->s->get_option( RS2_OPTION_EMITTER_ENABLED );
_sub->s->set_option( RS2_OPTION_EMITTER_ENABLED, 0.0f );
_sub->s->set_option( RS2_OPTION_EMITTER_ENABLED, 1.0f );
}
if (_sub->s->supports( RS2_OPTION_THERMAL_COMPENSATION ))
{
Expand Down Expand Up @@ -1999,7 +2013,8 @@ namespace rs2
}
else if (update_state == RS2_CALIB_STATE_CALIB_COMPLETE)
{
if (get_manager().action == on_chip_calib_manager::RS2_CALIB_ACTION_ON_CHIP_CALIB)
if (get_manager().action == on_chip_calib_manager::RS2_CALIB_ACTION_ON_CHIP_CALIB ||
get_manager().action == on_chip_calib_manager::RS2_CALIB_ACTION_TARE_CALIB )
{
if (get_manager()._sub->s->supports( RS2_OPTION_EMITTER_ENABLED ))
get_manager()._sub->s->set_option( RS2_OPTION_EMITTER_ENABLED, get_manager().laser_status_prev );
Expand Down

0 comments on commit e6977b9

Please sign in to comment.