ros2 / ros1_bridge

ROS 2 package that provides bidirectional communication between ROS 1 and ROS 2
Apache License 2.0
452 stars 288 forks source link

ValueError: Expected the full name of a message, got 'std_msgs/msg/String' #326

Closed Void12987 closed 3 years ago

Void12987 commented 3 years ago

Bug report

Required Info:

Steps to reproduce issue

  1. In ROS1, launch rosserial_python's serial_node.py.
  2. An Arduino Uno is publishing a string.
  3. ros2 run ros1_bridge dynamic_bridge --bridge-all-topics
  4. ros2 topic echo /test

Expected behavior

to see the message

Actual behavior

nathan@nathan-vm-20-04:~/catkin_ws$ ros2 topic echo /test
Traceback (most recent call last):
  File "/opt/ros/foxy/bin/ros2", line 11, in <module>
    load_entry_point('ros2cli==0.9.9', 'console_scripts', 'ros2')()
  File "/opt/ros/foxy/lib/python3.8/site-packages/ros2cli/cli.py", line 67, in main
    rc = extension.main(parser=parser, args=args)
  File "/opt/ros/foxy/lib/python3.8/site-packages/ros2topic/command/topic.py", line 41, in main
    return extension.main(args=args)
  File "/opt/ros/foxy/lib/python3.8/site-packages/ros2topic/verb/echo.py", line 81, in main
    return main(args)
  File "/opt/ros/foxy/lib/python3.8/site-packages/ros2topic/verb/echo.py", line 95, in main
    message_type = get_msg_class(node, args.topic_name, include_hidden_topics=True)
  File "/opt/ros/foxy/lib/python3.8/site-packages/ros2topic/api/__init__.py", line 88, in get_msg_class
    msg_class = _get_msg_class(node, topic, include_hidden_topics)
  File "/opt/ros/foxy/lib/python3.8/site-packages/ros2topic/api/__init__.py", line 133, in _get_msg_class
    return get_message(message_type)
  File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_runtime_py/utilities.py", line 30, in get_message
    raise ValueError("Expected the full name of a message, got '{}'".format(identifier))
ValueError: Expected the full name of a message, got 'std_msgs/msg/String'

Additional information

rostopic echo /test works. I think this may have something to do with serialization.

Void12987 commented 3 years ago

I figured out the issue was for my ROS2 terminals, I needed to run all .bashrc code related to ROS2 after the code for ROS1. Same for the ROS1 terminal.