Forwarding telemetry data (NOT the MAVLink stream!) from Mission Planner or other GCS

Hey,

I want to forward the parsed telemetry data (such as roll pitch yaw and altitude) from a ground control station over a UDP or UART port so that I can receive it in another software on the same PC. Is there a way to do this? Which GCS do I need? (Windows-based)

Consider that I do not want to forward the telemetry stream, as I can't properly parse the stream to extract the data; I want the extracted data.

Any help would be much appreciated!

Thanks

Views: 1022

Reply to This

Replies to This Discussion

Any luck finding an answer on  this ?

No, I found nothing. I have stopped looking for answers since long ago though, there might be new ways to do this now after many updates and changes.

Good luck!

hi,

Missionplanner secretly (shhhh!)   outputs subsets of its internal data in response to html requests, in   JSON.     Take a look at http://127.0.0.1:56781/mavlink/     while Missionplanner is connected to a real plane or to a SITL aircraft.  (results below).     It returns lots of useful stuff in JSON, although it lacks SYSID and battery info.   I have some python code somewhere that parses this in an amateurish manner if you want me to dig it out, but it aint hard

And for other hidden jems of Missionplanner, poke this into a browser while it is running:   http://127.0.0.1:56781/

some vague pseudo-python code that might point you in the right direction (no guarantees, it is late at night here!!!) ... 

url =  "http://127.0.0.1:56781/mavlink/"
urllib2.urlopen(url, timeout=.05)
request = urllib2.Request(url)
contents = urllib2.urlopen(request).read(4096)

parsed_json = json.loads(contents) 
try:
    alt = parsed_json["VFR_HUD"]["msg"]["alt"]
    airspeed = parsed_json["VFR_HUD"]["msg"]["airspeed"]
    throttle = parsed_json["VFR_HUD"]["msg"]["throttle"]
    heading = parsed_json["VFR_HUD"]["msg"]["heading"]
    roll = parsed_json["ATTITUDE"]["msg"]["roll"]
    pitch = parsed_json["ATTITUDE"]["msg"]["pitch"]
    target_bear= parsed_json["NAV_CONTROLLER_OUTPUT"]["msg"]["target_bearing"]
    lat = parsed_json["GPS_RAW_INT"]["msg"]["lat"]
    lon = parsed_json["GPS_RAW_INT"]["msg"]["lon"]
    heading = parsed_json["VFR_HUD"]["msg"]["heading"]
    climb = parsed_json["VFR_HUD"]["msg"]["climb"]

except:

    print "Beware the target bear!!!!"

Parsing the telemetry stream itself is not trivial  (although I am currently trying to work out that via pymavlink), but I hope something like the above should do the job for you.

Cheers

Pete  

  

{"VFR_HUD":{"msg":{"airspeed":14.8990469,"groundspeed":16.18665,"alt":108.009995,"climb":0.04075444,"heading":354,"throttle":60},"index":1,"time_usec":0},

"STATUSTEXT":{"msg":{"severity":6,"text":"RUtGMiBJTVUxIGlzIHVzaW5nIEdQUwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="},"index":1,"time_usec":0},

"SYS_STATUS":{"msg":{"master_in":1631,"mav_loss":0,"mavpackettype":"META_LINKQUALITY","master_out":81,"packet_loss":0.0},"index":0,"time_usec":0},

"ATTITUDE":{"msg":{"time_boot_ms":39524,"roll":-0.0005137098,"pitch":0.101332434,"yaw":-0.0884948149,"rollspeed":0.00062719523,"pitchspeed":0.00336190779,"yawspeed":-0.00180910469},"index":1,"time_usec":0},

"GPS_RAW_INT":{"msg":{"time_usec":39396000,"lat":-273879911,"lon":1524742717,"alt":108260,"eph":121,"epv":200,"vel":1643,"cog":35987,"fix_type":6,"satellites_visible":10,"alt_ellipsoid":0,"h_acc":200,"v_acc":200,"vel_acc":40,"hdg_acc":0},"index":1,"time_usec":0},

"HEARTBEAT":{"msg":{"custom_mode":10,"type":1,"autopilot":3,"base_mode":217,"system_status":4,"mavlink_version":3},"index":1,"time_usec":0},"

GPS_STATUS":{"msg":null,"index":0,"time_usec":0},"NAV_CONTROLLER_OUTPUT":{"msg":{"nav_roll":4.42,"nav_pitch":5.0,"alt_error":8.53,"aspd_error":571.0385,"xtrack_error":0.0,"nav_bearing":0,"target_bearing":0,"wp_dist":311},"index":1,"time_usec":0},

"META_LINKQUALITY":{"msg":{"master_in":1631,"mav_loss":0,"mavpackettype": "META_LINKQUALITY","master_out":81,"packet_loss":0.0},"index":0,"time_usec":0}}

Reply to Discussion

RSS

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2020   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service