Sim_vehicle with real FC connected with Jetson

I am using a Jetson board as a companion computer for the autonomous operation of my drone. The Jetson board and Flight Controller (FC) are connected through telem2 - /dev/ttyTHS0:1500000, and both mavproxy and pymavlink are functioning well.

In order to verify my pymavlink scripts, I wanted to test them in the sim_vehicle environment, so I attempted the following procedures:

  1. -v ArduCopter => TCP connection is not possible in Mission Planner (MP) installed on the external device.
  2. -v ArduCopter --no-mavproxy => TCP connection is possible in MP installed on the external device, but the drone’s parameters do not correspond to my model.
  3. (In the state where the FC and Jetson are connected) -v ArduCopter -A “SERIAL2=uart:/dev/ttyTHS0” --no-mavproxy => When attempting a TCP connection with MP, connection fails due to Packet Loss.
  4. (In the state where FC and Jetson are not connected) -v ArduCopter -A “SERIAL2=uart:/dev/ttyTHS0” --no-mavproxy => Connection with MP is possible but the drone model is unknown.

Hey! So this looks like it might be related to something I’ve done. I connected my jetson nano to my laptop, started up sitl, and then ran my code on the jetson and was able to control the sitl drone with my jetson. I also was able to test that same code using a TCP connection on my laptop between 2 WSL2 instances. I pushed my code with some readme’s that may be helpful. Go to GitHub - sbow/OperationSquirrel at cams-branch, and in the scratch_code/comp-uart and scratch_code/comp-tcp folders you’ll find how I did it.

Here’s a quick summary of what you’ll find with each approach:
TCP - start SITL in WSL2, and the in another instances of WSL2, run the code in my “comp-tcp” folder and it will connect to the sitl drone
UART - connect FTDI device to jetson, then connect that to the laptop, start sitl in WSL2, run the code in my “comp-uart” folder and it will connect to the sitl drone

Let me know if this is helpful and if you have any questions.

Hello thank you for your replying. I almost understand but I have some questions!

First of all I wanna try simulate with my real vehicle’s parameters in GCS map.
So I tried above like running sim-vehicle on jetson with real vehicle then I tried connect sim-vehicle with GCS. In my other topic I succeeded to connect sim with GCS and Pymavlink code but you know it is not my own vehicle. So Is there any idea about this? Thank you.

I’m not a SITL expert by any means, but just like you can load parameters onto your flight controller in mission planner, I believe you can load a parameter file to the simulated drone. You should also be able to customize the frame and other arguments that affect the physics of the simulated drone, but I haven’t played around with those. To be honest I’m a little confused with what you’re trying to do. I thought you just wanted to test your companion computer code with the SITL drone to make sure that the drone is going to do what you want.