multiwii / baseflight

32 bit fork of the MultiWii RC flight controller firmware
499 stars 356 forks source link

Adding new MSP command to GET/SET Flying Wing and Airplane specific parameters #280

Closed Nandox7 closed 9 years ago

Nandox7 commented 9 years ago

Adding a new serial MSP command to get/set parameters related to airplane and flying wing modes. Most of those parameters are currently only available over the cli and identified with the keyword "fw_"

The new MSP exposes them in the following order:

fw_althold_dir fw_roll_throw fw_pitch_throw fw_vector_trust fw_gps_maxcorr fw_gps_rudder fw_gps_maxclimb fw_gps_maxdive fw_climb_throttle fw_cruise_throttle fw_idle_throttle fw_scaler_throttle fw_roll_comp fw_rth_alt (+ 4x extra 32bits spaces added to accommodate future params added)

TODO:

Currently fw_rth_alt uses the P value of POSR (D8[PIDPOSR]) so that it would be easier to set it using a UI. Next step is to move it into it's own parameter in EEPROM and config.

ghost commented 9 years ago

Can one of the admins verify this patch?

trollcop commented 9 years ago

ok to test

cTn-dev commented 9 years ago

When you get a moment, could you beep me on IRC to explain where should be the UI implemented and how should the UI look like for specific options, so i can do it properly? Thanks

trollcop commented 9 years ago

I noticed a couple of things here. First of all, FW_NAV used PID.POSR on multiwii because they abused one of the sliders in old java GUI for it. There's absolutely no reason for us to keep doing such, so I think PID.POSR should be removed and renamed to a separate variable that the rest of the fw_nav code should be fixed to use. Since it seems to be used for rth altitude, perhaps fw_rth_altitude or something would make sense in mcfg or in cfg.

Second, the size of MSP packet should include the 4 reserved uint32s as well.

Perhaps a new PR should be open with these two things.

Nandox7 commented 9 years ago

@cTn-dev sure, I'll do that.

@trollcop yes I noticed that and added it as a TODO item. Didn't want to get too much changes into one single CL specially because it will mess with other parts of the code like the eeprom save/restore.

Btw, is there any guidelines in regards to either use mcfg or a cfg value?

readerror67 commented 9 years ago

Generally, if something is used globally, like a channel map for example, it would belong to mcfg, if its profile specific such as PIDs it would belong to cfg.

When changing profiles only the cfg values are updated.

trollcop commented 9 years ago

ya maybe a separate pr to stop using pidposr and add fw_rth_altitude or something is a good idea. On Jul 1, 2015 12:56 AM, "Nandox7" notifications@github.com wrote:

@cTn-dev https://github.com/cTn-dev sure, I'll do that.

@trollcop https://github.com/trollcop yes I noticed that and added it as a TODO item. Didn't want to get too much changes into one single CL specially because it will mess with other parts of the code like the eeprom save/restore.

Btw, is there any guidelines in regards to either use mcfg or a cfg value?

— Reply to this email directly or view it on GitHub https://github.com/multiwii/baseflight/pull/280#issuecomment-117237429.

Nandox7 commented 9 years ago

Working on it now. I'll use fw_rth_alt as it is what is currently in use by the cli.

cTn-dev commented 9 years ago

Any word on that last MSP cleanup? I would like to release it soon-ish.

Nandox7 commented 9 years ago

Few free time lately I'll see if I can do it today.
There is some stuff to remove.

Nandox7 commented 9 years ago

PR created: https://github.com/multiwii/baseflight/pull/286