ROS2 Basics in 5 days (C++): Unit 3 ROS1 Bridge: - Example 3.1 - X Window System error

There was a crash and I’m not sure what I’m supposed to see in Graphical Tools. I’ve attached a screenshot of what I see when I open Graphical Tools.

Shell 1:
user:~$ . /home/user/.bashrc_bridge
ROS_DISTRO was set to ‘noetic’ before. Please make sure that the environment does not mix paths from different distributions.
ROS_DISTRO was set to ‘foxy’ before. Please make sure that the environment does not mix paths from different distributions.
ROS_DISTRO was set to ‘noetic’ before. Please make sure that the environment does not mix paths from different distributions.
ROS_DISTRO was set to ‘foxy’ before. Please make sure that the environment does not mix paths from different distributions.
user:~$ ros2 run ros1_bridge dynamic_bridge
Created 2 to 1 bridge for service /bb8/camera1/set_camera_info
Created 2 to 1 bridge for service /bb_8/imu/service
Created 2 to 1 bridge for service /gazebo/clear_body_wrenches
Created 2 to 1 bridge for service /gazebo/clear_joint_forces
Created 2 to 1 bridge for service /gazebo/delete_light
Created 2 to 1 bridge for service /gazebo/delete_model
Created 2 to 1 bridge for service /gazebo/get_joint_properties
Created 2 to 1 bridge for service /gazebo/get_light_properties
Created 2 to 1 bridge for service /gazebo/get_link_properties
Created 2 to 1 bridge for service /gazebo/get_link_state
Created 2 to 1 bridge for service /gazebo/get_model_properties
Created 2 to 1 bridge for service /gazebo/get_model_state
Created 2 to 1 bridge for service /gazebo/get_physics_properties
Created 2 to 1 bridge for service /gazebo/get_world_properties
Created 2 to 1 bridge for service /gazebo/pause_physics
Created 2 to 1 bridge for service /gazebo/reset_simulation
Created 2 to 1 bridge for service /gazebo/reset_world
Created 2 to 1 bridge for service /gazebo/set_joint_properties
Created 2 to 1 bridge for service /gazebo/set_link_properties
Created 2 to 1 bridge for service /gazebo/set_link_state
Created 2 to 1 bridge for service /gazebo/set_model_configuration
Created 2 to 1 bridge for service /gazebo/set_model_state
Created 2 to 1 bridge for service /gazebo/set_physics_properties
Created 2 to 1 bridge for service /gazebo/spawn_sdf_model
Created 2 to 1 bridge for service /gazebo/spawn_urdf_model
Created 2 to 1 bridge for service /gazebo/unpause_physics
created 2to1 bridge for topic ‘/rosout’ with ROS 2 type ‘rcl_interfaces/msg/Log’ and ROS 1 type ‘rosgraph_msgs/Log’
[INFO] [1640092442.337866145] [ros_bridge]: Passing message from ROS 2 rcl_interfaces/msg/Log to ROS 1 rosgraph_msgs/Log (showing msg only once per type)
created 1to2 bridge for topic ‘/image’ with ROS 1 type ‘sensor_msgs/Image’ and ROS 2 type ‘sensor_msgs/msg/Image’
[INFO] [1640092443.064508295] [ros_bridge]: Passing message from ROS 1 sensor_msgs/Image to ROS 2 sensor_msgs/msg/Image (showing msg only once per type)
removed 1to2 bridge for topic ‘/image’

Shell2:
user:~$ . /home/user/.bashrc_ros1
user:~$ rosrun image_transport republish raw in:=/bb8/camera1/image_raw out:=/image

Shell3:
user:~$ . /home/user/.bashrc_ros2
ROS_DISTRO was set to ‘foxy’ before. Please make sure that the environment does not mix paths from different distributions.
ROS_DISTRO was set to ‘noetic’ before. Please make sure that the environment does not mix paths from different distributions.
user:~$ ros2 run image_tools showimage

(showimage:1900): dbind-WARNING **: 13:14:02.294: Couldn’t connect to accessibility bus: Failed to connect tosocket /tmp/dbus-barNTtUXXG: Connection refused
[INFO] [1640092442.337228030] [showimage]: Subscribing to topic ‘image’
[INFO] [1640092443.135785523] [showimage]: Received image #camera_link
Received image #camera_link
[INFO] [1640092443.288759173] [showimage]: Received image #camera_link
Received image #camera_link
[INFO] [1640092443.295916046] [showimage]: Received image #camera_link
Received image #camera_link
[INFO] [1640092443.306971467] [showimage]: Received image #camera_link
Received image #camera_link

(showimage:1900): Gdk-ERROR **: 13:14:03.313: The program ‘showimage’ received an X Window System error.
This probably reflects a bug in the program.
The error was ‘BadAccess (attempt to access private resource denied)’.
(Details: serial 240 error_code 10 request_code 130 (MIT-SHM) minor_code 1)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the GDK_SYNCHRONIZE environment
variable to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

Hello @christophomos ,

This is a bug that sometimes happens the first time you launch it. If you run again the command it should work properly.

Oh, ok! But I still don’t get what I should be looking for when launching the graphical tools.

You will see something like this:

Which is the output of the camera topic being bridged from ROS1 to ROS2.