HybridRobotics / cbf

An open source repository for control, planning and navigation about control barrier functions.
Apache License 2.0
141 stars 26 forks source link

Environment configuration issue #28

Closed Highlight123 closed 1 year ago

Highlight123 commented 1 year ago

Dear Dr. Zeng, I have some code problems. Very disturbing! Thank you very much! I run this project in ubuntu18.04 and install required packages in python3.7. Is the following error caused by matplotlib's version?

The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. Traceback (most recent call last): File "/home/highlight/cbf/models/kinematic_car_test.py", line 344, in kinematic_car_all_shapes_simulation_test(maze_type, robot_shape) File "/home/highlight/cbf/models/kinematic_car_test.py", line 257, in kinematic_car_all_shapes_simulation_test plot_world(sim, robot_indexes, figure_name=name, local_traj_indexes=traj_indexes, maze_type=maze_type) File "/home/highlight/cbf/models/kinematic_car_test.py", line 83, in plot_world plt.savefig("figures/" + figure_name + ".eps", format="eps", dpi=500, pad_inches=0) File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/pyplot.py", line 977, in savefig res = fig.savefig(*args, kwargs) File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/figure.py", line 3058, in savefig self.canvas.print_figure(fname, kwargs) File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 2325, in print_figure kwargs) File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/_api/deprecation.py", line 415, in wrapper return func(inner_args, inner_kwargs) File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/backends/backend_ps.py", line 847, in print_eps return self._print_ps(outfile, 'eps', kwargs) File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/_api/deprecation.py", line 389, in wrapper return func(inner_args, inner_kwargs) File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/backends/backend_ps.py", line 889, in _print_ps orientation=orientation, papertype=papertype, *kwargs) File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 1648, in wrapper return func(args, **kwargs) File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/backends/backend_ps.py", line 1024, in _print_figure with cbook.open_file_cm(outfile, "w", encoding="latin-1") as file: File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/cbook/init.py", line 465, in open_file_cm fh, opened = to_filehandle(path_or_file, mode, True, encoding) File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/cbook/init.py", line 451, in to_filehandle fh = open(fname, flag, encoding=encoding) FileNotFoundError: [Errno 2] No such file or directory: 'figures/triangle_maze.eps'

junzengx14 commented 1 year ago

Hi @AkshayThiru, would you mind having some quick check on it when you are available?

AkshayThiru commented 1 year ago

Hi @Highlight123, can you let us know if you are running the code from the root directory or the repo directory? I think that if you run it from the repo directory you will not have any errors.

Highlight123 commented 1 year ago

Thank you for help! Working directory has been set to the repo directory(/home/highlight/cbf). I can achieve triangle_maze.eps and triangle_maze.png. But still come across error:

Traceback (most recent call last): File "/home/highlight/cbf/models/kinematic_car_test.py", line 344, in kinematic_car_all_shapes_simulation_test(maze_type, robot_shape) File "/home/highlight/cbf/models/kinematic_car_test.py", line 258, in kinematic_car_all_shapes_simulation_test animate_world(sim, animation_name=name, maze_type=maze_type) File "/home/highlight/cbf/models/kinematic_car_test.py", line 137, in animate_world anim.save("animations/" + animation_name + ".mp4", dpi=300, writer=animation.writers"ffmpeg") File "/home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/animation.py", line 151, in getitem raise RuntimeError(f"Requested MovieWriter ({name}) not available") RuntimeError: Requested MovieWriter (ffmpeg) not available /home/highlight/anaconda3/envs/cbf/lib/python3.7/site-packages/matplotlib/animation.py:888: UserWarning: Animation was deleted without rendering anything. This is most likely not intended. To prevent deletion, assign the Animation to a variable, e.g. anim, that exists until you have outputted the Animation using plt.show() or anim.save(). 'Animation was deleted without rendering anything. This is '

Highlight123 commented 1 year ago

Thank you for help! I run again in the repo directory(/home/highlight/cbf) on another computer and the errors is resolved. I have no problem and this issue can be closed!