Learning the code

Hello,
I am trying to learn how to change, build and debug ardupilot. Following ardupilot dev site.
I use WSL2 ubuntu in VSCODE. Ardupilot cloned to WSL not windows. I set up all the enviroment like git, python, vscode extensions.
Continued with the example sketches some of them worked.

Now I am trying to change the code and observe if it works.
I followed https://www.youtube.com/watch?v=5nQiY_q_ZVA video. I can build the code with this changes, run STIL, control vehicle with commands however, I can’t see rangefinder data on OSD or print data on console like in the video. Tried other kind of changes on the code but they didn’t make any difference. I don’t get any build error if the code I added is correct.

I get “#include errors detected. Consider updating your compile_commands.json or includePath. Squiggles are disabled for this translation unit” errors in VSCODE.
I updated c_cpp_properties.json file like this
Is it possible I set up the build enviroment incorrect way ?

{
“configurations”: [
{
“name”: “Linux”,
“includePath”: [
“/home/bukre/Ardupilot_workspace/ardupilot**”,
“/home/bukre/Ardupilot_workspace/ardupilot/modules/",
"/home/bukre/Ardupilot_workspace/ardupilot/libraries/
”,
“/home/bukre/Ardupilot_workspace/ardupilot/libraries/AP_HAL**”,
“/usr/lib/gcc/x86_64-linux-gnu/11/include”,
“/usr/include/linux”,
“/usr/include/x86_64-linux-gnu”
],
“defines”: [
“ARDUPILOT=1”
],
“compilerPath”: “/usr/lib/ccache/gcc”,
“cStandard”: “c17”,
“cppStandard”: “gnu++17”,
“intelliSenseMode”: “linux-gcc-x64”,
“compileCommands”: “${workspaceFolder}/build/Pixhawk1/compile_commands.json”
}
],
“version”: 4
}

Are you trying to cross compile for specific linux board??

No I just want to getting used to with the ardupilot code using SITL and pixhawk for future tasks.

I could compile the code using Docker container for RPI

I am also looking for away to debug and simulate

Hope someone can help here

@IHA1 Did you manually setup Python, or did you run

Tools/environment_install/install-prereqs-ubuntu.sh

after cloning the ardupilot repo (with submodules)?

I guess first manually but I used Tools/environment_install/install-prereqs-ubuntu.sh after.

BTW. I was able to send message to console using gcs().send_text inside one of the constantly called functions AP_OSD_Screen::draw_gps_latitude in sitl.