在VSCode中编辑 .json 文件,调试ROS节点。

I am a totally fresh man to ROS and cpp Programming. If you have any recommendations and further requires to the contents. Please do not hesitate to leave your comments. 

HELP EACH OTHER TO GET IMPROVEMENTS IS THE BEST THING WE CAN DO!

Open the VSCode at the base path. The base path is the path to run catkin_make.

Run the following command in the base path to create "c_cpp_properties.json", which will be placed at the directory of .vscode/. And simultaneously "compile_commands.json" will be created and placed at the directory of build/.

catkin_make -DCMAKE_EXPORT_COMPILE_COMMANDS=Yes

Edit "c_cpp_properties.json". Normally, we only need to modify “includePath”: and “compileCommands”:

c_cpp_properties.jason

VSCode doesn’t have "make" function. Therefore, the "Task" function is used to set up configurations. Use “Ctrl+shift+P” to enter command mode. Select “Tasks: Configure Tasks”. Select “catkin: make”. In .vscode/, a task.jason file will be auto-generated.


task.jason

To build the node, press “Ctrl + Shift + B”. The process of building the node can be observed in the panel of TERMINAL.


processing a node

Click the Debug icon lists on the Activity Bar, and then select “Add Configurations”. Inside the drop-down window, select “C++(GDB/LLDB)”. A “launch.json” file is generated automatically. Edit the file as below.


launch.jason
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,453评论 0 10
  • pyspark.sql模块 模块上下文 Spark SQL和DataFrames的重要类: pyspark.sql...
    mpro阅读 9,516评论 0 13
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,967评论 0 23
  • 正式入学的时候,我们都仔细阅读了学习公约,确认对条款完全认同,自觉遵守,才郑重的签署了学习公约。学习公约包...
    椰子树liang阅读 3,123评论 0 0
  • 你是我旋转星空中唯一不动的星光 你是我颠簸世界里永恒不变的方向 你是我小酌怡情后无限惬意的遐想 根本无法抑制 对你...
    康居西城阅读 349评论 1 2