  Using BRST-BV formulation of relativistic dynamics, arbitrary spin massless
and massive field propagating in flat space and arbitrary spin massless fields
propagating in AdS space are considered. For such fields, BRST-BV Lagrangians
invariant under gauge transformations are obtained. The Lagrangians and gauge
transformations are built in terms of traceless gauge fields and traceless
gauge transformation parameters. The use of the Poincare parametrization of AdS
space allows us to get simple BRST-BV Lagrangian for AdS fields. By imposing
the Siegel gauge condition, we get gauge-fixed Lagrangian which leads to
decoupled equations of motion for AdS fields. Such equations of motion
considerably simplify the study of AdS/CFT correspondence. In the basis of
conformal algebra, realization of relativistic symmetries on space of fields
and antifields entering the BRST-BV formulation of AdS fields is obtained.
