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

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

作者: 钢铁侠与小辣椒 | 来源:发表于2019-06-17 08:54 被阅读0次

    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

    相关文章

      网友评论

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

          本文链接:https://www.haomeiwen.com/subject/ojlofctx.html