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

VScode ROS文件相关配置

  • 相关插件推荐

在这里插入图片描述

  • 设置编译快捷键:ctral + shit + B 选择 catkin_make.build

  • 进行配置使不需要每次选择,而是进行 ctrol+shit+B 则自动编译。
{"version": "2.0.0","tasks": [{"type": "catkin_make","args": ["--directory","/home/lihongli/catkin_ws","-DCMAKE_BUILD_TYPE=RelWithDebInfo"],"problemMatcher": ["$catkin-gcc"],"group": "build","label": "catkin_make: build"}]
}

在这里插入图片描述

{"version": "2.0.0","tasks": [{"type": "catkin_make","args": ["--directory","/home/lihongli/catkin_ws","-DCMAKE_BUILD_TYPE=RelWithDebInfo"],"problemMatcher": ["$catkin-gcc"],"group": {"kind":"build","isDefault": true},"label": "catkin_make: build"}]
}

在这里插入图片描述
在这里插入图片描述

  • 如果源码文件包含的头文件报错,下划线波浪好,则将该文件删除,然后重启VScode,等待ros重新加载,随后该文件又出现就好了。
    在这里插入图片描述
  • 下载git开源代码:https://github.com/6-robot/wpr_simulation.git,网络连接不通,直接下载好压缩包,在对应文件目录中解压。随后通过脚本安装编译需要的依赖库。
  • 随后在catkin_ws 工作空间目录中运行catkin_make进行编译
lihongli@lhl:~/catkin_ws/src$ git clone https://github.com/6-robot/wpr_simulation.git
正克隆到 'wpr_simulation'...
fatal: 无法访问 'https://github.com/6-robot/wpr_simulation.git/':Failed to connect to github.com port 443: 连接超时
lihongli@lhl:~/catkin_ws/src$ ping github
ping: github: 域名解析暂时失败
lihongli@lhl:~/catkin_ws/src$ pwd
/home/lihongli/catkin_ws/src
lihongli@lhl:~/catkin_ws/src$ ls
CMakeLists.txt  test_pkg      workspace.zip
learning_topic  truck_ws.zip  wpr_simulation-master.zip
lihongli@lhl:~/catkin_ws/src$ unzip wpr_simulation-master.zip

在这里插入图片描述

  • 启动示例程序仿真端
ihongli@lhl:~/catkin_ws$ source ~/catkin_ws/devel/setup.bash     
lihongli@lhl:~/catkin_ws$ roslaunch wpr_simulation wpb_simple.launch
... logging to /home/lihongli/.ros/log/76f65c40-7cd7-11f0-ad7c-1be29ce82f48/roslaunch-lhl-23006.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
  • 启动控制端
lihongli@lhl:~$ rosrun rqt_robot_steering rqt_robot_steering

在这里插入图片描述

  • 下载小海龟项目:下载、切换ros1版本、回工作空间编译。
  • 随后 roscore启动ros1,然后rosrun turtlesim turtlesim_node
    启动小乌龟。
lihongli@lhl:~/catkin_ws/src$ git clone https://github.com/ros/ros_tutorials.git
正克隆到 'ros_tutorials'...
remote: Enumerating objects: 3179, done.
remote: Counting objects: 100% (149/149), done.
remote: Compressing objects: 100% (66/66), done.
remote: Total 3179 (delta 106), reused 91 (delta 83), pack-reused 3030 (from 2)
接收对象中: 100% (3179/3179), 735.95 KiB | 502.00 KiB/s, 完成.
处理 delta 中: 100% (1921/1921), 完成.
lihongli@lhl:~/catkin_ws/src$ cd ros_tutorials/
lihongli@lhl:~/catkin_ws/src/ros_tutorials$ git che
checkout      cherry        cherry-pick   
lihongli@lhl:~/catkin_ws/src/ros_tutorials$ git checkout noetic-devel 
分支 'noetic-devel' 设置为跟踪来自 'origin' 的远程分支 'noetic-devel'。
切换到一个新分支 'noetic-devel'
lihongli@lhl:~/catkin_ws/src/ros_tutorials$ 
lihongli@lhl:~/catkin_ws$ catkin_make

在这里插入图片描述

http://www.lryc.cn/news/626281.html

相关文章:

  • 什么是大数据平台?大数据平台和数据中台有什么关系?
  • 网络间的通用语言TCP/IP-网络中的通用规则3
  • A股大盘数据-20250819 分析
  • 【PyTorch】单对象分割项目
  • Arthas 全面使用指南:离线安装 + Docker/K8s 集成 + 集中管理
  • Python入门第11课:Python网络请求入门,使用requests库轻松获取网页数据
  • Linux的基本操作
  • 浅看架构理论(一)
  • RK3568 Linux驱动学习——Linux设备树
  • 【SQL优化案例】统计信息缺失
  • 51单片机拼接板(开发板积木)
  • oracle官网下载jdk历史版本,jdk历史版本下载
  • Pandas数据预处理中缺失值处理
  • 【数据结构】堆和二叉树详解(下)
  • JavaScript 性能优化实战:从分析到落地的全指南
  • 【Task01】:简介与环境配置(第一章1、2节)
  • 彻底清理旧版本 Docker 的痕迹
  • 3.Kotlin 集合 Set 所有方法
  • STL——string的使用(快速入门详细)
  • 让AI学会“边做边想“:ReAct的实战指南
  • 第9章 React与TypeScript
  • 46 C++ STL模板库15-容器7-顺序容器-双端队列(deque)
  • 人工智能统一信息结构的挑战与前景
  • 八大排序简介
  • 08.5【C++ 初阶】实现一个相对完整的日期类--附带源码
  • JVM垃圾回收(GC)深度解析:原理、调优与问题排查
  • 算法——快速幂
  • 猫头虎AI分享|字节开源了一款具备长期记忆能力的多模态智能体:M3-Agent 下载、安装、配置、部署教程
  • Python 与 VS Code 结合操作指南
  • 深入理解抽象类