Determining the SystemID of the GCS and the vehicle

1,129 views
Skip to first unread message

arthur

unread,
Apr 4, 2015, 12:35:23 PM4/4/15
to mav...@googlegroups.com
I'm currently writing middleware that will sit between an ARDrone 2.0
and QGroundControl (v2.2.0).

My middleware needs to be able to send messages both to the Copter, and
to the GCS, as such I need to be able to determine the System ID's of both.

Here are the initial mavlink messages sent between the GCS and the Copter:

   GCS: SYS: 255, COMP: 255, LEN:  0, MSG ID: 255
   GCS: SYS: 255, COMP: 255, LEN:  0, MSG ID: 255
COPTER: SYS:   1, COMP: 190, LEN: 28, MSG ID:  30  //ATTITUDE
COPTER: SYS:   1, COMP: 190, LEN: 28, MSG ID:  33  //GLOBAL_POSITION_INT

QGroundControl is sending empty messages with an ID of 255 to system
255, how has this ID been determined? This doesn't appear to be a
"broadcast" address as it does not change for messages sent later.

Why isn't MAV_COMP_ID_ALL (0) used for the component ID?

The Copter replies to System ID 1, how has it determined the ID of the GCS?

Thanks!

Arthur

Bill Bonney

unread,
Apr 4, 2015, 12:49:39 PM4/4/15
to mav...@googlegroups.com
The drone determines the ID of the sender from the received packaet. It’s type is also sent indicating its a GCS.

It seems that you need to set the COMP_ID to 1 in most cases as the autpilots/ArDrone are not allowing for a comp_id of 1 (I think IIRC QGC has this restriction in the param manager) it doesn’t like a comp_id of 0

Bill


--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "MAVLink" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an mavlink+u...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

arthur

unread,
Apr 4, 2015, 1:16:40 PM4/4/15
to mav...@googlegroups.com
Thanks for the clarification! Do you know what packet type contains the system ID of the sender? The only packets I can see are either of type 33, 30, 24, or 0, and according to https://pixhawk.ethz.ch/mavlink/ none of these have a sender ID field.

The ARDrone seems to be hardcoded to think that the Comp ID of GCS is 190 (MAV_COMP_ID_MISSIONPLANNER), but QGroundControl does send packets with a destination Comp ID of 0 (MAV_COMP_ID_ALL) after the inital messages of type 255.

Arthur

Bill Bonney

unread,
Apr 4, 2015, 1:29:19 PM4/4/15
to mav...@googlegroups.com
Hi

see http://qgroundcontrol.org/mavlink/start (scroll down a bit) the sys bit is the sender id

MAVLink packet

Bill

Bill Bonney

unread,
Apr 4, 2015, 1:40:26 PM4/4/15
to mav...@googlegroups.com
And if you wnat to know what structure its in, it the one you get back from 

mavlink_parse_char

see

typedef struct __mavlink_message {
	uint16_t checksum; ///< sent at end of packet
	uint8_t magic;   ///< protocol magic marker
	uint8_t len;     ///< Length of payload
	uint8_t seq;     ///< Sequence of packet
	uint8_t sysid;   ///< ID of message sender system/aircraft
	uint8_t compid;  ///< ID of the message sender component
	uint8_t msgid;   ///< ID of message in payload
	uint64_t payload64[(MAVLINK_MAX_PAYLOAD_LEN+MAVLINK_NUM_CHECKSUM_BYTES+7)/8];
} mavlink_message_t;


On Apr 4, 2015, at 10:28, Bill Bonney <billb...@communistech.com> wrote:

Hi

see http://qgroundcontrol.org/mavlink/start (scroll down a bit) the sys bit is the sender id

<mavlink-packet.png>

arthur

unread,
Apr 4, 2015, 2:28:39 PM4/4/15
to mav...@googlegroups.com
Hi,

Ah right, thanks for clearing that up - I'd somehow got in my head that the ID's were all of the target system, and not of the sending one!

Arthur
Reply all
Reply to author
Forward
0 new messages