Servers by jDrones

AT with SITL - how to set up home pos


(lospalos) #1

At last I installed SITL under windows cygwin. On my PC runs simulation of vehicle (copter). This simulator sends mavlink over serial port via 433mhz radio link to AT (running on pixhawk) and this AT is connected back to the same PC via USB cable and bind to MissionPlanner. In MP I can see both - AT and simulated vehicle - so far so good. Now I want to test AT how it points to simulated vehicle. But GPS coordinates of AT are taken from real GPS and simulated vehicle has its own coordinates and of course these two are completely different positions. So I need somehow to set ATs GPS position to the specific location, where the simulated vehicle is. Is there a way to overwrite ATs real GPS position to my specific (e.g. where the simulated vehicle starts)?


(James Pattison) #2

Why not just set the simulator to have a local position? http://ardupilot.org/dev/docs/using-sitl-for-ardupilot-testing.html#using-sitl-for-ardupilot-testing


(lospalos) #3

well that is not the solution for me since I’m testing it inside building and GPS signal is therefore weak. Position of AT jumps from here to there and 3d fix is often lost. If the AT would be outside that is ok but it is not.


(lospalos) #4

There is no way how to preset GPS position of AT and tell him to ignore real GPS data?


(James Pattison) #5

The only way I know of would be setting the parameter for gps type to “MAV” and injecting a fake gps message using ROS, or a small program generating emulated data and putting it into mavlink messages (HIL_GPS or GPS_INPUT).
There may be a python script or ROS package to do this already, but I’m not aware of it. Sorry.


(James Pattison) #6

Can you raise an issue in GitHub for this?
Thinking about it, it might be useful to be able to just set a static location (perhaps as an offset from the vehicle home?) for the tracker as a mode option, and not need a separate gps.


(rmackay9) #7

Actually we do support this by setting the START_LATITUDE and START_LONGITUDE parameters.

Does not seem to be documented on the wiki however :frowning:


(lospalos) #8

Thanks for interest Randy. Anyway I tested this too, but it didn’t help :frowning: Tested AT was of version 0.8 guess, but not sure about it, perhaps I already upgraded to v1.0
When I set these params, in MissionPlanner the position was still taken from real GPS of AT.
Isn’t there yet another parameter that e.g. set the type of positioning (GPS, static or so)?


(rmackay9) #9

Ok, it will only use those parameters if there is no GPS. There parameter description is this:

Combined with START_LATITUDE this parameter allows for an initial position of the tracker to be set. This position will be used until the GPS gets lock. It can also be used to run a stationary tracker with no GPS attached.


(lospalos) #10

Well these START_LAT/LON parameters doesn’t work for me. When I set them to desired Lat/Lon and disconnected real GPS, got position 0.0000000 0.0000000 in MissionPlanner :frowning: . My AT is of version 1.0.
But when downgraded to 0.8 the position is set correct to preset values from parameters START_LAT/LON :slight_smile: It works, thanks


Failed to update home location (2)
Can't see any vehicle in MP when connected to AT
(lospalos) #11

Ok, start position is working now, thanks Randy.


(Julio Curi) #12

How do you connected SITL with real AT ?? I use MP on windows, my vehicle runs in SITL (Ubuntu - VM) and AT is connected via USB cable, all in the same PC. Thanks in advance !!!