Communicating with drones using different languages (i.e. mavlink for javascript)

Just curious if anyone has tried to use javascript to send mavlink commands to a drone... I am trying to make an HTML5/JS application that will send new waypoints to a drone.  the plan is for it to be mobile and platform independant.  does anyone know if this has been done?  I have seen the C++ implementation and a python implementation.

I also saw what the MAVlink packet looks like, If it came down to it, I guess I could just write some code to create my own packet.  However, I am not trying to reinvent the wheel if I don't need to.

Ideas and suggestions would be gladly accepted :)

Thanks,

Jason

Views: 560

Reply to This

Replies to This Discussion

For our JavaScrip HTML 5 you need a browser that supports Web Sockets http://www.w3.org/TR/2009/WD-websockets-20091222/

Otherwise you need either an intermediary like a web server or plugin for you browser.

Bill, thanks for the websocket advice... I was wondering, once I open the socket, how would I send a message like WAYPOINT_SET_CURRENT.  and how do I specify to use the MAVLink protocol.  Sorry for all the questions, just starting out with this project.  

Jason

FYI, I've issued a pull request to the main mavlink repository that contains code to generate Javascript implementations of the MAVLink protocol.  The work is preliminary and not flight-tested, but it may get you going in the right direction.

Here's the pull request:

https://github.com/mavlink/mavlink/pull/107

And here's our forked repo; the relevant code is in the 'javascript' branch:

https://github.com/acuasi/mavlink

Feedback/questions welcome!

Reply to Discussion

RSS

© 2018   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service