parameters: (self, state, gt_path)
return_statement: return next_viewpoint
docstring: Compute the next viewpoint by trying to steer back to original ground truth trajectory
docstring_summary: Compute the next viewpoint by trying to steer back to original ground truth trajectory
docstring_tokens: Compute the next viewpoint by trying to steer back to original ground truth trajectory
function: def shortest_path_to_gt_traj(self, state, gt_path):
          """ Compute the next viewpoint by trying to steer back to original ground truth trajectory"""
          min_steps = 100
          min_distance = 100
          current_distance = self.distances[state.scanId][state.location.viewpointId][gt_path[-1]]
  
          if current_distance != 0:
              for gt_viewpoint in gt_path:
                  steps = len(self.paths[state.scanId][state.location.viewpointId][gt_viewpoint])
                  next_distance = self.distances[state.scanId][gt_viewpoint][gt_path[-1]]
  
                  # if the next viewpoint requires moving and its distance to the goal is closer
                  if steps > 0 and next_distance < current_distance:
                      if min_steps >= steps and min_distance > next_distance:
                          min_steps = steps
                          min_distance = next_distance
                          next_viewpoint = gt_viewpoint
          else:
              next_viewpoint = state.location.viewpointId
          return next_viewpoint
function_tokens: def shortest_path_to_gt_traj ( self , state , gt_path ) : min_steps = 100 min_distance = 100 current_distance = self . distances [ state . scanId ] [ state . location . viewpointId ] [ gt_path [ - 1 ] ] if current_distance != 0 : for gt_viewpoint in gt_path : steps = len ( self . paths [ state . scanId ] [ state . location . viewpointId ] [ gt_viewpoint ] ) next_distance = self . distances [ state . scanId ] [ gt_viewpoint ] [ gt_path [ - 1 ] ] # if the next viewpoint requires moving and its distance to the goal is closer if steps > 0 and next_distance < current_distance : if min_steps >= steps and min_distance > next_distance : min_steps = steps min_distance = next_distance next_viewpoint = gt_viewpoint else : next_viewpoint = state . location . viewpointId return next_viewpoint