修改ROS默认编辑器为sublime text3

本文介绍如何将默认的文本编辑器从gedit更改为Sublime Text,并提供了具体的步骤,包括修改defaults.list文件以及将gedit.desktop替换为sublime_text.desktop。

roscd beginner_tutorials

export EDITOR= ”

echo $EDITOR

修改defaults.list

编辑/etc/gnome/default.list文件,将其中的所有gedit.desktop替换为sublime_text.desktop。

sublime_text.desktop在/opt/sublime_text目录下,使用ls -al sublime命令查看具体文件名。

root@ubuntu:/home/sunrise/Desktop/ydlidar_ws# ros2 launch ydlidar_ros2_driver qc.py [INFO] [launch]: All log files can be found below /root/.ros/log/2025-07-22-18-34-39-945635-ubuntu-46942 [INFO] [launch]: Default logging verbosity is set to INFO Task exception was never retrieved future: <Task finished name=&#39;Task-2&#39; coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=InvalidLaunchFileError(&#39;py&#39;)> Traceback (most recent call last): File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 53, in get_launch_description_from_any_launch_file return loader(launch_file_path) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 62, in get_launch_description_from_python_launch_file launch_file_module = load_python_launch_file_as_module(python_launch_file_path) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 37, in load_python_launch_file_as_module loader.exec_module(mod) File "<frozen importlib._bootstrap_external>", line 844, in exec_module File "<frozen importlib._bootstrap_external>", line 981, in get_code File "<frozen importlib._bootstrap_external>", line 911, in source_to_code File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/sunrise/Desktop/ydlidar_ws/install/ydlidar_ros2_driver/share/ydlidar_ros2_driver/launch/qc.py", line 19 SyntaxError: (unicode error) &#39;utf-8&#39; codec can&#39;t decode byte 0xbc in position 0: invalid start byte The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event await self.__process_event(next_event) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event visit_all_entities_and_collect_futures(entity, self.__context)) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures sub_entities = entity.visit(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit return self.execute(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/include_launch_description.py", line 130, in execute launch_description = self.__launch_description_source.get_launch_description(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_source.py", line 84, in get_launch_description self._get_launch_description(self.__expanded_location) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_description_source.py", line 53, in _get_launch_description return get_launch_description_from_any_launch_file(location) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 56, in get_launch_description_from_any_launch_file raise InvalidLaunchFileError(extension, likely_errors=exceptions) launch.invalid_launch_file_error.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: (unicode error) &#39;utf-8&#39; codec can&#39;t decode byte 0xbc in position 0: invalid start byte (qc.py, line 19)
07-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值