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

Create (dynamic) Transform Broadcaster #666

Open
tonynajjar opened this issue Apr 2, 2024 · 2 comments
Open

Create (dynamic) Transform Broadcaster #666

tonynajjar opened this issue Apr 2, 2024 · 2 comments
Labels
more-information-needed Further information is required

Comments

@tonynajjar
Copy link
Contributor

tonynajjar commented Apr 2, 2024

Feature request

Feature description

Similarly to static_transform_publisher, it would be useful to have a transform_publisher that publishes to /tf on a timer (configurable rate). One use case of this would be to publish map -> odom artificially (e.g. if a global localizer is missing).
I've seen the static_transform_publisher being used for this but for me it hasn't worked out for reasons I don't know yet, but regardless, map -> odom should theoretically be on /tf as it's not static

Implementation considerations

@clalancette
Copy link
Contributor

Maybe I'm misunderstanding what you want here, but wouldn't this be as easy as:

auto tb = TransformBroadcaster();
auto callback = [&tb]() -> void
{
  geometry_msgs::msg::TransformStamped ts;
  tb->sendTransform(ts);
};
auto timer = node->create_wall_timer(1s, callback);

That is, I'm not entirely convinced we need to have core functionality for this; it is easy enough for users to do right now.

@clalancette clalancette added the more-information-needed Further information is required label Apr 3, 2024
@tonynajjar
Copy link
Contributor Author

tonynajjar commented Apr 3, 2024

Sorry I wasn't super clear, basically I'm asking for a similar functionality to:

    node_static_map_to_odom = Node(
        package="tf2_ros",
        executable="static_transform_publisher",
        arguments=["0", "0", "0", "0", "0", "0", "map", "odom"],
    )

Something like:

    node_map_to_odom = Node(
        package="tf2_ros",
        executable="transform_publisher",
        parameters=[{"timer_period": 1.0,}], # debatable if parameter or argument
        arguments=["0", "0", "0", "0", "0", "0", "map", "odom"],
    )

but wouldn't this be as easy as

Yes you're right it wouldn't be so hard for the user to create but why not standardize it and avoid this work for ROS users. static_transform_publisher, tf2_echo, etc... are simple scripts but extremely useful. Besides, it's not as simple as that, considering the argument parsing, like is done in static_transform_broadcaster_program.cpp

I hope it's clearer what this issue is about?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed Further information is required
Projects
None yet
Development

No branches or pull requests

2 participants