Modifying a mavlink message (mission planner source code)

Hi,

 

I am trying to modify the attitude mavlink message in mission planner. What I need to do is just to add 2 more float entries that will be calculated within APM and sent back to mission planner through mavlink. I already did the modification in APM side and generate the headers from the message definition. In mission planner side, I define the two new variables and modify the mavlink.cs located in ExtLib/mavlink folder. I mofiied the message size and added the two new variables at the end of the attitude_t definition. When compiling mission planner I get this error.

 

Error 13 'MAVLink.mavlink_attitude_t' does not contain a definition for 'roll2' and no extension method 'roll2' accepting a first argument of type 'MAVLink.mavlink_attitude_t' could be found (are you missing a using directive or an assembly reference?)  CurrentState.cs

 

Error 14 'MAVLink.mavlink_attitude_t' does not contain a definition for 'pitch2' and no extension method 'pitch2' accepting a first argument of type 'MAVLink.mavlink_attitude_t' could be found (are you missing a using directive or an assembly reference?)  CurrentState.cs

 

It seems that as if I don't include the new values in the attitude_t message but I already did. What mavlink reference does mission planner use to build the project, is it the one I modified ExtLib/mavlink/Mavelink.cs or some other file located in another directory?

 

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer

    the 'MAVLink.mavlink_attitude_t'  struct does not contain a field called roll2, make sure you build the mavlink library, then mission planner. and make sure you did modify the struct

    • Thanks Michael for your help, 'roll2' and 'pitch2' are the new variables I introduce in the attitude_t message. I built the mavlink library. Do I need to modify the struct in the mission planner code? if yes, in which function can I find the struct definition?, because all what I can find in the mission planner code is just a call to raed the messages. I declare the two new variables in "CurrentState.cs" function on the top, the same way that the original 'pitch' and 'roll' are declared.

This reply was deleted.

Activity