def sample(self, size=1):
        """ Sample rigid transform random variables.

        Parameters
        ----------
        size : int
            number of sample to take
        
        Returns
        -------
        :obj:`list` of :obj:`RigidTransform`
            sampled rigid transformations
        """
        samples = []
        for i in range(size):
            # sample random pose
            xi = self._r_xi_rv.rvs(size=1)
            S_xi = skew(xi)
            R_sample = scipy.linalg.expm(S_xi)
            t_sample = self._t_rv.rvs(size=1)
            samples.append(RigidTransform(rotation=R_sample,
                                          translation=t_sample,
                                          from_frame=self._from_frame,
                                          to_frame=self._to_frame))

        # not a list if only 1 sample
        if size == 1 and len(samples) > 0:
            return samples[0]
        return samples
Sample rigid transform random variables.

        Parameters
        ----------
        size : int
            number of sample to take
        
        Returns
        -------
        :obj:`list` of :obj:`RigidTransform`
            sampled rigid transformations