  In this paper, we propose a novel framework that aims to jointly design the
reflection coefficients of multiple RISs and the precoding strategy of a single
BS to optimize the self-tracking of the position and the velocity of a single
multi-antenna UE that moves either in the far- or near-field region.
Differently from the literature, and to keep the overall complexity affordable,
we assume that RIS optimization is performed less frequently than localization
and precoding adaptation. The proposed procedure leads to minimize the inverse
of the received power in the UE position uncertainty area between two
subsequent optimization steps.
  The optimal RIS and precoder strategy are compared with the classical
beam-focusing strategy and with a scheme that maximizes the communication rate.
It is shown that if the RISs are optimized for communications, their
configuration is suboptimal when used for tracking purposes.
  Numerical results show that in typical indoor environments with only one BS
and a few RISs operating on millimeter waves, high location accuracy in the
range of less than half a meter can be achieved.
