当前位置: 首页 > 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.dtcms.com/a/338608.html

相关文章:

  • 知识篇 | 中间件会话保持和会话共享有啥区别?
  • 在Windows高效使用OpenCode的方案
  • Rust 入门 返回值和错误处理 (二十)
  • Docker 快速下载Neo4j 方法记录
  • 管道魔法再现:卡巴斯基发现与CVE-2025-29824漏洞利用相关的进化版后门程序
  • Rust学习笔记(七)|错误处理
  • 人工智能驱动的开发变革
  • 安全多方计算(MPC)技术解析及NssMPClib开源项目实践
  • 驱动开发系列65 - NVIDIA 开源GPU驱动open-gpu-kernel-modules 目录结构
  • ubuntu24 编译安装php-7.4.33
  • Python入门第11课:Python网络请求入门,使用requests库轻松获取网页数据
  • 什么是大数据平台?大数据平台和数据中台有什么关系?
  • RNN如何将文本压缩为256维向量
  • ubuntu下编译c程序报错“ubuntu error: unknown type name ‘uint16_t’”
  • 【保姆级教程~】如何在Ubuntu中装miniconda,并创建conda虚拟环境
  • ubuntu20.04 上 flathub summary exceeded maximum size of 10485760 bytes 的处理
  • 边缘智能体:Go编译在医疗IoT设备端运行轻量AI模型(上)
  • 分布式机器学习之流水线并行GPipe:借助数据并行来实现模型并行计算
  • JVM之Java内存区域与内存溢出异常
  • 微服务-06.微服务拆分-拆分原则
  • 117. 软件构建,拓扑排序,47. 参加科学大会,dijkstra算法
  • webpack》》Plugin 原理
  • VSCode 从安装到精通:下载安装与快捷键全指南
  • 视觉采集模块的用法
  • 企业知识管理革命:RAG系统在大型组织中的落地实践
  • 大数据数据库 —— 初见loTDB
  • 最新研究进展:2023-2025年神经机器翻译突破性成果
  • 【无标题】基于大数据+Python的共享单车骑行数据分析关系可视化 基于Spark+Hadoop的共享单车使用情况监测与数据可视化
  • AI 药物发现:化学分子到机器学习数值特征的转化——打通“化学空间”与“模型空间”关键路径
  • 大语言模型基本架构