Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.

MAVLink Integration - starter example

0 votes

I have a basic working version of a mavlink component with a test module. Tested on both host and platform. Can be expanded easily for more parameters and messages. Remember to assign an empty string to serialdev or usbserialdev in params.cfg for the serial port you intend to use for MAVLink (or hard code an empty string ("") in Engine.H against the macro name if that doesn't work)

Relevant folders

jevoisbase/Components/MAVLink
jevoisbase/include/mavlink
jevoisbase/Modules/MAVLinkTest

You can find it on my fork (MAVLink branch) here. And corresponding jevois core branch here (required for added functions in Serial core component, which have been submitted to upstream jevois repo). 

- Again this is work in progress and more clean-up is required before merging it to master, but thought of putting it here to let others know of it. 

asked Jul 2 in Programmer Questions by alsaibie (640 points)

3 Answers

0 votes
Looks very nice! For those (like me) not familiar with mavlink, what are application scenarios for your module? Detect objects in JeVois and send their info to a drone controller?
answered Jul 3 by JeVois (13,610 points)
You can use the JeVois to control the vehicle with high level instructions like 'Go there at this speed'' and the flight controler will take care of the rest. Thanks to Ali, for this valuable module allowing to send various mavlink messages directly to the Flight Controlers.  Take a look at  the different Mavlink messages, the one I am particularly interested in is Landing_Target, that control the quad to land on a color blob or on a Tag , you will notice the direct relationship with JeVois 2D serial  message
http://mavlink.org/messages/common#LANDING_TARGET
The widely used APM and PX4 stacks use MAVLink to communicate between sensors, autopilots and the ground control station. For example, there is a PX4Flow sensor that is used to maintain horizontal positioning in gps-denied environments. Jevois can potentially replicate that feature (perhaps faster, but it doesn't carry a gyro like px4flow), and as long as the mavlink messages are of the same definitions, the autopilot can pick up and use the readings right off the bat. You can also download QGroundControl and connect to jevois and be able to plot and log real time values. And as Patrick pointed out, you can have jevois be the more capable HL controller receiving sensor readings from an autopilot and sending position commands back.

I plan to use it for my research: underwater pose estimation and HL navigator. Will see how that goes.
0 votes

This is my testing setup, using the RaspberryPI as the serial to mavlink gateway.

The Jevois is doing object tracking on the red ball and sends coordinates to serial port

RasberryPi2 is running DroneKit Python, reading x-y coordinates , scale & adjust and send message Landing Target over to the Simulator (SITL) running on the left computer using serial ports (you can see the FTDI flashing between the screen and computer)

SITL is a fully compliant Ardupilot Simulator, so it is configure to run precision Loiter and Landing. I can takeoff and control the fly direction by moving the Red Ball on front of camera.

The simulator also output Mavlink to UDP so that the computer at the right that is running the Analyse Widget from QGroundControl. It is reading the Landing Target x & y message and graph the Red Ball movement being detected by JeVois.

Next step, is obviously to use the Mavlink Module and discarding the RaspBerry Pi.

answered Jul 4 by patrickpoirier (320 points)
Great! The component should be setup to do just that. Let me know how it goes. Keep us updated.
0 votes
looks like the Serial.C changes have been merged in to master, which is great.
answered Jul 11 by auturgy (200 points)
...