当前位置: 首页>>代码示例>>Python>>正文


Python tf2_ros.Buffer方法代码示例

本文整理汇总了Python中tf2_ros.Buffer方法的典型用法代码示例。如果您正苦于以下问题:Python tf2_ros.Buffer方法的具体用法?Python tf2_ros.Buffer怎么用?Python tf2_ros.Buffer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tf2_ros的用法示例。


在下文中一共展示了tf2_ros.Buffer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import tf2_ros [as 别名]
# 或者: from tf2_ros import Buffer [as 别名]
def __init__(self):
        self.__tf_buffer = tf2_ros.Buffer()
        self.__debug_stop_event = threading.Event()
        self.__debug_thread = None
        self.__debug_current_ws = None  # only for debugging purposes 
开发者ID:NiryoRobotics,项目名称:niryo_one_ros,代码行数:7,代码来源:transform_handler.py

示例2: _init_tf

# 需要导入模块: import tf2_ros [as 别名]
# 或者: from tf2_ros import Buffer [as 别名]
def _init_tf():
    # Create buffer and listener
    # Something has changed in tf that means this must happen after init_node
    global tfBuffer, listener
    tfBuffer = tf2_ros.Buffer()
    listener = tf2_ros.TransformListener(tfBuffer) 
开发者ID:dougsm,项目名称:mvp_grasp,代码行数:8,代码来源:tf_helpers.py

示例3: __init__

# 需要导入模块: import tf2_ros [as 别名]
# 或者: from tf2_ros import Buffer [as 别名]
def __init__(self, world, task, detect_srv, topic,
                 tf_buffer=None,
                 tf_listener=None,
                 verbose=0,
                 update_rate=10):
        '''
        Create an observer. This will take a world and other information and
        use it to provide updated worlds.

        update_rate: data update rate in hz
        '''
        self.world = world
        self.task = task
        self.detect_srv = detect_srv
        self.detected_objects_topic = topic
        self.msg = None
        if tf_buffer is None:
            self.tf_buffer = tf2.Buffer()
        else:
            self.tf_buffer = tf_buffer
        if tf_listener is None:
            self.tf_listener = tf2.TransformListener(self.tf_buffer)
        else:
            self.tf_listener = tf_listener

        self._detected_objects_sub = rospy.Subscriber(
                self.detected_objects_topic, 
                DetectedObjectList,
                self._detected_objects_cb)
        self.verbose = verbose
        self.update_rate = rospy.Rate(update_rate) 
开发者ID:jhu-lcsr,项目名称:costar_plan,代码行数:33,代码来源:observer.py

示例4: __init__

# 需要导入模块: import tf2_ros [as 别名]
# 或者: from tf2_ros import Buffer [as 别名]
def __init__(self, parent_frame, child_frame, lookup_frequency, bagfile,
                 output_topic, append):
        self.parent_frame = parent_frame
        self.child_frame = child_frame
        self.bagfile = bagfile
        self.tf_buffer = tf2_ros.Buffer()
        self.tf_listener = tf2_ros.TransformListener(self.tf_buffer)
        self.lookup_frequency = lookup_frequency
        self.output_topic = output_topic
        self.append = append 
开发者ID:MichaelGrupp,项目名称:evo,代码行数:12,代码来源:record_tf_as_posestamped_bag.py

示例5: _initialize_ros

# 需要导入模块: import tf2_ros [as 别名]
# 或者: from tf2_ros import Buffer [as 别名]
def _initialize_ros(self, robot_config, tf_buffer, tf_listener):
        if tf_buffer is None:
            self.tf_buffer = tf2.Buffer(rospy.Duration(120))
        else:
            self.tf_buffer = tf_buffer
        if tf_listener is None:
            self.tf_listener = tf2.TransformListener(self.tf_buffer)
        else:
            self.tf_listener = tf_listener

        # http://wiki.ros.org/depth_image_proc
        # http://www.ros.org/reps/rep-0118.html
        # http://wiki.ros.org/rgbd_launch
        # we will be getting 16 bit integer values in millimeters
        self.rgb_topic = "/camera/rgb/image_rect_color"
        # raw means it is in the format provided by the openi drivers, 16 bit int
        self.depth_topic = "/camera/depth_registered/hw_registered/image_rect"

        self._rgb_sub = rospy.Subscriber(self.rgb_topic, Image, self._rgbCb)
        self._bridge = CvBridge()
        self.base_link = "base_link"
        self.rgb_time = None
        self.ee_frame = robot_config['end_link']
        self.labels_topic = '/costar/action_labels'
        self._labels_sub = rospy.Subscriber(
                self.labels_topic,
                String,
                self._labels_Cb)
        self.current_label_topic = '/costar/action_label_current'
        self._current_label_sub = rospy.Subscriber(
                self.current_label_topic,
                String,
                self._current_label_Cb)
        self.info_topic = '/costar/info'
        self._info_sub = rospy.Subscriber(
                self.info_topic,
                String,
                self._info_CB)
        self.info_topic = '/costar/clear_view'
        self._info_sub = rospy.Subscriber(
                self.info_topic,
                String,
                self._clear_view_CB)

        # we sleep for 1 second so that
        # the buffer can collect some transforms
        rospy.sleep(1)
        # make sure we can get the transforms we will need to run
        self.get_latest_transform() 
开发者ID:jhu-lcsr,项目名称:costar_plan,代码行数:51,代码来源:costar_hyper_prediction.py


注:本文中的tf2_ros.Buffer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。