Using SITL

245 views
Skip to first unread message

Ivan Ma

unread,
Apr 3, 2015, 1:30:37 PM4/3/15
to droidp...@googlegroups.com
I am currently using SITL with the Android emulator to conduct simulated test flights, etc. The problem is that the emulator is slow and glitchy and will crash occasionally. Is there any better way to test using SITL? I tried setting up SITL to work with my Nexus 7 but I got nowhere with that approach. 

Fredia Huya-Kouadio

unread,
Apr 4, 2015, 3:09:34 AM4/4/15
to droidp...@googlegroups.com
Hi Ivan,

Could you walk me through your SITL setup. I can try to help you with setting it up to work with your Nexus 7.

-Fredy

On Fri, Apr 3, 2015 at 10:30 AM Ivan Ma <ivan...@gmail.com> wrote:
I am currently using SITL with the Android emulator to conduct simulated test flights, etc. The problem is that the emulator is slow and glitchy and will crash occasionally. Is there any better way to test using SITL? I tried setting up SITL to work with my Nexus 7 but I got nowhere with that approach. 

--
## Please take care to answer by email to the original GROUP address, not only to the sender ##
---
You received this message because you are subscribed to the Google Groups "DroidPlanner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to droidplanner...@googlegroups.com.
To post to this group, send email to droidp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/droidplanner/46f95798-76bc-4097-99b8-daa873834dc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ivan Ma

unread,
Apr 4, 2015, 7:59:29 PM4/4/15
to droidp...@googlegroups.com
Hi Fredy,

Here is my setup for testing on emulator:

1. Start the Android emulator and run these commands for port forwarding:

telnet localhost 5554
redir add udp
:14550:14550


2. Run SITL using this command:
sim_vehicle.sh --console --out 10.0.2.15:14550
I believe 10.0.2.15 is the IP address of the Android emulator, port 14550

3. Change connection type to UDP and connect

Bill Bonney

unread,
Apr 4, 2015, 10:54:58 PM4/4/15
to droidp...@googlegroups.com
You might find it easier when running on the Nexus7 to have a TCP connection to SITL. You can connect from the Nexus to the SITL IP address of 5762 or 5763 ports

Bill

Ivan Ma

unread,
Apr 5, 2015, 6:34:51 PM4/5/15
to droidp...@googlegroups.com
Thanks for the tip! I'm having a little trouble setting this up, though. What should go in the "Server IP" in connection preferences in Tower? Is it just the IP address of the machine running SITL?

Phu Nguyen

unread,
Apr 5, 2015, 7:25:01 PM4/5/15
to droidp...@googlegroups.com
Ivan,

Have you tried running SITL with an explicit --out IP address?

Steps: Connect your SITL machine and your Nexus to the same Wi-FI network.

Navigate to ardupilot/ArduCopter

Run:

sim_vehicle.sh -L 3DRBerkeley --console  --out <MOBILE_DEVICE_IP>:14550

This says: run SITL with a default location of 3DRBerkeley and pip it out to MOBILE_DEVICE_IP.

Then on your Nexus, use a UDP connection, no need to specify the IP of vehicle.

Thanks,

Phu


Ivan Ma

unread,
Apr 5, 2015, 11:12:39 PM4/5/15
to droidp...@googlegroups.com
Phu,

Thank you, it's working now!! In order to get this to work, I had to set up a wireless hotspot on my phone and connect both my tablet and my work station to that hotspot since I'm working off the university's Wi-Fi connection.
Definitely hacky, but still better than the emulator. One question though: how did you know to use UDP as the telemetry connection type?

Thanks again for your help!

Phu Nguyen

unread,
Apr 6, 2015, 1:03:33 PM4/6/15
to droidp...@googlegroups.com
Hi Ivan,

You're welcome. We know that the SITL setup process could use improvement. If you have some time, can you provide feedback on how to get this better and what steps were confusing?

UDP is the default type for Mavlink messages to get through.

Thanks,

Phu

Ivan Ma

unread,
Apr 7, 2015, 12:33:26 AM4/7/15
to droidp...@googlegroups.com
Phu,

I think if the steps you listed above were included in http://android.dronekit.io/getting_started.html#setting-up-sitl-on-linux, it would clear up most of the confusion. There are some instructions on setting up SITL in those docs, but more guidance would certainly be helpful. The missing part for me was that I didn't know I had to connect using UDP in Tower.

Bill Bonney

unread,
Apr 7, 2015, 12:56:45 AM4/7/15
to droidp...@googlegroups.com
Hi,
>The missing part for me was that I didn't know I had to connect using UDP in Tower.
You don’t have to use UDP at all, you can get Tower to also connect to the SITL via TCP (ie from Tower to SITL)

This diagram here show best how things are connected and how you can connect. http://dev.ardupilot.com/wiki/simulation-2/sitl-simulator-software-in-the-loop/#running_sitl

Either you are asking MAVProxy to resend packets out on UDP 14550 to a destiniation IP (your case Tower) or you can connect ‘directly’ to the autopilot (APM) under test on port 5762,5763

The default ’standard' behaviour is for Tower/Droidplanner, APM Planner and QGroundControl to listen of UDP port 14550 on startup.

That said, good suggestion, the diagram above is good to show in the docs

Bill

Reply all
Reply to author
Forward
0 new messages