robotarium / robotarium_python_simulator

A Python simulator for the Robotarium! See your algorithm run on real robots!
MIT License
111 stars 59 forks source link

Error with the robotarium output #16

Open Sridhar701Pitt opened 2 years ago

Sridhar701Pitt commented 2 years ago

Running example python scripts (leader_follower_with_plotting.py) on the real robotarium returns the following error:

No protocol specified
No protocol specified
Traceback (most recent call last):
  File "main.py", line 53, in <module>
    r = robotarium.Robotarium(number_of_robots=N, show_figure=True, initial_conditions=initial_conditions, sim_in_real_time=True)
  File "/usr/local/lib/python3.6/dist-packages/rps/robotarium.py", line 24, in __init__
    super().__init__(number_of_robots, show_figure, False, initial_conditions)
  File "/usr/local/lib/python3.6/dist-packages/rps/robotarium_abc.py", line 71, in __init__
    self.figure, self.axes = plt.subplots()
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/cbook/deprecation.py", line 451, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/pyplot.py", line 1287, in subplots
    fig = figure(**fig_kw)
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/pyplot.py", line 693, in figure
    **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/pyplot.py", line 315, in new_figure_manager
    return _backend_mod.new_figure_manager(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/backend_bases.py", line 3494, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/backends/_backend_tk.py", line 885, in new_figure_manager_given_figure
    window = tk.Tk(className="matplotlib")
  File "/usr/lib/python3.6/tkinter/__init__.py", line 2023, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ":1"