MAVLink protocol
MAVLink protocol
Hi,
I was thinking, maybe we should replace existing custom serial protocol with MAVLink: http://qgroundcontrol.org/mavlink/start?
The benefits are:
1) Customizable (code generated by definition)
2) Possibility to connect to the QGround control: http://qgroundcontrol.org/users/start
3) Existing Android App http://code.google.com/p/copter-gcs/
...
Does anybody interested in this?
regards,
ziss_dm
I was thinking, maybe we should replace existing custom serial protocol with MAVLink: http://qgroundcontrol.org/mavlink/start?
The benefits are:
1) Customizable (code generated by definition)
2) Possibility to connect to the QGround control: http://qgroundcontrol.org/users/start
3) Existing Android App http://code.google.com/p/copter-gcs/
...
Does anybody interested in this?
regards,
ziss_dm
Re: MAVLink protocol
I would appreciate this.
A step towads unifying the GCS. I use qgroundcontol with the Mega Pirate (Arducopter) Code. GPS-Support and map-display.
And its open source working with linux too.
A step towads unifying the GCS. I use qgroundcontol with the Mega Pirate (Arducopter) Code. GPS-Support and map-display.
And its open source working with linux too.
Re: MAVLink protocol
That would be really cool, great idea
http://www.youtube.com/watch?v=8PwrCuifj0w
btw, is XBEE supported yet? or is there another (cheaper) communication element for greater distances?
Greetings,
Lapino
http://www.youtube.com/watch?v=8PwrCuifj0w
btw, is XBEE supported yet? or is there another (cheaper) communication element for greater distances?
Greetings,
Lapino
Re: MAVLink protocol
Some are using these modules on Megapirate code using mavlink in place of the more expensive xbee's
http://www.goodluckbuy.com/apc220-wirel ... erter.html
http://www.goodluckbuy.com/apc220-wirel ... erter.html
Re: MAVLink protocol
Hey!
I just started to play around with mavlink, i think it should be possible to implement it I do my best, but i don´t have much time at the moment.
I will implement it as EXTRA protocol, so the current protocol to talk with multiwiiconf will not be touched.
The problem is that we don´t have enough ports on the ProMini, so i think in the future we have to use a Flyduino or something equal.
Greetings
Daniel
I just started to play around with mavlink, i think it should be possible to implement it I do my best, but i don´t have much time at the moment.
I will implement it as EXTRA protocol, so the current protocol to talk with multiwiiconf will not be touched.
The problem is that we don´t have enough ports on the ProMini, so i think in the future we have to use a Flyduino or something equal.
Greetings
Daniel
Re: MAVLink protocol
APC 220 is really easy to setup compared to Xbee, I got them both and Xbee was a struggle before I got it working. APC 220 took just a few minutes and they where running. And they are affordable as well :=)
Re: MAVLink protocol
Hey!
What configuration are you using for the apc220? See viewtopic.php?f=6&t=354#p3678
[EDIT:]
Started to implement MavLink this weekend, just playing around a little bit, heartbeat is working, but i think the documentation is very weak, much deadlinks and so on... it will take some time
Greetings
Daniel
What configuration are you using for the apc220? See viewtopic.php?f=6&t=354#p3678
[EDIT:]
Started to implement MavLink this weekend, just playing around a little bit, heartbeat is working, but i think the documentation is very weak, much deadlinks and so on... it will take some time
Greetings
Daniel
Re: MAVLink protocol
So, learning by doing
I have i beadboard with a ArduinoProMini on it. The Testcode is working for me:
, but when i add the lines
then the complete code looks like this:
i get the error:
i am new to arduino and did all programming before with bascom, a basic like programming language can someone explain me how to solve the mistake? i know that i declare the uint16_t len twice, but i dont know how to solve...
I have i beadboard with a ArduinoProMini on it. The Testcode is working for me:
Code: Select all
// Arduino MAVLink test code.
#include <FastSerial.h>
#include "../mavlink/include/mavlink.h" // Mavlink interface
FastSerialPort0(Serial);
void setup() {
Serial.begin(57600);
}
void loop() {
// Define the system type (see mavlink_types.h for list of possible types)
int system_type = MAV_QUADROTOR;
int autopilot_type = MAV_AUTOPILOT_GENERIC;
// Initialize the required buffers
mavlink_message_t msg;
uint8_t buf[MAVLINK_MAX_PACKET_LEN];
// Pack the message
// mavlink_message_heartbeat_pack(system id, component id, message container, system type, MAV_AUTOPILOT_GENERIC)
mavlink_msg_heartbeat_pack(123, 234, &msg, system_type, autopilot_type);
// Copy the message to send buffer
uint16_t len = mavlink_msg_to_send_buffer(buf, &msg);
// Send the message (.write sends as bytes)
Serial.write(buf, len);
comm_receive();
}
void comm_receive() {
mavlink_message_t msg;
mavlink_status_t status;
//receive data over serial
while(Serial.available() > 0) {
uint8_t c = Serial.read();
//try to get a new message
if(mavlink_parse_char(MAVLINK_COMM_0, c, &msg, &status)) {
// Handle message
switch(msg.msgid) {
case MAVLINK_MSG_ID_SET_MODE: {
// set mode
}
break;
case MAVLINK_MSG_ID_ACTION:
// EXECUTE ACTION
break;
default:
//Do nothing
break;
}
}
// And get the next one
}
delay(500);
}
, but when i add the lines
Code: Select all
//try to set some values
int xacc = 10;
int yacc = 11;
int zacc = 12;
int xgyro = 100;
int ygyro = 101;
int zgyro = 102;
int xmag = 200;
int ymag = 201;
int zmag = 202;
mavlink_msg_raw_imu_pack(100, 200, &msg, 0, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag);
uint16_t len = mavlink_msg_to_send_buffer(buf, &msg);
// Send the message (.write sends as bytes)
Serial.write(buf, len);
then the complete code looks like this:
Code: Select all
// Arduino MAVLink test code.
#include <FastSerial.h>
#include "../mavlink/include/mavlink.h" // Mavlink interface
FastSerialPort0(Serial);
void setup() {
Serial.begin(57600);
}
void loop() {
// Define the system type (see mavlink_types.h for list of possible types)
int system_type = MAV_QUADROTOR;
int autopilot_type = MAV_AUTOPILOT_GENERIC;
// Initialize the required buffers
mavlink_message_t msg;
uint8_t buf[MAVLINK_MAX_PACKET_LEN];
// Pack the message
// mavlink_message_heartbeat_pack(system id, component id, message container, system type, MAV_AUTOPILOT_GENERIC)
mavlink_msg_heartbeat_pack(123, 234, &msg, system_type, autopilot_type);
// Copy the message to send buffer
uint16_t len = mavlink_msg_to_send_buffer(buf, &msg);
// Send the message (.write sends as bytes)
Serial.write(buf, len);
//try to set some values
int xacc = 10;
int yacc = 11;
int zacc = 12;
int xgyro = 100;
int ygyro = 101;
int zgyro = 102;
int xmag = 200;
int ymag = 201;
int zmag = 202;
mavlink_msg_raw_imu_pack(100, 200, &msg, 0, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag);
uint16_t len = mavlink_msg_to_send_buffer(buf, &msg);
// Send the message (.write sends as bytes)
Serial.write(buf, len);
comm_receive();
}
void comm_receive() {
mavlink_message_t msg;
mavlink_status_t status;
//receive data over serial
while(Serial.available() > 0) {
uint8_t c = Serial.read();
//try to get a new message
if(mavlink_parse_char(MAVLINK_COMM_0, c, &msg, &status)) {
// Handle message
switch(msg.msgid) {
case MAVLINK_MSG_ID_SET_MODE: {
// set mode
}
break;
case MAVLINK_MSG_ID_ACTION:
// EXECUTE ACTION
break;
default:
//Do nothing
break;
}
}
// And get the next one
}
delay(500);
}
i get the error:
Code: Select all
ArduinoMAVLink.cpp: In function 'void loop()':
ArduinoMAVLink:43: error: redeclaration of 'uint16_t len'
ArduinoMAVLink:25: error: 'uint16_t len' previously declared here
i am new to arduino and did all programming before with bascom, a basic like programming language can someone explain me how to solve the mistake? i know that i declare the uint16_t len twice, but i dont know how to solve...
Re: MAVLink protocol
As it says...
You have declared uint16_t len Two times in loop()
Remove uint16_t at the second place.
Leaving it like this.
Code: Select all
error: redeclaration of 'uint16_t len'
You have declared uint16_t len Two times in loop()
Remove uint16_t at the second place.
Leaving it like this.
Code: Select all
len = mavlink_msg_to_send_buffer(buf, &msg);
Re: MAVLink protocol
i have setup a little project to send and forward mwi data over MAVLink protocol , here are the source :
http://code.google.com/p/mwi-gc/
for the moment : read raw imu ,attitude, rc data , etc ... display HUD and roll/pitch angle over video feed , etc , etc .. readonly
a short test video viewtopic.php?f=9&t=1610
http://code.google.com/p/mwi-gc/
for the moment : read raw imu ,attitude, rc data , etc ... display HUD and roll/pitch angle over video feed , etc , etc .. readonly
a short test video viewtopic.php?f=9&t=1610
Re: MAVLink protocol
HI:
I can compile your code on Linux?
if yes please provide me how to , tools and lib I need it to do it
thanks
jc
I can compile your code on Linux?
if yes please provide me how to , tools and lib I need it to do it
thanks
jc
Re: MAVLink protocol
sorry for the late response
the project moved to github
the code now work with latest multiwii 2.3 .. minimal support
you also have an example.c
if you need to build for linux :
the project moved to github
the code now work with latest multiwii 2.3 .. minimal support
you also have an example.c
if you need to build for linux :
git clone https://github.com/treymarc/multiwii-mavlink-gc.git
cd multiwii-mavlink-gc
make
./src/udp/mwgc --help
Re: MAVLink protocol
juanquy wrote:HI:
I can compile your code on Linux?
you dont need anything special , no extra lib, both windows or linux , just type "make"
https://github.com/treymarc/multiwii-mavlink-gc/wiki
MAVLink protocol
It works great on OSX as well.
MAVLink protocol
Hi trey,
at first I should say I am a beginner at the topic multicopter and then to my task I should controle a Flexbot (MultWii 2.2) with MAVLink and I hope that I can use your program.
Unfortunately, I just failing when compiling the makefile.
I use a computer with windows 10 - 64 bit, install MinGW and added the Path to the enviromentvariable but I get allwas an Error wenn I would compile the makefile (see picture).
Could you or someone else help me?
Thanks and best regards Alex
at first I should say I am a beginner at the topic multicopter and then to my task I should controle a Flexbot (MultWii 2.2) with MAVLink and I hope that I can use your program.
Unfortunately, I just failing when compiling the makefile.
I use a computer with windows 10 - 64 bit, install MinGW and added the Path to the enviromentvariable but I get allwas an Error wenn I would compile the makefile (see picture).
Could you or someone else help me?
Thanks and best regards Alex
-
- Posts: 103
- Joined: Fri Dec 12, 2014 5:16 pm
Re: MAVLink protocol
LexxSbg, Here is something that might be of interest to you: https://github.com/rpicopter/mw-mavlink
Though it requires an extra SoC to be carried.
It implements mavlink and works with QGroundControl (though no WayPoint navigation yet).
Though it requires an extra SoC to be carried.
It implements mavlink and works with QGroundControl (though no WayPoint navigation yet).
Re: MAVLink protocol
Hi gregd72002,
thanks for your answer! But wenn i understand this git-link correctly than I need to attach a raspberry pi ( wich is connect with the flighcontrol about USART) on the drone for this solution or? The Flexbot is only a microdrone and can`t handle that.
thanks for your answer! But wenn i understand this git-link correctly than I need to attach a raspberry pi ( wich is connect with the flighcontrol about USART) on the drone for this solution or? The Flexbot is only a microdrone and can`t handle that.
Re: MAVLink protocol
Hi,
I'm quite lost here in order how to setup the Multiwii to use mavlink.
Is connection like MW FC ->Receiver --------------------------------------Transmitter->PC ?
Is Rx and Tx responsible to implement mavlink? and MW FC simply send data via MSP to Rx?
Tx then send mavlink data to PC and display it using Treymarc's mavlink implementation, is that right?
I'm really interesting to use Ultimate Lrs with Multiwii , here is the link : http://www.rcgroups.com/forums/showthread.php?t=2037442
Unfortunatelly, it only support mavlink right now, no frsky.
Thank You.
I'm quite lost here in order how to setup the Multiwii to use mavlink.
Is connection like MW FC ->Receiver --------------------------------------Transmitter->PC ?
Is Rx and Tx responsible to implement mavlink? and MW FC simply send data via MSP to Rx?
Tx then send mavlink data to PC and display it using Treymarc's mavlink implementation, is that right?
I'm really interesting to use Ultimate Lrs with Multiwii , here is the link : http://www.rcgroups.com/forums/showthread.php?t=2037442
Unfortunatelly, it only support mavlink right now, no frsky.
Thank You.
-
- Posts: 103
- Joined: Fri Dec 12, 2014 5:16 pm
Re: MAVLink protocol
hi trogalko,
MultiWii (MW) does not implement MAVLink but something that is called MSP. MSP is different to MAVLink and would require translation.
I've worked on such translation program previously (https://github.com/rpicopter/mw-mavlink) but this require an auxiliary SOC like Odroid/Beaglebone/RPi.
So your communication would look like:
MultiWii<-----[msp]------->SOC<------[mavlink]-------->PC
MultiWii (MW) does not implement MAVLink but something that is called MSP. MSP is different to MAVLink and would require translation.
I've worked on such translation program previously (https://github.com/rpicopter/mw-mavlink) but this require an auxiliary SOC like Odroid/Beaglebone/RPi.
So your communication would look like:
MultiWii<-----[msp]------->SOC<------[mavlink]-------->PC
Re: MAVLink protocol
gregd72002 wrote:hi trogalko,
MultiWii (MW) does not implement MAVLink but something that is called MSP. MSP is different to MAVLink and would require translation.
I've worked on such translation program previously (https://github.com/rpicopter/mw-mavlink) but this require an auxiliary SOC like Odroid/Beaglebone/RPi.
So your communication would look like:
MultiWii<-----[msp]------->SOC<------[mavlink]-------->PC
Thanks gregd72002, if only I had rpi zero ( only 9 gram) compared to rpi a (31 gram). So in order to translate msp to mavlink, I would require two uart(s) port on rpi or similar (banana/orange pi), one build-in, another one using usb to ttl right?
Well, this seem interesting to try.
-
- Posts: 103
- Joined: Fri Dec 12, 2014 5:16 pm
Re: MAVLink protocol
RPi Zero, this is what I'm using on my 250 copter and Odroid on my 550 copter.
You would need indeed 2 serial ports if you want to use LRS:
RPi<->MW
RPi<->LRS
I'm actually waiting for my OrangeRX LRS to arrive as I intend to do exactly what you are trying to do.
RPi has only single serial port so to get second one I will be using:
- USB to TTL converter (http://www.ebay.co.uk/itm/261888018066) - should be easy to desolder the usb plug to save space
- or SPI/I2C to TTL converter (SC16IS750)
You would need indeed 2 serial ports if you want to use LRS:
RPi<->MW
RPi<->LRS
I'm actually waiting for my OrangeRX LRS to arrive as I intend to do exactly what you are trying to do.
RPi has only single serial port so to get second one I will be using:
- USB to TTL converter (http://www.ebay.co.uk/itm/261888018066) - should be easy to desolder the usb plug to save space
- or SPI/I2C to TTL converter (SC16IS750)