I have installed Cygwin, MavProxy, and ArduPilot on my Windows laptop. I followed instructions according to SITL Simulator (Software in the Loop) — Dev documentation. In Cygwin, from folder “autotest”, I enter python sim_vehicle.py -v ArduSub -L RATBeach --map --console and it works fine. My objective is to edit ardupilot and test my edits in SITL before actually using them on the UAV. I have two questions:
How do I tell the computer to recompile any or all C++ files so that my edits are actually implemented?
How can I tell what C++ files, out of all of ardupilot, are used for ArduSub?
I have solid C++ experience but not really with command lines. Thank you!
To AC_PosControl.cpp I added #include <iostream> at the top (to handle the error it was throwing) and added two std::cout << ... statements to the functions init_ekf_z_reset and check_for_ekf_z_reset. I ran sub_mission.txt in SITL but neither of my messages were printed. Does this mean that std::cout does not work here or that those functions are simply not being called? Should I learn how to use gcs().send_text instead?
Update: I added gcs().send_text(MAV_SEVERITY_INFO, "init_ekf_z_reset: %f", (double)_ekf_z_reset_ms); to the function init_ekf_z_reset() and still I didn’t see my message. Am I doing something wrong or is the function not being called?
I typically use printf with no issues. Be aware that sim_vehicle launches another terminal instance and that these outputs are printed there, not in the terminal instance that launched sitl.
I run SITL by typing python sim_vehicle.py -v ArduSub -L RATBeach --map --console into the Cygwin command line. Then 3 new windows pop up: the MavProxy command line (C:\Users\yunyi\MAVProxy\mavproxy.exe), the console, and the map. I have std::cout, printf, and gcs().send_text commands all in a row but the only thing that I am seeing is the gcs output in the console. What terminal instance are you referring to where the printf outputs are printed?