Skip to content
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

Copter: Support HexadecaOcta (OCTA-X16) #21157

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

muramura
Copy link
Contributor

@muramura muramura commented Jul 9, 2022

#21154

@rmackay9 san
I added the code for HexadecaOcta (OCTA-X16).
I would like to know if this code check is ok.
In SITL, the servo values changed.
But I can't simulate it correctly.

@muramura muramura changed the title Copter: Support hexadeca octa octa x16 Copter: Support hexadecaOcta (octa -X16) Jul 9, 2022
@muramura muramura changed the title Copter: Support hexadecaOcta (octa -X16) Copter: Support HexadecaOcta (OCTA-X16) Jul 9, 2022
@IamPete1
Copy link
Member

IamPete1 commented Jul 9, 2022

I would vote to add support for the motors but not to add a specific frame mix to the C++. Frame mixes can be loaded via scripting and we can provide examples. No one its going to want these on 1M boards (where there is no scripting) and we will probably end up compiling them out to save flash at some point in the future anyway. If we add this these we will get requests for coax octas or H frames and all the other 16 motor variants that will eat more and more flash space.

@IamPete1
Copy link
Member

IamPete1 commented Jul 9, 2022

To work in SITL you will have to add it here:

static Frame supported_frames[] =

Allong with a table of motor layout above.

@muramura
Copy link
Contributor Author

muramura commented Jul 9, 2022

@IamPete1 san. Thank you. I will make the change.

I set FRAME_CLASS to 15: Scripting Matrix.
I create a HexadecaOcta script based on the Scripting Matrix example.
I revert AP_MotorsMatrix.cpp.

FRAME_CLASS:
https://github.com/ArduPilot/ardupilot/blob/master/ArduCopter/Parameters.cpp#L837

Scripting Matrix:
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Scripting/examples/MotorMatrix_fault_tolerant_hex.lua

@muramura muramura force-pushed the AP_Support_HexadecaOcta_OCTA_X16 branch 3 times, most recently from baac546 to 9a45ccd Compare July 10, 2022 02:43
Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Just needs that MAVLink change to get in first I think.

I wonder if anyone would ever want any more than 16. This approach uses very little flash. We could go even past 16... Volocopter uses 18, I don't recall ever seeing more than that.

@@ -66,7 +66,7 @@ const AP_Param::GroupInfo SRV_Channel::var_info[] = {
// @Description: Function assigned to this servo. Setting this to Disabled(0) will setup this output for control by auto missions or MAVLink servo set commands. any other value will enable the corresponding function
// @Values: -1:GPIO,0:Disabled,1:RCPassThru,2:Flap,3:FlapAuto,4:Aileron,6:MountPan,7:MountTilt,8:MountRoll,9:MountOpen,10:CameraTrigger,12:Mount2Pan,13:Mount2Tilt,14:Mount2Roll,15:Mount2Open,16:DifferentialSpoilerLeft1,17:DifferentialSpoilerRight1,19:Elevator,21:Rudder,22:SprayerPump,23:SprayerSpinner,24:FlaperonLeft,25:FlaperonRight,26:GroundSteering,27:Parachute,28:Gripper,29:LandingGear,30:EngineRunEnable,31:HeliRSC,32:HeliTailRSC,33:Motor1,34:Motor2,35:Motor3,36:Motor4,37:Motor5,38:Motor6,39:Motor7,40:Motor8,41:TiltMotorsFront,45:TiltMotorsRear,46:TiltMotorRearLeft,47:TiltMotorRearRight,51:RCIN1,52:RCIN2,53:RCIN3,54:RCIN4,55:RCIN5,56:RCIN6,57:RCIN7,58:RCIN8,59:RCIN9,60:RCIN10,61:RCIN11,62:RCIN12,63:RCIN13,64:RCIN14,65:RCIN15,66:RCIN16,67:Ignition,69:Starter,70:Throttle,71:TrackerYaw,72:TrackerPitch,73:ThrottleLeft,74:ThrottleRight,75:TiltMotorFrontLeft,76:TiltMotorFrontRight,77:ElevonLeft,78:ElevonRight,79:VTailLeft,80:VTailRight,81:BoostThrottle,82:Motor9,83:Motor10,84:Motor11,85:Motor12,86:DifferentialSpoilerLeft2,87:DifferentialSpoilerRight2,88:Winch,89:Main Sail,90:CameraISO,91:CameraAperture,92:CameraFocus,93:CameraShutterSpeed,94:Script1,95:Script2,96:Script3,97:Script4,98:Script5,99:Script6,100:Script7,101:Script8,102:Script9,103:Script10,104:Script11,105:Script12,106:Script13,107:Script14,108:Script15,109:Script16,120:NeoPixel1,121:NeoPixel2,122:NeoPixel3,123:NeoPixel4,124:RateRoll,125:RatePitch,126:RateThrust,127:RateYaw,128:WingSailElevator,129:ProfiLED1,130:ProfiLED2,131:ProfiLED3,132:ProfiLEDClock,133:Winch Clutch,134:SERVOn_MIN,135:SERVOn_TRIM,136:SERVOn_MAX,137:SailMastRotation,138:Alarm,139:Alarm Inverted
// @Values{Plane}: -1:GPIO,0:Disabled,1:RCPassThru,2:Flap,3:FlapAuto,4:Aileron,6:MountPan,7:MountTilt,8:MountRoll,9:MountOpen,10:CameraTrigger,12:Mount2Pan,13:Mount2Tilt,14:Mount2Roll,15:Mount2Open,16:DifferentialSpoilerLeft1,17:DifferentialSpoilerRight1,19:Elevator,21:Rudder,22:SprayerPump,23:SprayerSpinner,24:FlaperonLeft,25:FlaperonRight,26:GroundSteering,27:Parachute,28:Gripper,29:LandingGear,30:EngineRunEnable,33:Motor1,34:Motor2,35:Motor3,36:Motor4,37:Motor5,38:Motor6,39:Motor7/TailTiltServo,40:Motor8,41:TiltMotorsFront,45:TiltMotorsRear,46:TiltMotorRearLeft,47:TiltMotorRearRight,51:RCIN1,52:RCIN2,53:RCIN3,54:RCIN4,55:RCIN5,56:RCIN6,57:RCIN7,58:RCIN8,59:RCIN9,60:RCIN10,61:RCIN11,62:RCIN12,63:RCIN13,64:RCIN14,65:RCIN15,66:RCIN16,67:Ignition,69:Starter,70:Throttle,73:ThrottleLeft,74:ThrottleRight,75:TiltMotorFrontLeft,76:TiltMotorFrontRight,77:ElevonLeft,78:ElevonRight,79:VTailLeft,80:VTailRight,82:Motor9,83:Motor10,84:Motor11,85:Motor12,86:DifferentialSpoilerLeft2,87:DifferentialSpoilerRight2,90:CameraISO,91:CameraAperture,92:CameraFocus,93:CameraShutterSpeed,94:Script1,95:Script2,96:Script3,97:Script4,98:Script5,99:Script6,100:Script7,101:Script8,102:Script9,103:Script10,104:Script11,105:Script12,106:Script13,107:Script14,108:Script15,109:Script16,120:NeoPixel1,121:NeoPixel2,122:NeoPixel3,123:NeoPixel4,124:RateRoll,125:RatePitch,126:RateThrust,127:RateYaw,129:ProfiLED1,130:ProfiLED2,131:ProfiLED3,132:ProfiLEDClock,134:SERVOn_MIN,135:SERVOn_TRIM,136:SERVOn_MAX,138:Alarm,139:Alarm Inverted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need new functions in plane too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add "140:Motor13,141:Motor14,142:Motor15,143:Motor16" to the plane.

@@ -0,0 +1,2 @@
FRAME_CLASS 15
FRAME_TYPE 14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need type with scripting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with CLASS only.

@muramura
Copy link
Contributor Author

@IamPete1 san.
I have a PR about 16; I guess I should also do 18.

mavlink/mavlink#1864

@peterbarker
Copy link
Contributor

Modern ArduCopter allows frames to be compiled out - we do so on low-end boards. Should this just be a static frame config now?

I'm really not fussed either way.

This does need a rebase, @muramura - are you still interested in chasing this one?

@peterbarker peterbarker self-assigned this Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants