How to calculate the minimum distance of a group's centroid to a protein?

GROMACS version: 2018.8
GROMACS modification: No
I want to calculate the minimum distance of a group’s centroid to a protein, I don’t know how to definite the centorid of the group in the .ndx file. Would you like to tell me how to calculate the minimum distance of a group’s centorid to a protein?
Thank you for your interest and response.

Kind Regards
Lili

gmx distance -s aaa.tpr -f aaa.gro -n index.ndx -select ‘com of group “Chain_A” plus com of group “Chain_B”’ -oall dist.xvg

define atomselection of your two groups in index file