Suppose we a 1DoF planar robot with only 1 prismatic joint (for the sake of the example). The prismatic joint can extend the link or shrink the link. Suppose the length of link 1 is a, and suppose the center of mass is in the middle of the link. Let d be the ony generalized variable. My doubt is: the center of mass is (a/2)+d or (a+d)/2 (w.r.t. the frame placed in the joint) ?
You have rigid parts that can move independently (subject to the degree-of-freedom constraint). Each part has its own center of mass. The overall CoM is the mean of the part CoM's, expressed in a common Cartesian coordinate system, weighted (pun unavoidable) by their respective mass fraction.
That should be general enough to compute the overall CoM for any number of parts with any number of generalized coords.