paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] sending array message from the ground


From: Pascal Brisset
Subject: Re: [Paparazzi-devel] sending array message from the ground
Date: Wed, 02 Sep 2009 09:18:58 +0200
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Hi,

several problems:
- array values on the ivy bus must be separated with a comma, and length is not required. So your message would be:
   "datalink PATH_SEGMENT 1.0,1.0"
- an ac_id field is required in the message, so your message definition should be
   <message name="PATH_SEGMENT" id="102" link="forwarded">
       <field name="ac_id" type="uint8"/>
       <field name="values" type="float[]"/>
   </message>
- there was a bug in the macro generator (parenthesis were missing); you have to update sw/tools/gen_messages.ml (and execute a global make) Then, the following code, added in datalink.c:80, produces the expected result (in simulation):

   if (msg_id == DL_PATH_SEGMENT) {
     uint8_t n = DL_PATH_SEGMENT_values_length(dl_buffer);
     uint8_t i;
     for(i = 0; i < n; i++)
   fprintf(stderr, "%f ", DL_PATH_SEGMENT_values(dl_buffer)[i]);
     fprintf(stderr, "\n");
   } else


Feel free to document this in the wiki :-) (in the MessageFormat page ?)

--Pascal



address@hidden wrote:
Hi All,

I am getting stuck sending array messages from the ground to the plane. Specifically, I am trying to send the following message (defined in the datalink class in messages.xml):

<message name="PATH_SEGMENT" id="102" link="forwarded">
<field name="values" type="float[]"/>
</message>

In "ivyprobe", I am trying to send:
"datalink PATH_SEGMENT 2 1.0 1.0"

and I get the error from the link program:
Failure("Pprz.values_of_string: incorrect number of fields in 'PATH_SEGMENT 2 1.0 1.0'")
Failure("default_value: Array")

I am not sure where to look to fix this error (I've tried a lot of variations of the message). Finally, I am not sure if I should use link="forwarded" or "broadcasted", or just leave that out of my message definition.

Thanks for any help or other examples of sending array messages (from the ground to the plane)!!
--
Miles
------------------------------------------------------------------------

_______________________________________________
Paparazzi-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]