Concept:
For the inverse sine function,
\[
\sin^{-1}(u)
\]
is defined only when
\[
-1\le u\le 1.
\]
Since a square root is always non-negative,
\[
0\le \sqrt{x^2-4x+5}\le1.
\]
We first determine the admissible values of \(x\).
Step 1: Simplify the expression inside the square root.
\[
x^2-4x+5
\]
can be written as
\[
(x-2)^2+1.
\]
Thus,
\[
f(x)=\sin^{-1}\left(\sqrt{(x-2)^2+1}\right).
\]
Step 2: Apply the condition for inverse sine.
For \(\sin^{-1}\) to exist,
\[
0\le \sqrt{(x-2)^2+1}\le1.
\]
Squaring throughout,
\[
(x-2)^2+1\le1.
\]
Hence
\[
(x-2)^2=0.
\]
Therefore,
\[
x=2.
\]
Thus
\[
A=\{2\}.
\]
Step 3: Find the range.
Substituting \(x=2\),
\[
f(2)=\sin^{-1}(1).
\]
Therefore,
\[
f(2)=\frac{\pi}{2}.
\]
Hence
\[
B=\left\{\frac{\pi}{2}\right\}.
\]
Step 4: Find \(A\cup B\).
Therefore,
\[
A\cup B=
\left\{2,\frac{\pi}{2}\right\}.
\]
Hence,
\[
\boxed{A\cup B=
\left\{2,\frac{\pi}{2}\right\}}
\]
and the correct option is
\[
\boxed{(D)}.
\]