Rosject 1.1 Wall following - Topic access in Ros2 fails

in the rosject the launch of the rosbridge works either with

run ros1_bridge dynamic_bridge --bridge-all-topics
run ros1_bridge parameter_bridge

in the latter I see only a subset of topics
/clock
/cmd_vel
/odom
/parameter_events
/rosout
/scan
/tf
/tf_static

in both cases the ros2 command fails to echo topic but works for the ros one command.
I guess this is why my ros2 code doesn’t work. Even ros2 topic echo /clock (any other also) shows a long error message which ends with

alueError: Expected the full name of a message, got 'rosgraph_msgs/msg/Clock'

is there an additional config missing ?

Hi @vkuehn ,

Could you please post the complete error message?

Also, did you use ros2 run ros1_bridge ... or just run ros1_bridge ...?
Because you need to use ros2 run ros1_bridge ...

Hi @girishkumar.kannan,

sorry I did start the bridge as given in the notes

source ~/catkin_ws/devel/setup.bash
roslaunch load_params load_params.launch
source /opt/ros/foxy/setup.bash
ros2 run ros1_bridge parameter_bridge

now as I repeat it I see this message during start

[INFO] [1667217078.317129463] [ros_bridge]: create bidirectional bridge for topic cmd_vel
The parameter 'services_1_to_2' either doesn't exist or isn't an array
The parameter 'services_2_to_1' either doesn't exist or isn't an array

I see no additional error message for /scan

when doing this

ros2 topic echo /scan

I see this long message

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", line30, in get_message
    raise ValueError("Expected the full name of a message, got '{}'".format(identifier))
ValueError: Expected the full name of a message, got 'sensor_msgs/msg/LaserScan'

found a solution from another post here

source .bashrc_ros2
ros2 topic list -t

copy the topic and the message and echo it as in here

ros2 topic echo /scan sensor_msgs/msg/LaserScan

did work for me

Hi @vkuehn ,

Thanks for posting the error messages.

Just to make sure you are following the steps correctly, I have the following:

  1. Make sure you have at least 3 web shells running in the ROSDS environment.
  2. On the first shell start your gazebo gui and make sure you do NOT stop it (by pressing ctrl-c).
    source /opt/ros/noetic/setup.bash
    source ~/simulation_ws/devel/setup.bash
    roslaunch realrobotlab main.launch
    
  3. On your second shell start the ros bridge and make sure you do NOT stop it.
    source ~/catkin_ws/devel/setup.bash
    roslaunch load_params load_params.launch
    source /opt/ros/foxy/setup.bash
    ros2 run ros1_bridge parameter_bridge
    
  4. Use the third shell to make your model run or call ros2 functions
    ros2 topic echo /scan
    
    (or)
    
    cd ros2_ws/
    colcon build --packages-select <package_name>
    source install/setup.bash
    

Attaching pictures for reference:



I get these messages also. Have a look in my second screenshot. It is fine, no problem.

Try this and let me know if it works! Wrote this post after you found the solution. I guess this still helps!

Regards,
Girish

1 Like

@girishkumar.kannan
thanks for keeping up and the additional post.
Your help is always greatly appreciated !

1 Like

This topic was automatically closed after 20 hours. New replies are no longer allowed.