[Top][All Lists]

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

Re: [Paparazzi-devel] Joystick question

From: Gautier Hattenberger
Subject: Re: [Paparazzi-devel] Joystick question
Date: Mon, 09 May 2011 17:54:22 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110223 Thunderbird/3.1.8


I think that sending the RC_3CH with the XBee api mode takes probably more bandwidth than sending the RC_4CH with transparent mode. For now, it is not possible to use the RC_3CH with input2ivy as it doesn't have an ac_id field that is mandatory with it. As Martin said, it is much better to send the mode each time. When you have a joystick and that you want to use buttons to set the mode, it is possible by declaring a "variable". Look in the file attack3_booz_nav.xml for an example. I will probably make a proper DTD file and a wiki page some day to explain how it works...


On 08/05/2011 08:25, Martin Mueller wrote:
Hi Chris,

the original idea for joystick was to have a very short transmission time. It turned out that the first implemented RC_3CH message takes 1ms to transmit as XBee broadcast message (measured with a HF meter). Most of that time is guard time, addressing and checksums. An additional byte only takes some tens of microseconds to transmit.

The mode information is vital to the message. If mode change information is lost and the aircraft interprets auto1 controls as manual controls you could have an issue.

For RC_3CH the mode was encoded into the throttle byte. As long as you do not want to do 3D hovering UAVs should be fine with a 6-bit only throttle resolution.


On 08.05.2011 07:44, Chris wrote:
I finally made everything work well with my Saitek Aviator and i also
made some changes
that aim in reducing modem bandwidth so i need to ask for your opinion
on those.

1) added a variable to the rc_datalink.h and .c files
("datalink_pprz_mode") that controls the autopilot's mode:

extern volatile int8_t datalink_pprz_mode;

#define NormalizeRcDl(_in, _out) { \
_out[RADIO_ROLL] = (MAX_PPRZ/128) * _in[RADIO_ROLL]; \
_out[RADIO_PITCH] = (MAX_PPRZ/128) * _in[RADIO_PITCH]; \
_out[RADIO_YAW] = (MAX_PPRZ/128) * _in[RADIO_YAW]; \
_out[RADIO_THROTTLE] = ((MAX_PPRZ/255)*(127+ _in[RADIO_THROTTLE])); \
Bound(_out[RADIO_THROTTLE], 0, MAX_PPRZ); \
_out[RADIO_MODE] = MAX_PPRZ * (datalink_pprz_mode - 1); \

2) The variable was added to the settings.xml file and the joystick .xml
file was configured to change the variable like this:

<message class="ground" name="DL_SETTING" on_event="stick_right_button">
<field name="index" value="IndexOfSetting(datalink_pprz_mode)"/>
<field name="value" value="2"/>

<message class="ground" name="DL_SETTING" on_event="stick_center_button">
<field name="index" value="IndexOfSetting(datalink_pprz_mode)"/>
<field name="value" value="1"/>

<message class="ground" name="DL_SETTING" on_event="stick_left_button">
<field name="index" value="IndexOfSetting(datalink_pprz_mode)"/>
<field name="value" value="0"/>

That way i don't need the "MODE" portion of the RC_4CH message so the
message length is now reduced by one byte and since that particular
message is repeated at a high rate this should reduce bandwidth usage,
am i correct or i dont gain anything by doing that?


Paparazzi-devel mailing list

Paparazzi-devel mailing list

reply via email to

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