-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[radio control] spektrum also usable for intermcu #847
Conversation
@dewagter could you test this? |
CDW still "out of office" ;), I'm in, but swamped with tasks. Next week more validation possible. |
@gautierhattenberger how does this look to you? |
It looks okay, but I still don't know (or forgot) why we don't use a generic spektrum radio file, just to generate the list of channel at the same place than other systems ? Will it help to do that in this case ? |
Well, at least in my opinion you shouln't need to specify a radio xml file for spektrum at all... |
Well... funny thing is that actually the radio xml is not mandatory to build an aircraft (nor flight plan, but others are). You can try:
The "problem" is that if you open the aircraft in paparazzicenter, the radio attribute will be added again with the default value, and their is no way unselect it from there. An empty value for the attribute will also fail currently, and you can't really do that from the GUI anyway. |
Maybe we can treat and empty radio attribute the same way as if there is none? |
radio.h is used in all radio_control files except spektrum. is it a problem to have a spektrum.xml radio file instead of header file hardcoded values just as all other radios? |
Christopher, The only reason why the spectrum values are hardcoded is because they cannot be changed in the hardware. The various models of transmitter will always map the function of a stick or switch to the same channel number even across various modes of transmitter (mode 1 , mode 2 and mode 3). For instance, say you fly using a transmitter with the throttle on the left stick and I fly one with throttle on the right stick then as long as both of us are using spektrum transmitters the throttle stick on both transmitters will map to channel 1 in paparazzi and we can swap transmitters with a rebind without changing paparazzi configuration. If spektrum where to diverge from this then there receivers would no longer work across their range. The reason I hardwired the values was for simplicity in that it required zero configuration in order to work. To answer to your question from a technical point is that it is not a problem to have an XML file. Eric On 24 Oct 2014, at 9:37 am, Christophe De Wagter notifications@github.com wrote:
|
As Eric explained the radio xml files is neiter needed nor used or useful for spektrum. I see zero benefit in using the generated/radio.h file for spektrum and the only case when it was actually included in the code was the fixedwing intermcu. So IMHO if we now suddenly start using only some information from the radio.xml file for spektrum, it just makes things a lot worse:
Unfortunaltely the ocam sim still want's to read a radio.xml file if you want to simulate the RC there... Now the actual problems/questions with radio control in dual mcu case are:
In this pull request that is "solved" by adding the appropriate radio_control subsystem to the ap target as well (simply add it for the whole firmware instead of only fbw target). Now for the number of channels we could also introduce a separate option/define to configure how many you want to send to ap instead of defining Or is there some advantage of using the radio.xml file for spektrum that I'm missing?? |
[radio control] spektrum also usable for intermcu You have to add the radio_control subsystem to the ap target as well in order to get the RADIO_CONTROL_TYPE_H define to load the correct implementation header so we get the RADIO_CONTROL_NB_CHANNEL and channel names. For spektrum you might have to define RADIO_CONTROL_NB_CHANNEL in your airframe file to something less than 10 to use it with the uart inter_mcu.
Alternative to #843
You have to add the radio_control subsystem to the ap target as well in order to get the
RADIO_CONTROL_TYPE_H
define to load the correct implementation header so we get theRADIO_CONTROL_NB_CHANNEL
.For spektrum you might have to define
RADIO_CONTROL_NB_CHANNEL
in your airframe file to something less than 10 to use it with the uart inter_mcu.