HITL using ethernet in Ardupilot

I noticed that Ardupilot has Ethernet on CUAV-V6X, and we have used TCP/UDP connection between Simulink and Ardupilot.
https://discuss.ardupilot.org/t/gsoc-2020-matlab-and-simulink-conclusion/61049
Can we utilize the Ethernet for achieving Hardware-in-the-Loop (HITL) simulation, where the Flight Dynamics Model (FDM) is in Simulink and the autopilot is on CUAV-V6X? It is different from the simulation of the flight dynamics model on the hardware flight control board.
https://ardupilot.org/dev/docs/sim-on-hardware.html
But I noticed that “TCP/UDP on hardware” in code is “SocketAPM”,and “TCP/UDP in SITL” is “SocketAPM_native”,
https://github1s.com/ArduPilot/ardupilot/blob/HEAD/libraries/AP_HAL/utility/Socket_native.h
https://github1s.com/ArduPilot/ardupilot/blob/HEAD/libraries/AP_HAL/utility/Socket.h
I can’t understand these deeper difference, Can anyone give me some suggestions on how to implement HITL with hardware network ports? Really appreciate!!!

1 Like