当前位置:网站首页>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 .
边栏推荐
- CCF 201503-4 网络延时
- 小程序企业发放红包功能
- [RNN] analyze the RNN from rnn- (simple|lstm) to sequence generation, and then to seq2seq framework (encoder decoder, or seq2seq)
- ADC简介
- [nearly 10000 words dry goods] don't let your resume don't match your talent -- teach you to make the most suitable resume by hand
- FPGA基础进阶
- 工程监测无线中继采集仪和无线网络的优势
- Internal structure of SOC chip
- 车辆属性最近一次入库时间初始化生成sql脚本文件
- 代码整洁之道--直击痛点
猜你喜欢
随机推荐
Download and installation of QT 6.2
dp-851
@5-1 CCF 2019-12-1 reporting
ADC introduction
C语言基础
【成长必备】我为什么推荐你写博客?愿你多年以后成为你想成为的样子。
ARM GIC简介
CCF 201503-3 Festival
用ESP32+TM1638实验NTP网络校时闹钟的ARDUINO代码
Introduction to armv8 general timer
Yolov5 realizes target detection of small data sets -- kolektor defect data set
CCF 201512-4 delivery
Advanced introduction to digital IC Design SOC
【RNN】剖析RNN 之 从RNN-(Simple|LSTM) 到 序列生成 再到 seq2seq框架(encoder-decoder,或称为seq2seq)
JS uses requestanimationframe to detect the FPS frame rate of the current animation in real time
JDBC操作数据库详解
工程监测多通道振弦传感器无线采集仪外接数字传感器过程
数字IC设计SOC入门进阶
一个可以返回前一页并自动刷新页面的ASP代码.
¥ 1-1 SWUST OJ 941: implementation of consolidation operation of ordered sequence table







