I'm using VS Code to debug the ROS node (i.e., .cpp file), here are part of my global launch.json and tasks.json files


        "type": "lldb",
        "request": "launch",
        "name": "Debug ROS Node",
        "program": "${workspaceFolder}/devel/lib/ROSPackage/ROSNode",
        "args": [],
        "cwd": "${workspaceFolder}",
        "preLaunchTask": "catkin build ROS Package"


    "version": "2.0.0",
    "tasks": [
            "label": "catkin build ROS Package",
            "type": "shell",
            "args": [
            "problemMatcher": [
            "group": {
                "kind": "build",
                "isDefault": true

With the setting of preLaunchTask, every time I debug the ROS node I need to catkin build the package even if the .cpp file is not changed.

So my question is how to design an autodetection that can automatically skip the catkin build process if the .cpp file is not changed.

Is it possible through some settings in .json files?

  • 1
    $\begingroup$ Welcome to Robotics Stack Exchange! In my experience, catkin simply ignores and does not recompile if there is no change in the code. So, even if you execute catkin multiple times, it will skip the compilation process. $\endgroup$
    – ravi
    Commented Aug 23, 2023 at 8:55
  • $\begingroup$ Hi! @ravi Thanks for the tip that catkin can implement this auto-detection process. For the sake of curiosity, is there any other way instead of using catkin? $\endgroup$
    – KKKmelody
    Commented Aug 23, 2023 at 9:13


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.