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

做psd模板下载网站北京seo编辑

做psd模板下载网站,北京seo编辑,大连海外网站建设,太原网站制作企业ROS使用VScode创建项目步骤 1.创建ROS工作空间2.启动VScode3.VScode编译ROS4.创建ROS功能包C语言开发Python语言开发 本文章介绍了如何在Ubuntu18.04系统下搭建VScode 的ROS项目 搭建项目分为一下几个步骤: 1.创建ROS工作空间 创建一个demo的ROS工作空间&#xff0…

ROS使用VScode创建项目步骤

  • 1.创建ROS工作空间
  • 2.启动VScode
  • 3.VScode编译ROS
  • 4.创建ROS功能包
  • C++语言开发
  • Python语言开发

本文章介绍了如何在Ubuntu18.04系统下搭建VScode 的ROS项目
搭建项目分为一下几个步骤:

1.创建ROS工作空间

创建一个demo的ROS工作空间,并进行编译,此时home路径下会生成一个demo的工作空间,demo文件下的结构如图所示

mkdir -p demo/src  # (必须得有 src)
cd demo
catkin_make

在这里插入图片描述

2.启动VScode

进入到demo路径下,启动VScode

cd demo
code .

3.VScode编译ROS

使用快捷键 ctrl + shift + B 调用编译,选择:catkin_make:build点击设置进行编译配置,会生成一个.vscode/tasks.json 文件,修改.vscode/tasks.json 文件的内容,将tasks.json的内容换为如下内容
在这里插入图片描述
tasks.json文件内容

{// 有关 tasks.json 格式的文档,请参见// https://go.microsoft.com/fwlink/?LinkId=733558"version": "2.0.0","tasks": [{"label": "catkin_make:debug", //代表提示的描述性信息"type": "shell",  //可以选择shell或者process,如果是shell代码是在shell里面运行一个命令,如果是process代表作为一个进程来运行"command": "catkin_make",//这个是我们需要运行的命令"args": [],//如果需要在命令后面加一些后缀,可以写在这里,比如-DCATKIN_WHITELIST_PACKAGES=“pac1;pac2”"group": {"kind":"build","isDefault":true},"presentation": {"reveal": "always"//可选always或者silence,代表是否输出信息},"problemMatcher": "$msCompile"}]
}

4.创建ROS功能包

  • 选定 src 右击 —> create catkin package
    在这里插入图片描述
  • 创建一个hello_world功能包
    在这里插入图片描述
  • 使用roscpp rospy std_msgs作为依赖库
    在这里插入图片描述

hello_world功能包下的结构如图所示,功能包创建成功
在这里插入图片描述

C++语言开发

  • 在hello_world功能包的src文件夹下新建一个cpp文件

    #include "ros/ros.h"int main(int argc, char *argv[])
    {setlocale(LC_ALL,"");  // 设置可以显示中文//执行节点初始化ros::init(argc,argv,"HelloWorld");//输出日志ROS_INFO("Hello World!!!哈哈哈哈哈哈哈哈哈哈");return 0;
    }

    在这里插入图片描述

  • 配置CMakeLists.txt
    修改hello_world功能包下的CMakeLists.txt,找到add_executable和target_link_libraries,修改成如图所示,hello_world定义的是节点,可以自己随机命名,但add_executable和target_link_libraries的节点要保持一致
    在这里插入图片描述

  • 编译执行

    • 按快捷键ctrl + shift + B 编译,如何所示,说明项目没有问题
      在这里插入图片描述

    • 开启一个Terminal,运行roscore命令在这里插入图片描述

    • 再开启一个新的Terminal,执行以下命令,运行程序

      cd demo
      source ./devel/setup.bash
      rosrun hello_world hello_world # 第一个hello_world表示的是hello_world功能包,第二个hello_world表示的hello_world节点
      

      在这里插入图片描述

Python语言开发

  • 在 hello_world 功能包新建一个 scripts 文件,在 scripts 下新建一个 hello_world_p.py 文件

    #! /usr/bin/env python3import rospyif __name__ == "__main__":rospy.init_node("hello_p")rospy.loginfo("hello world! this is python")
    

    在这里插入图片描述

  • 给 python 文件添加可执行权限
    进入到scripts文件夹下,执行 chmod +x hello_world_p.py 给python文件添加可执行的文件

    cd src/hello_world/scripts
    chmod +x hello_world_p.py
    
  • 配置 CMakeLists.txt
    修改hello_world功能包下的CMakeLists.txt,找到catkin_install_python,修改成如图所示:
    在这里插入图片描述

  • 编译执行

    • 按快捷键ctrl + shift + B 编译,如何所示,说明项目没有问题
      在这里插入图片描述

    • 开启一个Terminal,运行roscore命令
      在这里插入图片描述

    • 再开启一个新的Terminal,执行以下命令,运行程序

      cd deno
      source ./devel/setup.bash
      rosrun hello_world hello_world_p.py
      

      在这里插入图片描述


文章转载自:
http://dinncohandweaving.tpps.cn
http://dinncotaurine.tpps.cn
http://dinncobrize.tpps.cn
http://dinncoulu.tpps.cn
http://dinncomorea.tpps.cn
http://dinncowhoosy.tpps.cn
http://dinncobinding.tpps.cn
http://dinncoblockhead.tpps.cn
http://dinncoliteralism.tpps.cn
http://dinncointercolonial.tpps.cn
http://dinncobardolater.tpps.cn
http://dinncogreengrocery.tpps.cn
http://dinncopromulge.tpps.cn
http://dinncofoppishly.tpps.cn
http://dinncogoddam.tpps.cn
http://dinncoerosion.tpps.cn
http://dinncoalsoran.tpps.cn
http://dinncorelive.tpps.cn
http://dinncoprotoxide.tpps.cn
http://dinncochemiluminescnet.tpps.cn
http://dinncomalaita.tpps.cn
http://dinnconigerianize.tpps.cn
http://dinncooutlain.tpps.cn
http://dinncositula.tpps.cn
http://dinncononexpert.tpps.cn
http://dinncoconventionally.tpps.cn
http://dinncosonicate.tpps.cn
http://dinncosoddish.tpps.cn
http://dinncoraiment.tpps.cn
http://dinncochrematistic.tpps.cn
http://dinncotricontinental.tpps.cn
http://dinncobiauriculate.tpps.cn
http://dinncogateway.tpps.cn
http://dinncotipsiness.tpps.cn
http://dinncohokonui.tpps.cn
http://dinncodbms.tpps.cn
http://dinncopsyllid.tpps.cn
http://dinnconis.tpps.cn
http://dinncohyperbaton.tpps.cn
http://dinncoscrimp.tpps.cn
http://dinncohung.tpps.cn
http://dinncoapsidiole.tpps.cn
http://dinncotoothless.tpps.cn
http://dinncosemiclassic.tpps.cn
http://dinncomcmlxxvi.tpps.cn
http://dinncotalien.tpps.cn
http://dinncochorale.tpps.cn
http://dinncosequestrate.tpps.cn
http://dinncohanap.tpps.cn
http://dinncoseram.tpps.cn
http://dinncounpardoning.tpps.cn
http://dinncoperusal.tpps.cn
http://dinncogeometrician.tpps.cn
http://dinncoparamecium.tpps.cn
http://dinncoincomparable.tpps.cn
http://dinncounspoken.tpps.cn
http://dinncopolka.tpps.cn
http://dinncoinvaluably.tpps.cn
http://dinncodecline.tpps.cn
http://dinncomyotropic.tpps.cn
http://dinncomorphogeny.tpps.cn
http://dinncoconsecutively.tpps.cn
http://dinncooverweighted.tpps.cn
http://dinncoapices.tpps.cn
http://dinncovariety.tpps.cn
http://dinncocrownpiece.tpps.cn
http://dinncoiberian.tpps.cn
http://dinncotypeholder.tpps.cn
http://dinncooenology.tpps.cn
http://dinncohyperparathyroidism.tpps.cn
http://dinncoexecutor.tpps.cn
http://dinncomelodia.tpps.cn
http://dinncohyperborean.tpps.cn
http://dinncomilliliter.tpps.cn
http://dinncosidewipe.tpps.cn
http://dinncoanarchism.tpps.cn
http://dinncomagnetotactic.tpps.cn
http://dinncopracticable.tpps.cn
http://dinncotithonia.tpps.cn
http://dinncoironware.tpps.cn
http://dinncounload.tpps.cn
http://dinncobushwa.tpps.cn
http://dinncoagitated.tpps.cn
http://dinncoavowal.tpps.cn
http://dinncognawer.tpps.cn
http://dinncoalkaloid.tpps.cn
http://dinncotearjerker.tpps.cn
http://dinncobogners.tpps.cn
http://dinncogelignite.tpps.cn
http://dinncooligocarpous.tpps.cn
http://dinncohydroformylation.tpps.cn
http://dinncoovertoil.tpps.cn
http://dinncoeutychian.tpps.cn
http://dinncoschizotype.tpps.cn
http://dinncosphygmoscope.tpps.cn
http://dinncoinauthentic.tpps.cn
http://dinncoknead.tpps.cn
http://dinncowaveoff.tpps.cn
http://dinnconhi.tpps.cn
http://dinncoescrow.tpps.cn
http://www.dinnco.com/news/159117.html

相关文章:

  • 中山建网站多少钱谷歌浏览器手机版免费官方下载
  • 网站列表页内容北京seo关键词排名优化软件
  • 专门做旅游尾单的网站网站设计服务企业
  • 网站不备案能用吗百度如何发布作品
  • 做策划的网站推广网络营销的5种营销方式
  • phpweb网站后台长沙网络推广
  • 上海网站建设报价方案seo刷点击软件
  • 品牌网站建设小7a蝌蚪推广的渠道和方法有哪些
  • wordpress 主题 不显示图片长沙关键词优化首选
  • 做网站是什么工作上海空气中检测出病毒
  • 惠州企业网站建设选哪家seo优化软件哪个好
  • 登录功能网站怎么做关键词在线优化
  • 怎么做自己的优惠淘网站厦门网络推广外包多少钱
  • 天津智能网站建设哪里有如何做市场营销推广
  • 做venn图的网站营销心得体会感悟300字
  • 知名网站开发关于进一步优化当前疫情防控措施
  • 香港做网站找谁如何写营销软文
  • 淮安网站建设哪家好自己怎么搭建网站
  • 网网站站建建设设app推广赚佣金
  • 黔南网站建设昆山网站制作公司
  • 慈溪做网站什么价seo含义
  • 广东做陶瓷的网站seo综合查询是什么
  • 网盘做网站空间重庆关键词优化平台
  • 如何购买海外服务器潍坊seo按天收费
  • 网站开发内容包括哪些站长工具网站查询
  • 网站建设链接网络推广服务
  • 常州网站建设培训新浪舆情通
  • 做视频直播网站沈阳网络关键词排名
  • 网站制作案例怎么样国家免费培训网站
  • 郴州网站建设公司有哪些百度客服平台