paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] Joystick question


From: Martin Mueller
Subject: Re: [Paparazzi-devel] Joystick question
Date: Sun, 08 May 2011 08:25:16 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10

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.

Martin

On 08.05.2011 07:44, Chris wrote:
Hi.
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]; \
Bound(_out[RADIO_ROLL], MIN_PPRZ, MAX_PPRZ); \
_out[RADIO_PITCH] = (MAX_PPRZ/128) * _in[RADIO_PITCH]; \
Bound(_out[RADIO_PITCH], MIN_PPRZ, MAX_PPRZ); \
_out[RADIO_YAW] = (MAX_PPRZ/128) * _in[RADIO_YAW]; \
Bound(_out[RADIO_YAW], MIN_PPRZ, MAX_PPRZ); \
_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); \
Bound(_out[RADIO_MODE], MIN_PPRZ, MAX_PPRZ); \
}

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>

<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>

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

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?

Chris


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




reply via email to

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