Skip to content

couldn't connect to display ":0" #742

Open
@crocis

Description

@crocis

I have installed Kalibr in WSL in Windows and when I run the calibration I get the following error message>

Generating result report...
Traceback (most recent call last):
  File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_cameras", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_cameras", line 465, in <module>
    main()
  File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_cameras", line 429, in main
    kcc.generateReport(calibrator, reportFile, showOnScreen=not parsed.dontShowReport, graph=G, removedOutlierCorners=removedOutlierCorners);
  File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_camera_calibration/CameraUtils.py", line 428, in generateReport
    fig = pl.figure(offset)
  File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 539, in figure
    figManager = new_figure_manager(num, figsize=figsize,
  File "/usr/lib/python3/dist-packages/matplotlib/backend_bases.py", line 3259, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/_backend_tk.py", line 950, in new_figure_manager_given_figure
    window = tk.Tk(className="matplotlib")
  File "/usr/lib/python3.8/tkinter/__init__.py", line 2270, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ":0"

I have followed the following instructions to run Kalibr:

FOLDER=MY_FOLDER

xhost +local:root

docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" \
    -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" \
    -v "$FOLDER:/data" kalibr

source devel/setup.bash

rosrun kalibr kalibr_calibrate_cameras    --bag /data/dataset.bag     --target /data/aprilgrid_4x6_border3.yaml     --models pinhole-radtan pinhole-radtan pinhole-radtan pinhole-radtan pinhole-radtan pinhole-radtan pinhole-radtan pinhole-radtan pinhole-radtan pinhole-radtan pinhole-radtan pinhole-radtan     --topics /cam0/image_raw /cam1/image_raw /cam2/image_raw /cam3/image_raw /cam4/image_raw /cam5/image_raw /cam6/image_raw /cam7/image_raw /cam8/image_raw /cam9/image_raw /cam10/image_raw /cam11/image_raw  --dont-show-report 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions