ubuntu18 + ros2 eloquent +python3.6

卸载
sudo systemctl stop ros2-eloquent-* #输入以下命令以停止所有ROS 2 Eloquent相关的进程
sudo apt remove ros-eloquent-* #输入以下命令以卸载ROS 2 Eloquent软件包
ls /etc/ros/
ls /opt/ros/
sudo rm -rf /opt/ros/eloquent#输入以下命令以删除ROS 2 Eloquent的配置文件和日志文件
sudo rm -rf /etc/ros/eloquent
ls /opt/ros/
ls /etc/ros/
ls /etc/profile.d
sudo rm /etc/profile.d/ros.sh #输入以下命令以删除ROS 2 Eloquent的环境变量设置
sudo apt update#更新
sudo apt autoremove#输入以下命令以清理不再需要的依赖项
安装
sudo apt update && sudo apt install curl gnupg2 lsb-release
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo sh -c ‘echo “deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main” > /etc/apt/sources.list.d/ros2-latest.list’
sudo apt update
sudo apt install ros-eloquent-desktop
ls /opt/ros/eloquent/
source /opt/ros/eloquent/setup.bash
echo “source /opt/ros/eloquent/setup.bash” >> ~/.bashrc
source ~/.bashrc
ros2 --help
rosversion

创建虚拟环境
conda create --name ros2_env python=3.6
激活虚拟环境
conda env list
conda activate ros2_env
conda env list
python --version
pip list
更新pip
pip uninstall pip
curl https://bootstrap.pypa.io/pip/3.6/get-pip.py -o get-pip.py
python get-pip.py
pip list
安装必要的pip环境
pip install catkin_pkg empy lark numpy
pip软件的批量安装
#packages.txt 名字随便取
pip3 freeze > packages.txt
#r然后批量安装即可
pip3 install -r packages.txt

推出虚拟环境
conda deactivate

你可能感兴趣的:(ros2)