Growing up metricized (is it a word?) I relate to logics of percentages, tens, hundreds, etc and get put off by some values in the header file like:
"#define THROTTLE_MAX 125 // (0-125) 70 = 56% maximum throttle..."
where 70 = 56%, could this (and some others) be standardized so that each is from 0-100? So if you put in 56 you got 56%? Obviously degrees are 0-360 and are familiar values so no changes needed there.
"#define SERVO_PITCH_P .006" could be 60 and something like "#define HEAD_MAX 4500" could be 45 for 45° (deg) rather than 4500.
I volunteer for this if it's popular but seeing as my maths wasn't that good at school (and that WAS a while ago) it may need to be checked, he he
You need to be a member of diydrones to add comments!
Replies
Yes there are still some main directives that you need to change from code it self but many of the changeable values like PID and things like that are done with Configurator. It runs on top of LabVIEW and one our group member is redoing it with C.
So that could be one solution for this problem...
--jp
Yes, the defines basically are a find and replace for code in Ardupilot. And because some of that, you are exposed to the needs of the micro instead of the needs of the user. This makes Ardupilot run much faster and use less ram.
Doug and I are looking into ways to make it friendlier. Although we could write much of it into EEPROM with the config tool. We would still need to use defines for the compiler to generate the proper code for each setup. My current thinking is to make a GUI - a web page, or a PC tool - that will generate a header file for you, so you don't have to see the ugly numbers. Instead you would see 100% vs 125. (BTW, 125 * 8µs = 1000µs, the range of the servo PWM),
Jason