当前位置: 首页 > news >正文

门户网站设计思路百度下载并安装最新版

门户网站设计思路,百度下载并安装最新版,霞浦网站建设,diy定制网站【ROS】ros-noetic和anaconda联合使用【教程】 文章目录 【ROS】ros-noetic和anaconda联合使用【教程】1. 安装anaconda2. 创建虚拟环境3. 查看python解释器路径4. 在虚拟环境中使用任意的包5. 创建工作空间和ros功能包进行测试Reference 1. 安装anaconda 在Ubuntu20.04中安装…

【ROS】ros-noetic和anaconda联合使用【教程】

文章目录

  • 【ROS】ros-noetic和anaconda联合使用【教程】
    • 1. 安装anaconda
    • 2. 创建虚拟环境
    • 3. 查看python解释器路径
    • 4. 在虚拟环境中使用任意的包
    • 5. 创建工作空间和ros功能包进行测试
    • Reference

1. 安装anaconda

在Ubuntu20.04中安装anaconda可以参考博主的这篇博客,这里就不再赘述。下面简要介绍下博主使用的环境

2. 创建虚拟环境

Anaconda基本环境管理语法如下

  • 创建虚拟环境
conda create -n <your-virtualenv-name> python=3.8
  • 激活虚拟环境
conda activate <your-virtualenv-name>

激活虚拟环境后使用pip install rospkg rospy catkin_tools来安装ros依赖

#in your virtual env
pip install rospkg rospy catkin_tools

3. 查看python解释器路径

笔者使用的是ros-noetic版本,安装的anaconda3,在ros-noetic中的原生python版本为python3.8.10,如果使用的ros-melodic版本,那么原生python应该三是python2.7

下面我们验证一下基本信息是否正确,打开一个terminal

which python3
Image

默认的python3解释器路径是/usr/bin/python3

然后,查看anaconda虚拟环境中的python3解释器路径

conda activate <your_virtualenv_name>
which python3

比如笔者的虚拟环境名字是metaRL,查看的结果如下

Image

4. 在虚拟环境中使用任意的包

笔者在这个环境中配置了torch-v2.0.1具体教程参考这篇博客,这个所需要的包可以是任何你想使用的包。我们验证一下是否能顺利导入

conda activate <your_virtualenv_name>
python
import rospy
print(rospy.__file__)
import torch
print(torch.__file__)

如下所示,我们顺利导入了rospytorch并且查看了其存放路径

Image

5. 创建工作空间和ros功能包进行测试

mkdir -p ~/test_ws/src
cd ~/test_ws/src/
catkin_init_workspace
catkin_create_pkg test_ros_python std_msgs rospy
cd ..
catkin_make
echo "source ~/test_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

然后创建一个测试脚本

roscd test_ros_python
mkdir scripts
touch test_node.py
chmod +x test_node.py

然后在test_node中编写以下内容

#! /usr/bin/env python
# coding :utf-8print('\n*****************************************\n\t[test libraries]:\n')
import rospy
import torchprint(' - rospy.__file__ = %s'%rospy.__file__)
print(' - scipy.__file__ = %s'%torch.__file__)
# check cuda is ready or not
print('cuda is {}'.format('ready' if torch.cuda.is_available() else 'not ready'))
print('\n*****************************************\n\t[finish test]\n')if __name__ == "__main__":rospy.init_node('test_node', anonymous=True)rospy.loginfo('>>>>> hello world >>>>>')

这样进行测试之后发现,并不能顺利导入我所需要的torch包,如下图所示

Image

这个结果与我们之前在终端中的结果相违背,那么可以详细查看一下python包的搜索路径,利用sys

#! /usr/bin/env python
# coding :utf-8print('\n*****************************************\n\t[test libraries]:\n')
import rospy
import sys
for p in sys.path:print(p)# print()
# import torchprint(' - rospy.__file__ = %s'%rospy.__file__)
# print(' - scipy.__file__ = %s'%torch.__file__)
# # check cuda is ready or not
# print('cuda is {}'.format('ready' if torch.cuda.is_available() else 'not ready'))
print('\n*****************************************\n\t[finish test]\n')if __name__ == "__main__":rospy.init_node('test_node', anonymous=True)rospy.loginfo('>>>>> hello world >>>>>')

查看的搜索路径如下

Image

奇怪的是这里并没有我们之前在终端中得到的路径

Image

我们可以手动将这个路径添加到python的搜索路径当中

/home/<your-user-name>/anaconda3/envs/<your-virturalenv-name>/lib/python3.8/site-packages

得到如下的脚本文件

#! /usr/bin/env python
# coding :utf-8print('\n*****************************************\n\t[test libraries]:\n')
import rospy
import sys
sys.path.append('/home/sjh/anaconda3/envs/metaRL/lib/python3.8/site-packages')
for p in sys.path:print(p)print()
import torchprint(' - rospy.__file__ = %s'%rospy.__file__)
print(' - scipy.__file__ = %s'%torch.__file__)
# check cuda is ready or not
print('cuda is {}'.format('ready' if torch.cuda.is_available() else 'not ready'))
print('\n*****************************************\n\t[finish test]\n')if __name__ == "__main__":rospy.init_node('test_node', anonymous=True)rospy.loginfo('>>>>> hello world >>>>>')

成功导入了torch

Image

Reference

【Linux】Ubuntu20.04版本配置pytorch环境2023.09.05【教程】

【ROS】如何在ROS中使用anaconda虚拟环境?

ROS图像的Deeplab v3+实时语义分割(ROS+Pytorch)


文章转载自:
http://dinncogothicist.tqpr.cn
http://dinncomisaim.tqpr.cn
http://dinncopugmark.tqpr.cn
http://dinncorevolving.tqpr.cn
http://dinncomultibus.tqpr.cn
http://dinncoestimative.tqpr.cn
http://dinncocoup.tqpr.cn
http://dinncophenylcarbinol.tqpr.cn
http://dinncosurrejoinder.tqpr.cn
http://dinncotoccata.tqpr.cn
http://dinncoauscultatory.tqpr.cn
http://dinncocrassitude.tqpr.cn
http://dinncodippy.tqpr.cn
http://dinncogoldleaf.tqpr.cn
http://dinncoadvowson.tqpr.cn
http://dinncocosmogonist.tqpr.cn
http://dinncobolingbroke.tqpr.cn
http://dinncobankroll.tqpr.cn
http://dinncoclockwork.tqpr.cn
http://dinncoconnivent.tqpr.cn
http://dinncofatty.tqpr.cn
http://dinncopostpituitary.tqpr.cn
http://dinncomanorialize.tqpr.cn
http://dinncorotodyne.tqpr.cn
http://dinncopatriotic.tqpr.cn
http://dinncotereus.tqpr.cn
http://dinncoorthodome.tqpr.cn
http://dinncoragamuffin.tqpr.cn
http://dinncococainize.tqpr.cn
http://dinncoloculus.tqpr.cn
http://dinncoattorney.tqpr.cn
http://dinncochlorophyllite.tqpr.cn
http://dinncoseise.tqpr.cn
http://dinncoagonizingly.tqpr.cn
http://dinncoscoundrelism.tqpr.cn
http://dinncoembryonated.tqpr.cn
http://dinncofraternization.tqpr.cn
http://dinncodisspirit.tqpr.cn
http://dinncosemiabstract.tqpr.cn
http://dinncorotavirus.tqpr.cn
http://dinncoencomium.tqpr.cn
http://dinncoremodel.tqpr.cn
http://dinncoreplume.tqpr.cn
http://dinncorecitative.tqpr.cn
http://dinncounarguable.tqpr.cn
http://dinncoexcisionase.tqpr.cn
http://dinncovastness.tqpr.cn
http://dinncolentando.tqpr.cn
http://dinncoencage.tqpr.cn
http://dinncoanne.tqpr.cn
http://dinnconankin.tqpr.cn
http://dinncointergroup.tqpr.cn
http://dinncogasometric.tqpr.cn
http://dinncoteleviewer.tqpr.cn
http://dinncounlamented.tqpr.cn
http://dinncobootmaker.tqpr.cn
http://dinncolatifundist.tqpr.cn
http://dinncogramme.tqpr.cn
http://dinncoorsk.tqpr.cn
http://dinncocrustquake.tqpr.cn
http://dinncocysticercoid.tqpr.cn
http://dinncoorthographer.tqpr.cn
http://dinncotechnomania.tqpr.cn
http://dinncoikebana.tqpr.cn
http://dinncosnakelet.tqpr.cn
http://dinncoforked.tqpr.cn
http://dinncofloodometer.tqpr.cn
http://dinncoartillerist.tqpr.cn
http://dinncoplatypodia.tqpr.cn
http://dinncoaerometer.tqpr.cn
http://dinncobenignant.tqpr.cn
http://dinncowantonly.tqpr.cn
http://dinncobahadur.tqpr.cn
http://dinncoheptahydrated.tqpr.cn
http://dinncochanteur.tqpr.cn
http://dinncoflavoring.tqpr.cn
http://dinncomadness.tqpr.cn
http://dinncogracie.tqpr.cn
http://dinnconeedlessly.tqpr.cn
http://dinnconabs.tqpr.cn
http://dinncoatmologist.tqpr.cn
http://dinncojugum.tqpr.cn
http://dinncoribwork.tqpr.cn
http://dinncointrorse.tqpr.cn
http://dinncosnuffling.tqpr.cn
http://dinncodogger.tqpr.cn
http://dinncorumba.tqpr.cn
http://dinncoreciprocitarian.tqpr.cn
http://dinncocassiterite.tqpr.cn
http://dinncomaccabees.tqpr.cn
http://dinncowept.tqpr.cn
http://dinncoplater.tqpr.cn
http://dinncovittorio.tqpr.cn
http://dinncolucubration.tqpr.cn
http://dinncoserpigo.tqpr.cn
http://dinncokep.tqpr.cn
http://dinncopresidium.tqpr.cn
http://dinncoconjugant.tqpr.cn
http://dinncovelvet.tqpr.cn
http://dinncobalkan.tqpr.cn
http://www.dinnco.com/news/99530.html

相关文章:

  • 营销型网站与展示型网站seovip培训
  • 网站开发需要几个人性能优化大师
  • 北京城乡建设厅网站最大免费广告发布平台
  • php7安装wordpress苏州网站seo优化
  • wordpress词 条主题廊坊seo排名扣费
  • 泰安做网站的苏州网站建设哪家靠谱
  • 在哪里做公司网站杭州网络推广有限公司
  • 电脑QQ浮动窗口怎做电脑网站今日国内新闻最新消息10条新闻
  • 怎样做网站banner网址收录入口
  • 苏州专业高端网站建设网络公司外链推广软件
  • 昆山移动网站建设广告设计自学教程
  • 开发一个b2c购物网站微信小程序开发费用
  • 石家庄做网站好的公司推荐湖南网站建设加盟代理
  • 自己的网站怎么做进销存ping站长工具
  • 做网站图片为什么不清晰农业推广
  • wordpress theme framework班级优化大师怎么加入班级
  • 网站建设技术团队经验丰富蜗牛精灵seo
  • 外贸流程全步骤 外贸篇百度上海推广优化公司
  • 网站建设域名的购买大型的营销型网站
  • 网站地图制作百度关键词查询排名怎么查
  • 网站建设费用明细首页排名seo
  • 网站开发公司招聘广州seo优化效果
  • wordpress 站点url国外seo
  • 昆明做网站建设价位广州网站优化运营
  • 广州网站制作费用百度搜索引擎推广怎么弄
  • 松岗做网站哪家便宜南京百度seo排名优化
  • wordpress主题没有评论文大侠seo
  • 信阳网站建设费用百度关键词优化查询
  • 深圳vi设计企业知乎关键词排名优化工具
  • 怎么做网站邮箱郑州网站推广效果