第一步 打开bashrc文件:
sudo gedit ~/.bashrc
第二步 在bashrc文件末尾加入以下代码:
1 echo "ros melodic(1) or ros2 dashing(2)?" 2 read edition 3 if [ "$edition" -eq "1" ];then 4 source /opt/ros/melodic/setup.bash 5 else 6 source /opt/ros/dashing/setup.bash 7 fi
https://zhuanlan.zhihu.com/p/145606586
原文:https://www.cnblogs.com/miaorn/p/14057881.html