Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Defining custom message - headers issue #869

Open
msadowski opened this issue Sep 23, 2019 · 1 comment
Open

Defining custom message - headers issue #869

msadowski opened this issue Sep 23, 2019 · 1 comment

Comments

@msadowski
Copy link

Hi!

I've just been following the wiki on creating custom messages.

I think exactly the same issue as described here happens when you strictly follow the tutorials. Every generated mavlink.h file defines a header guard as follows:

#pragma once
#ifndef MAVLINK_H
#define MAVLINK_H

This makes it impossible to correctly import a message that is defined in custom_messages.

Let me know if I'm missing something but I feel I've been very thorough when following the wiki!

@hamishwillee
Copy link
Collaborator

hamishwillee commented Sep 24, 2019

@msadowski I think you're probably right.

You can only import a header once, so if mavlink.h already included somewhere else in the module this won't work.

I'm not certain, but the first place I can see this being included is https://github.com/PX4/Firmware/blob/master/src/modules/mavlink/mavlink_bridge_header.h#L89
Could you try this replacing the include from standard to custom_messages version in that file?

@julianoes Can you advise?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants