source /opt/ros/melodic/setup.bash
时间: 2023-08-24 07:06:49 浏览: 201
在创建了ROS的workspace后,需要将workspace中的setup.bash文件写入~/.bashrc 文件中,让其启动。你可以在终端中使用以下命令将source /opt/ros/melodic/setup.bash添加到.bashrc文件中:
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
这样,在每次打开终端时,ROS的环境变量就会被自动设置。 这个命令将会在.bashrc文件的末尾追加这个source命令,以确保ROS环境变量在每次启动终端时都能生效。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [ROS中的setup.bash](https://blog.csdn.net/qq_28087491/article/details/109179151)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [安装ROS中出现bash: /opt/ros/melodic/setup.bash: 没有那个文件或目录或者bash: /opt/ros/kinetic/setup....](https://blog.csdn.net/amumu1595436559/article/details/107659180)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文