VectorMath Project Reference
I am using Windows 10 and Visual Studio 2019 to make some modifications to some aspects of the physics engine. To do that, I am attempting to change the VectorMath header file within my Blocks environment. When I compile my project, it checks this header file for compilation errors; however, using the debugger, I am tracking the steps that AirSim takes to get the Kinematics state in FastPhysicsEngine.hpp, the call body.getKinematics(), and it leaves the Blocks folder and runs the .../AirSim/AirLib/include/common/VectorMath.hpp header file instead, which has not been overridden by me. To be very explicit, I want it to run the .../AirSim/Unreal/Environments/Blocks/Plugins/AirSim/Source/AirLib/include/common/VectorMath.hpp. Perhaps this is due to my incomplete understanding of how C++ compilation and project generation works, but I would appreciate any advice one may have. I need my project to compile and reference the VectorMath file within my Blocks directory.
AirSim compiles the code in AirLib, Mavlinkcom and then copies them to the Plugins/AirSim/Source/AirLib folder when you run build.cmd. So if you want to make changes, these are the 2 ways -
-
Open the generated .sln file in Visual Studio, that'll open the files in Blocks/Plugins directory. Here, you can make any changes you want, and then press Run (F5) to build and use the modified files. This will use the modified files inside Blocks/Plugins/... Note that if you modify the AirLib files inside Plugins/ and then run
build.cmdfrom the root of the repo, it'll override the modified files since it copies the root AirLib directory to the Plugins/ directory. This way is useful for quickly iterating over code changes and testing, since you only need to press Run from Visual Studio. However, any changes made here won't be reflected in the main repo files, and will get overridden if you runbuild.cmd. To reflect the changes in the root directory folders, runupdate_to_git.batfromUnreal/Environment/Blocksfolder, this copies the (modified) files inBlocks/Plugins/AirSim/Source/AirLib/...to the root AirLib directory, where the changes will be detected by git, and can be committed. -
Modify the files in the root AirLib directory, run
build.cmd. This will copy the modified files to the Blocks project, and those will be used.