Issues with setting up the SITL

Hello, I’m trying to set up Software-in-the-Loop (SITL) with the PX4 board using JMavSim and MATLAB. Initially, I have completed the MATLAB configuration, but I need assistance in configuring JMavSim to send Mavlink data over a specific port during simulation on my computer. Does anyone know how to achieve this? Also, I am working on WSL2 for PX4 programming and simulation, and MATLAB is on Windows. Are there any potential issues with this setup? Currently, I am running it without specifying the simulator, assuming it looks for a simulator on a certain port, but Wireshark does not detect any data being sent to any port. Any insights or solutions would be greatly appreciated.

Do you have any documentation that you’re following for this?

Yes, I’m following a procedure created by NASA specifically for this, which comes with C files that work in conjunction with Simulink.

Ok, are these docs public so I can see what you’re trying? Otherwise, I don’t think I have any way to see what is going on.

Hello,

No problem at all! I’ve checked the information from PX4 Autopilot Simulink Interface(LAR-19482-1) | NASA Software Catalog. I attempted to replicate it and follow the instructions, but I’m having trouble connecting my simulation in WSL2 to the specified port. Since that part isn’t working for me, I’m unsure if anything else is functioning as intended.

No idea. Can you be more specific of what didn’t work exactly and what you tried?

Currently, my main issue is with the setup. The documentation mentions that the simulation in WSL2 should communicate with the simulation in Simulink on my Windows machine through port 14560 using a UDP connection. I’ve been searching through all the files in PX4-Autopilot, but I haven’t found a way to establish this connection. Similarly, I haven’t found a way to set the simulation to the IP address 192.168.46.2. To be honest, I’m not sure if setting it to this IP will automatically connect it to the mentioned port.