def _update_target_checkpoints(self, ego_lane_index) -> bool:
        """
        update the checkpoint, return True if updated else False
        """
        if self.current_checkpoint_lane_index == self.next_checkpoint_lane_index:  # on last road
            return False

        # arrive to second checkpoint
        new_index = ego_lane_index
        if new_index in self.checkpoints[self._target_checkpoints_index[1]:]:
            idx = self.checkpoints.index(new_index, self._target_checkpoints_index[1])
            self._target_checkpoints_index = [idx]
            if idx + 1 == len(self.checkpoints):
                self._target_checkpoints_index.append(idx)
            else:
                self._target_checkpoints_index.append(idx + 1)
            return True
        return False

        update the checkpoint, return True if updated else False
        
metadrive/component/navigation_module/edge_network_navigation.py