1
$\begingroup$

I just finished installing ROS2 Humble for Windows and am trying to work through the tutorials in the documentation, but I am stuck on the "recording and playing back data" tutorial in the "Beginner: CLI tools" section.

I set up my workspace and successfully started the '/turtlesim' and '/teleop_turtle' nodes using the following two commands:

ros2 run turtlesim turtlesim_node

ros2 run turtlesim turtle_teleop_key

After this I attempted to record the data using the command:

ros2 bag record /turtle1/cmd_vel

which produces the following error:

    Failed to load entry point 'record': DLL load failed while importing _reader: The specified module could not be found.
Traceback (most recent call last):
  File "C:\dev\ros2_humble\Scripts\ros2-script.py", line 33, in <module>
    sys.exit(load_entry_point('ros2cli==0.18.7', 'console_scripts', 'ros2')())
  File "C:\dev\ros2_humble\Lib\site-packages\ros2cli\cli.py", line 50, in main
    add_subparsers_on_demand(
  File "C:\dev\ros2_humble\Lib\site-packages\ros2cli\command\__init__.py", line 250, in add_subparsers_on_demand
    extension.add_arguments(
  File "C:\dev\ros2_humble\Lib\site-packages\ros2bag\command\bag.py", line 26, in add_arguments
    add_subparsers_on_demand(
  File "C:\dev\ros2_humble\Lib\site-packages\ros2cli\command\__init__.py", line 237, in add_subparsers_on_demand
    extension = command_extensions[name]
KeyError: 'record'

Does anyone understand what this error means and what I might be doing wrong/missing?

Thanks in advance!

$\endgroup$

1 Answer 1

1
$\begingroup$

Unfortunately, I cannot comment to get more details, but I think rosbag2 may not be installed in your system.

You can check that by running ros2 pkg prefix rosbag2; if it says Package not found you need to clone the repo, check out the humble branch and build it from sources.

$\endgroup$
1
  • $\begingroup$ running ros2 pkg prefix rosbag2 just prints my ros2 directory, which for me is C:\dev\ros2_humble. I assume this means I do have rosbag2 installed? I did originally install ros2 from binary packages if that helps $\endgroup$ Commented Nov 17, 2023 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.