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

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.xdnf.cn/news/18167.html

相关文章:

  • 【habitat学习一】Habitat-Lab 配置键文档详解(CONFIG_KEYS.md)
  • 嵌入式开发学习———Linux环境下网络编程学习(三)
  • RAG 面试题(实时更新补充)
  • 学习笔记分享——基于STM32的平衡车项目
  • Ubuntu 和麒麟系统创建新用户 webapp、配置密码、赋予 sudo 权限并禁用 root 的 SSH 登录的详细
  • 【PyTorch】单对象分割项目
  • 八大排序简介
  • Java 11中的Collections类详解
  • 数据结构:二叉树oj练习
  • Kubernetes Pod 控制器
  • 【PyTorch项目实战】OpenNMT本地机器翻译框架 —— 支持本地部署和自定义训练
  • 学习strandsagents的http_request tool
  • 接口性能测试工具 - JMeter
  • IMX6ULL-KERNEL源代码
  • KMM跨平台叛逃实录:SwiftUI与Compose Multiplatform共享ViewModel的混合开发框架(代码复用率85%)
  • RPC高频问题与底层原理剖析
  • 【树莓派】【嵌入式】远程树莓派,解决ping不通问题
  • 应用缓存不止是Redis!——亿级流量系统架构设计系列
  • Windows/Centos 7下搭建Apache服务器
  • Nacos-7--扩展一下:0-RTT和1-RTT怎么理解?
  • Spring Boot 全局异常处理
  • 重置iPhone会删除所有内容吗? 详细回答
  • 基于WebSocket和SpringBoot聊天项目ChatterBox测试报告
  • 如何用Prometheus和FastAPI打造任务监控的“火眼金睛”?
  • 11.Ansible自动化之-内容集管理
  • 如何理解关系型数据库的ACID?
  • 浅看架构理论(一)
  • 【上升跟庄买入】副图/选股指标,动态黄色线由下向上穿越绿色基准线时,发出买入信号
  • 机器学习深度学习 所需数据的清洗实战案例 (结构清晰、万字解析、完整代码)包括机器学习方法预测缺失值的实践
  • RWA在DeFi中的应用