当前位置: 代码迷 >> 综合 >> ubuntu18.04 ros版本管理melodic/dashing
  详细解决方案

ubuntu18.04 ros版本管理melodic/dashing

热度:19   发布时间:2024-02-05 18:09:41.0

ubuntu18.04 ros版本管理melodic/dashing

bashrc内容如下:

source /opt/ros/melodic/setup.bash
#source /opt/ros/dashing/setup.bash
export ROS_DISTRO=melodic
export PKG_CONFIG_PATH=~/opencv-3.4.4/build/installed/lib/pkgconfig
export LD_LIBRARY_PATH=~/opencv-3.4.4/build/installed/lib
export PATH=${PATH}:/opt/ros/melodic/lib
export ROS_HOSTNAME=127.0.0.1
export ROS_IP=127.0.0.1
if [ -f /opt/ros/melodic/setup.bash ]; thensource /opt/ros/melodic/setup.bash
elif [ -f /opt/ros/dashing/setup.bash ]; thensource /opt/ros/dashing/setup.bash
elseecho "No ros distro found!"
fi

需要注意的是melodic需要的python版本为2.7
修改ubuntu默认python版本的方法如下:

update-alternatives --list python
/usr/bin/python2.7
/usr/bin/python3.6

设置优先级 数字越高优先级越大

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 2