Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current message_filters do not reflect tutorial #2272

Open
ghost opened this issue May 17, 2021 · 3 comments
Open

Current message_filters do not reflect tutorial #2272

ghost opened this issue May 17, 2021 · 3 comments
Labels
backlog enhancement New feature or request

Comments

@ghost
Copy link

ghost commented May 17, 2021

I'm new to ROS and ROS2, so I follow the tutorial and find some disturbing problem of inconsistence between 2 version.
I want to leave this message because this problem take me 3 hours to solve.
ROS tutorial

import message_filters
from sensor_msgs.msg import Image, CameraInfo

def callback(image, camera_info):
  # Solve all of perception here...

image_sub = message_filters.Subscriber('image', Image)
info_sub = message_filters.Subscriber('camera_info', CameraInfo)

ts = message_filters.TimeSynchronizer([image_sub, info_sub], 10)
ts.registerCallback(callback)
rospy.spin()

This indicate message_filters.Subscriber(topic, data_type)

but in ROS2 is

    def __init__(self, *args, **kwargs):
        SimpleFilter.__init__(self)
        self.node = args[0]
        self.topic = args[2]
        kwargs.setdefault('qos_profile', 10)
        self.sub = self.node.create_subscription(*args[1:], self.callback, **kwargs)

Which is message_filters.Subscriber(node, ???, topic)

Should we make it more consistent?

@clalancette
Copy link
Contributor

Can you please give a pointer to which tutorial you were following?

@clalancette clalancette added the more-information-needed Further information is required label Jun 3, 2021
@Hi-Zed
Copy link

Hi-Zed commented Nov 3, 2021

I guess he is referencing this page:
http://wiki.ros.org/message_filters

I am also having some issues with using message filters on Python. I can't find an up to date example for ROS2

@clalancette clalancette changed the title Current message_filters do not reflex tutorial Current message_filters do not reflect tutorial Feb 3, 2022
@clalancette clalancette removed the more-information-needed Further information is required label Feb 3, 2022
@clalancette
Copy link
Contributor

OK, the message filters tutorial in ROS 1 isn't going to work as-is for ROS 2. As such, this is essentially a request for a new tutorial for ROS 2, which is very reasonable.

I'll go ahead and move this over to the ros2_documentation repository, which is where we track those things.

@clalancette clalancette transferred this issue from ros2/message_filters Feb 3, 2022
@clalancette clalancette added the enhancement New feature or request label Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants