def encode(self, rosMsg):
        """ Transform the rospy.rostime.Duration instance to a float.
        """
        try:
            return (rosMsg.to_sec(), {})
        except __HOLE__:
            raise TypeError('Received object is not a Duration instance.')
dataset/ETHPy150Open rapyuta/rce/rce-core/rce/util/converter.py/_DurationConverter.encode