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

Small issue with argument in example code for TF Broadcaster #19

Open
ArneF-oss opened this issue Jan 19, 2023 · 0 comments
Open

Small issue with argument in example code for TF Broadcaster #19

ArneF-oss opened this issue Jan 19, 2023 · 0 comments

Comments

@ArneF-oss
Copy link

At ros2_i_training/workshop/source/_source/navigation/ROS2-TF2.md

At the chapter 1. Dynamic TF Broadcaster example

...
def main(argv=sys.argv[1]):
    rclpy.init(args=argv)
    node = DynamicBroadcaster(sys.argv[1])
...

gives me an error:
TypeError: init(): incompatible constructor arguments. The following argument types are supported:
1. rclpy._rclpy_pybind11.Context(arg0: list, arg1: int)
due to the second line: rclpy.init(args=argv)

So I deleted the [1] (first line) at def main and the sys. ( third line) at the node definition

...
def main(argv=sys.argv):
    rclpy.init(args=argv)
    node = DynamicBroadcaster(argv[1])
...

and it works fine for me. But I'm not sure if it is as intended. So maybe someone could double check it.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant