示例#1
0
    def lookup_transform_full(self,
                              target_frame,
                              target_time,
                              source_frame,
                              source_time,
                              fixed_frame,
                              timeout=rospy.Duration(0.0)):
        """
        Get the transform from the source frame to the target frame using the advanced API.

        :param target_frame: Name of the frame to transform into.
        :param target_time: The time to transform to. (0 will get the latest) 
        :param source_frame: Name of the input frame.
        :param source_time: The time at which source_frame will be evaluated. (0 will get the latest) 
        :param fixed_frame: Name of the frame to consider constant in time.
        :param timeout: (Optional) Time to wait for the target frame to become available.
        :return: The transform between the frames.
        :rtype: :class:`geometry_msgs.msg.TransformStamped`
        """
        goal = LookupTransformGoal()
        goal.target_frame = target_frame
        goal.source_frame = source_frame
        goal.source_time = source_time
        goal.timeout = timeout
        goal.target_time = target_time
        goal.fixed_frame = fixed_frame
        goal.advanced = True

        return self.__process_goal(goal)
示例#2
0
    def lookup_transform(self, target_frame, source_frame, time, timeout=rospy.Duration(0.0)):
        goal = LookupTransformGoal()
        goal.target_frame = target_frame;
        goal.source_frame = source_frame;
        goal.source_time = time;
        goal.timeout = timeout;
        goal.advanced = False;

        return self.__process_goal(goal)
示例#3
0
    def lookup_transform(self,
                         target_frame,
                         source_frame,
                         time,
                         timeout=rospy.Duration(0.0)):
        goal = LookupTransformGoal()
        goal.target_frame = target_frame
        goal.source_frame = source_frame
        goal.source_time = time
        goal.timeout = timeout
        goal.advanced = False

        return self.__process_goal(goal)
示例#4
0
    def _get_position(self):
        goal = LookupTransformGoal()
        goal.source_frame = self.base_frame
        goal.target_frame = self.map_frame
        self.tf_client.send_goal(goal)
        if not self.tf_client.wait_for_result(rospy.Duration(3)):
            rospy.logerr("TF2 not available")
            return None

        res = self.tf_client.get_result()

        assert isinstance(res, LookupTransformResult)
        if res.error.error != 0:
            rospy.logerr("TF Lookup failed: %s", res.error.error_string)
            return None

        return res.transform.transform.translation
示例#5
0
    def lookup_transform(self, target_frame, source_frame, time, timeout=rospy.Duration(0.0)):
        """
        Get the transform from the source frame to the target frame.

        :param target_frame: Name of the frame to transform into.
        :param source_frame: Name of the input frame.
        :param time: The time at which to get the transform. (0 will get the latest) 
        :param timeout: (Optional) Time to wait for the target frame to become available.
        :return: The transform between the frames.
        :rtype: :class:`geometry_msgs.msg.TransformStamped`
        """
        goal = LookupTransformGoal()
        goal.target_frame = target_frame;
        goal.source_frame = source_frame;
        goal.source_time = time;
        goal.timeout = timeout;
        goal.advanced = False;

        return self.__process_goal(goal)
示例#6
0
    def lookup_transform(self,
                         target_frame,
                         source_frame,
                         time,
                         timeout=rospy.Duration(0.0)):
        """
        Get the transform from the source frame to the target frame.

        :param target_frame: Name of the frame to transform into.
        :param source_frame: Name of the input frame.
        :param time: The time at which to get the transform. (0 will get the latest) 
        :param timeout: (Optional) Time to wait for the target frame to become available.
        :return: The transform between the frames.
        :rtype: :class:`geometry_msgs.msg.TransformStamped`
        """
        goal = LookupTransformGoal()
        goal.target_frame = target_frame
        goal.source_frame = source_frame
        goal.source_time = time
        goal.timeout = timeout
        goal.advanced = False

        return self.__process_goal(goal)
示例#7
0
    def lookup_transform_full(self, target_frame, target_time, source_frame, source_time, fixed_frame, timeout=rospy.Duration(0.0)):
        """
        Get the transform from the source frame to the target frame using the advanced API.

        :param target_frame: Name of the frame to transform into.
        :param target_time: The time to transform to. (0 will get the latest) 
        :param source_frame: Name of the input frame.
        :param source_time: The time at which source_frame will be evaluated. (0 will get the latest) 
        :param fixed_frame: Name of the frame to consider constant in time.
        :param timeout: (Optional) Time to wait for the target frame to become available.
        :return: The transform between the frames.
        :rtype: :class:`geometry_msgs.msg.TransformStamped`
        """
        goal = LookupTransformGoal()
        goal.target_frame = target_frame;
        goal.source_frame = source_frame;
        goal.source_time = source_time;
        goal.timeout = timeout;
        goal.target_time = target_time;
        goal.fixed_frame = fixed_frame;
        goal.advanced = True;

        return self.__process_goal(goal)