当前位置:网站首页>Configuring ROS development environment with vscode: Causes and solutions to the problem of ineffective code modification
Configuring ROS development environment with vscode: Causes and solutions to the problem of ineffective code modification
2022-07-25 10:07:00 【Dark rose】
Problem description
It's been in use for a while VsCode Conduct ROS When it comes to program development , There is often a problem , The code has been modified , However, the executable file obtained after compilation has never updated the changes made in the code .
VSCode Development environment :
The main use of CmakeTools plug-in unit , This plug-in can automatically Cmake Configure and generate automatic code completion configuration , You can avoid setting a lot of configuration files manually . Other plug-ins have no impact on this article , Include :C/C++ plug-in unit ,Cmake plug-in unit ,ROS plug-in unit ( Microsoft provides ).
Troubleshooting of the cause of the problem
By reading the plug-in automatically Cmake Output log and check build The directory structure under the folder is found , plug-in unit CmakeTools In automatic execution cmake When configuring devel The directory is set to build Under the table of contents , in other words , The executable file should have been generated into the workspace devel Folder , But after the plug-in , It relocates this folder to build/devel, As a result, all the results compiled by the plug-in are generated in this folder , So workspace devel The executable file under the folder is always updated , Which led to the problems I encountered . After finding out why , It's not difficult to solve . The contents of the log of problems are as follows :
Generated build The directory structure is as follows , You can see devel Is in build Under the folder :
resolvent
It can be seen from the log ,devel The location of the folder is through a folder named C A T K I N _ D E V E L _ P R E F I X CATKIN\_DEVEL\_PREFIX CATKIN_DEVEL_PREFIX Of cmake Variable , The change amount defaults to devel Folder , But it is in build Under folder devel, Therefore, we only need to specify the value of this variable as devel Folder is ok .
The specific operation is as follows :
open scode Set up settings Interface , find extension Under the CMakeTools, At this time, you will enter the detailed setting page of the plug-in , As shown in the figure below :

Scroll down in this interface to find Cmake:Configettings Options , As shown in the figure below , It opens at Edit in settings.json

Click to open the configuration file , Remember that the configuration file is under the project directory .vscode/setting.json Not the same file , Be sure to open it here . The configuration file is shown in the figure below , After clicking, it will be automatically added and positioned to "cmake.configureSettings" Set contents , We add variables to it C A T K I N _ D E V E L _ P R E F I X CATKIN\_DEVEL\_PREFIX CATKIN_DEVEL_PREFIX The value of is... Of the workspace devel Folder .

This problem has been solved . Delete the original build Folder , Right click workspace src Under folder CMakeLists.txt file , Click on ConfigureAll Just reconfigure the items automatically . During reconfiguration, you can see the following in the output log :

Tips
About the value of variables , Theoretically, it can be set to any customized location , But if it is set to a custom location , Before you want to run the node, you need source Under this directory Of setup.bash Script . After solving the problem , You can use CmakeTools The compile button provided by the plug-in compiles the program , Whether you compile all or a single node .
边栏推荐
- SOC芯片内部结构
- js数字千位分割的常用方法
- VScode配置ROS开发环境:修改代码不生效问题原因及解决方法
- Exciting method and voltage of vibrating wire sensor by hand-held vibrating wire acquisition instrument
- 无线振弦采集仪的使用常见问题
- [tensorflow2 installation] tensorflow2.3-cpu installation pit avoidance guide!!!
- [RNN] analyze the RNN from rnn- (simple|lstm) to sequence generation, and then to seq2seq framework (encoder decoder, or seq2seq)
- 小程序调起微信支付
- 概率论与数理统计 4 Continuous Random Variables and Probability Distributions(连续随机变量与概率分布)(上篇)
- testbench简介
猜你喜欢
随机推荐
Data viewing and parameter modification of multi-channel vibrating wire, temperature and analog sensing signal acquisition instrument
SystemVerilog语法
车辆属性最近一次入库时间初始化生成sql脚本文件
Es6详解
严重 [main] org.apache.catalina.util.LifecycleBase.handleSubClassException 初始化组件
Mlx90640 infrared thermal imager temperature measurement module development notes (I)
Terminal definition and wiring of bsp3 power monitor (power monitor)
用ESP32+TM1638实验NTP网络校时闹钟的ARDUINO代码
js利用requestAnimationFrame实时检测当前动画的FPS帧率
CCF 201509-3 template generation system
LoRA转4G及网关中继器工作原理
T5 paper summary
Filter过滤器详解(监听器以及它们的应用)
FPGA基础进阶
ADC introduction
Coredata storage to do list
Mlx90640 infrared thermal imaging sensor temperature measurement module development notes (II)
概率机器人学习笔记第二章
File -- first acquaintance
App lifecycle and appledelegate, scenedelegate









