The problem is in this line of code: logger.Init(log_structure, ARRAY_SIZE(log_structure));
in each of the Log.cpp for each SITL model.
So a simple dirty workaround would be to modify the beginning of the file as follows
//#if LOGGING_ENABLED == ENABLED #if 0
so that every routine is compiled as {}.
Of course, the best is to accomodate log_structure to M1 arquitecture.
Possibly. At the beginning: // Code to Write and Read packets from AP_Logger log memory // Code to interact with the user to dump or erase logs
I’ll try shortly a simulation and see what happens, but the best is having log_structure adapted for M1 arquitecture.
At ardupilot/libraries/AP_Logger/LogStructure.h: #define LOG_PACKET_HEADER_LEN 3 // bytes required for LOG_PACKET_HEADER // once the logging code is all converted we will remove these from // this header
Only for SITL compilation: ardupilot/libraries/AP_Logger/LogStructure.h
… #include <AP_AIS/LogStructure.h> // structure used to define logging format struct LogStructure { uint8_t msg_type;
…
Only delete PACKED.
@Webillo now if i start python3 sim_vehicle.py -v ArduCopter i get the following error:
ImportError: dlopen(/opt/homebrew/lib/python3.9/site-packages/gnureadline.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace ‘_add_history’
and it exits mavproxy. Is there a way to have sitl running as a separate object from mavproxy?
*** UPDATE *** started with option --no-mavproxy and it kind of started but than console is in following condition:
RiTW: Window access not found, logging to /tmp/ArduCopter.log
SIM_VEHICLE: Waiting for SITL to exit
For me it compiles and links deleting PACKED in that single line.
See this.
In my case I changed in mavproxy.pygnureadline to readline (I think you can remove gnureadline module completely if you have it). If you cannot find it, try to upgrade mavproxy.py, or use the one in GitHub.
If not, another stupid thing never tested in M1.
I found that this breaks --speedup i.e. if I use this hack to get SITL to built then if I pass the --speedup option the SITL process will crash with an illegal hardware instruction error. If I don’t set speedup it works fine.
It’s nice to having it working but it seems a bit dodgy to me.
It could be @ntamas . I have to look at this more because “something changed” recently and I’m not having this problem now. I think I still use the hack (remove PACKED) - the code compiles and builds and I have managed to run the entire suite of test.Plane scripts which include lots of various speedup values, so it must be working.