Commit 81844493 authored by Baptiste Toussaint's avatar Baptiste Toussaint
Browse files

Merge branch 'joystick_mapping' into 'master'

Joystick mapping

See merge request polystar/robomaster/controle/controle-et-systeme!5
parents 980fc3d0 62446260
Subproject commit 7b0df409c4e2a51a1647057b614ceb8bac13994d Subproject commit 987c2759314ffc01f6de6722705dc251de096143
...@@ -110,8 +110,8 @@ ...@@ -110,8 +110,8 @@
<MDIClientArea> <MDIClientArea>
<RegID>0</RegID> <RegID>0</RegID>
<MDITabState> <MDITabState>
<Len>784</Len> <Len>1136</Len>
<Data>01000000040000000100000001000000010000000100000000000000020000000000000001000000010000000000000028000000280000000100000007000000000000000100000038433A5C55736572735C42617074697374655C4465736B746F705C5361757665676172646520506F6C79737461725C5372635C6D61696E2E6300000000066D61696E2E6300000000C5D4F200FFFFFFFF41433A5C55736572735C42617074697374655C4465736B746F705C5361757665676172646520506F6C79737461725C4253505C416C676F726974686D5C7069642E6300000000057069642E6300000000FFDC7800FFFFFFFF42433A5C55736572735C42617074697374655C4465736B746F705C5361757665676172646520506F6C79737461725C4253505C4472697665725C6273705F70776D2E6800000000096273705F70776D2E6800000000BECEA100FFFFFFFF42433A5C55736572735C42617074697374655C4465736B746F705C5361757665676172646520506F6C79737461725C4253505C4472697665725C6273705F70776D2E6300000000096273705F70776D2E6300000000F0A0A100FFFFFFFF38433A5C55736572735C42617074697374655C4465736B746F705C5361757665676172646520506F6C79737461725C496E635C6D61696E2E6800000000066D61696E2E6800000000BCA8E100FFFFFFFF40433A5C55736572735C42617074697374655C4465736B746F705C5361757665676172646520506F6C79737461725C4253505C4465766963655C6D6F746F722E6300000000076D6F746F722E63000000009CC1B600FFFFFFFF40433A5C55736572735C42617074697374655C4465736B746F705C5361757665676172646520506F6C79737461725C4253505C4465766963655C6D6F746F722E6800000000076D6F746F722E6800000000F7B88600FFFFFFFF0100000010000000C5D4F200FFDC7800BECEA100F0A0A100BCA8E1009CC1B600F7B88600D9ADC200A5C2D700B3A6BE00EAD6A300F6FA7D00B5E99D005FC3CF00C1838300CACAD500010000000000000002000000850100006600000056050000DB010000</Data> <Data>01000000040000000100000001000000010000000100000000000000020000000000000001000000010000000000000028000000280000000100000009000000000000000100000049433A5C55736572735C42617074697374655C446F63756D656E74735C636F6E74726F6C652D65742D73797374656D655C5374616E646172645F726F626F745C5372635C6D61696E2E6300000000066D61696E2E6300000000C5D4F200FFFFFFFF52433A5C55736572735C42617074697374655C446F63756D656E74735C636F6E74726F6C652D65742D73797374656D655C5374616E646172645F726F626F745C4253505C416C676F726974686D5C7069642E6300000000057069642E6300000000FFDC7800FFFFFFFF53433A5C55736572735C42617074697374655C446F63756D656E74735C636F6E74726F6C652D65742D73797374656D655C5374616E646172645F726F626F745C4253505C4472697665725C6273705F70776D2E6800000000096273705F70776D2E6800000000BECEA100FFFFFFFF53433A5C55736572735C42617074697374655C446F63756D656E74735C636F6E74726F6C652D65742D73797374656D655C5374616E646172645F726F626F745C4253505C4472697665725C6273705F70776D2E6300000000096273705F70776D2E6300000000F0A0A100FFFFFFFF49433A5C55736572735C42617074697374655C446F63756D656E74735C636F6E74726F6C652D65742D73797374656D655C5374616E646172645F726F626F745C496E635C6D61696E2E6800000000066D61696E2E6800000000BCA8E100FFFFFFFF51433A5C55736572735C42617074697374655C446F63756D656E74735C636F6E74726F6C652D65742D73797374656D655C5374616E646172645F726F626F745C4253505C4465766963655C6D6F746F722E6300000000076D6F746F722E63000000009CC1B600FFFFFFFF51433A5C55736572735C42617074697374655C446F63756D656E74735C636F6E74726F6C652D65742D73797374656D655C5374616E646172645F726F626F745C4253505C4465766963655C6D6F746F722E6800000000076D6F746F722E6800000000F7B88600FFFFFFFF56433A5C55736572735C42617074697374655C446F63756D656E74735C636F6E74726F6C652D65742D73797374656D655C5374616E646172645F726F626F745C4253505C4465766963655C6C6973745F6D6F746F722E63000000000D6C6973745F6D6F746F722E632A00000000D9ADC200FFFFFFFF56433A5C55736572735C42617074697374655C446F63756D656E74735C636F6E74726F6C652D65742D73797374656D655C5374616E646172645F726F626F745C4253505C4465766963655C6C6973745F6D6F746F722E68000000000C6C6973745F6D6F746F722E6800000000A5C2D700FFFFFFFF0100000010000000C5D4F200FFDC7800BECEA100F0A0A100BCA8E1009CC1B600F7B88600D9ADC200A5C2D700B3A6BE00EAD6A300F6FA7D00B5E99D005FC3CF00C1838300CACAD500010000000000000002000000850100006600000056050000DB010000</Data>
</MDITabState> </MDITabState>
</MDIClientArea> </MDIClientArea>
<ViewEx> <ViewEx>
...@@ -1806,7 +1806,7 @@ ...@@ -1806,7 +1806,7 @@
<Name>File</Name> <Name>File</Name>
<Buttons> <Buttons>
<Len>2603</Len> <Len>2603</Len>
<Data>00200000010000002800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000040004000000000000000000000000000000000100000001000000018022E100000000040005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000000000700000000000000000000000000000000010000000100000001802CE10000000004000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000004000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000004000C0000000000000000000000000000000001000000010000000180F4B00000000004000D000000000000000000000000000000000100000001000000018036B10000000004000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF88000000000400460000000000000000000000000000000001000000010000000180FE880000000004004500000000000000000000000000000000010000000100000001800B810000000004001300000000000000000000000000000000010000000100000001800C810000000004001400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F0880000020000000F000000000000000000000000000000000100000001000000FFFF0100120043555646696E64436F6D626F427574746F6EE803000000000000000000000000000000000000000000000001000000010000009600000002002050000000000F4D333530385F7069645F7370656564960000000000000004000F4D333530385F7069645F7370656564056863616E320665787465726E05416464547800000000000000000000000000000000018024E10000000000001100000000000000000000000000000000010000000100000001800A810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E2280000002000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B46350000000000000000000000000100000001000000000000000000000001000000020021802280000000000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B4635000000000000000000000000010000000100000000000000000000000100000000002180E0010000000000007500000021456E65726779204D6561737572656D656E742026776974686F75742044656275670000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000160000000000000000000000000000000001000000010000000180C988000000000400180000000000000000000000000000000001000000010000000180C788000000000000190000000000000000000000000000000001000000010000002180C8880000000000001700000027264B696C6C20416C6C20427265616B706F696E747320696E2043757272656E7420546172676574000000000000000000000000010000000100000000000000000000000100000003002180C8880000000000001700000027264B696C6C20416C6C20427265616B706F696E747320696E2043757272656E7420546172676574000000000000000000000000010000000100000000000000000000000100000000002180E50100000000000078000000264B696C6C20416C6C20427265616B706F696E747320696E204163746976652050726F6A656374000000000000000000000000010000000100000000000000000000000100000000002180E601000000000000790000002F4B696C6C20416C6C20427265616B706F696E747320696E204D756C74692D50726F6A65637420576F726B73706163650000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000021804C010000020001001A0000000F2650726F6A6563742057696E646F77000000000000000000000000010000000100000000000000000000000100000008002180DD880000000000001A0000000750726F6A656374000000000000000000000000010000000100000000000000000000000100000000002180DC8B0000000000003A00000005426F6F6B73000000000000000000000000010000000100000000000000000000000100000000002180E18B0000000000003B0000000946756E6374696F6E73000000000000000000000000010000000100000000000000000000000100000000002180E28B000000000000400000000954656D706C6174657300000000000000000000000001000000010000000000000000000000010000000000218018890000000000003D0000000E536F757263652042726F777365720000000000000000000000000100000001000000000000000000000001000000000021800000000000000400FFFFFFFF00000000000000000001000000000000000100000000000000000000000100000000002180D988000000000000390000000C4275696C64204F7574707574000000000000000000000000010000000100000000000000000000000100000000002180E38B000000000000410000000B46696E64204F75747075740000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001B000000000000000000000000000000000100000001000000000000000446696C65C6030000</Data> <Data>00200000010000002800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000040004000000000000000000000000000000000100000001000000018022E100000000040005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000004000700000000000000000000000000000000010000000100000001802CE10000000004000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000004000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000004000C0000000000000000000000000000000001000000010000000180F4B00000000004000D000000000000000000000000000000000100000001000000018036B10000000004000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF88000000000400460000000000000000000000000000000001000000010000000180FE880000000004004500000000000000000000000000000000010000000100000001800B810000000004001300000000000000000000000000000000010000000100000001800C810000000004001400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F0880000020000000F000000000000000000000000000000000100000001000000FFFF0100120043555646696E64436F6D626F427574746F6EE803000000000000000000000000000000000000000000000001000000010000009600000002002050000000000F4D333530385F7069645F7370656564960000000000000004000F4D333530385F7069645F7370656564056863616E320665787465726E05416464547800000000000000000000000000000000018024E10000000000001100000000000000000000000000000000010000000100000001800A810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E2280000002000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B46350000000000000000000000000100000001000000000000000000000001000000020021802280000000000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B4635000000000000000000000000010000000100000000000000000000000100000000002180E0010000000000007500000021456E65726779204D6561737572656D656E742026776974686F75742044656275670000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000160000000000000000000000000000000001000000010000000180C988000000000400180000000000000000000000000000000001000000010000000180C788000000000000190000000000000000000000000000000001000000010000002180C8880000000000001700000027264B696C6C20416C6C20427265616B706F696E747320696E2043757272656E7420546172676574000000000000000000000000010000000100000000000000000000000100000003002180C8880000000000001700000027264B696C6C20416C6C20427265616B706F696E747320696E2043757272656E7420546172676574000000000000000000000000010000000100000000000000000000000100000000002180E50100000000000078000000264B696C6C20416C6C20427265616B706F696E747320696E204163746976652050726F6A656374000000000000000000000000010000000100000000000000000000000100000000002180E601000000000000790000002F4B696C6C20416C6C20427265616B706F696E747320696E204D756C74692D50726F6A65637420576F726B73706163650000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000021804C010000020001001A0000000F2650726F6A6563742057696E646F77000000000000000000000000010000000100000000000000000000000100000008002180DD880000000000001A0000000750726F6A656374000000000000000000000000010000000100000000000000000000000100000000002180DC8B0000000000003A00000005426F6F6B73000000000000000000000000010000000100000000000000000000000100000000002180E18B0000000000003B0000000946756E6374696F6E73000000000000000000000000010000000100000000000000000000000100000000002180E28B000000000000400000000954656D706C6174657300000000000000000000000001000000010000000000000000000000010000000000218018890000000000003D0000000E536F757263652042726F777365720000000000000000000000000100000001000000000000000000000001000000000021800000000000000400FFFFFFFF00000000000000000001000000000000000100000000000000000000000100000000002180D988000000000000390000000C4275696C64204F7574707574000000000000000000000000010000000100000000000000000000000100000000002180E38B000000000000410000000B46696E64204F75747075740000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001B000000000000000000000000000000000100000001000000000000000446696C65C6030000</Data>
</Buttons> </Buttons>
<OriginalItems> <OriginalItems>
<Len>1423</Len> <Len>1423</Len>
...@@ -1865,9 +1865,9 @@ ...@@ -1865,9 +1865,9 @@
<ActiveTab>0</ActiveTab> <ActiveTab>0</ActiveTab>
<Doc> <Doc>
<Name>../Src/main.c</Name> <Name>../Src/main.c</Name>
<ColumnNumber>24</ColumnNumber> <ColumnNumber>18</ColumnNumber>
<TopLine>46</TopLine> <TopLine>46</TopLine>
<CurrentLine>61</CurrentLine> <CurrentLine>56</CurrentLine>
<Folding>1</Folding> <Folding>1</Folding>
<ContractedFolders></ContractedFolders> <ContractedFolders></ContractedFolders>
<PaneID>0</PaneID> <PaneID>0</PaneID>
...@@ -1884,7 +1884,7 @@ ...@@ -1884,7 +1884,7 @@
<Doc> <Doc>
<Name>../BSP/Driver/bsp_pwm.h</Name> <Name>../BSP/Driver/bsp_pwm.h</Name>
<ColumnNumber>21</ColumnNumber> <ColumnNumber>21</ColumnNumber>
<TopLine>10</TopLine> <TopLine>9</TopLine>
<CurrentLine>10</CurrentLine> <CurrentLine>10</CurrentLine>
<Folding>1</Folding> <Folding>1</Folding>
<ContractedFolders></ContractedFolders> <ContractedFolders></ContractedFolders>
...@@ -1892,8 +1892,8 @@ ...@@ -1892,8 +1892,8 @@
</Doc> </Doc>
<Doc> <Doc>
<Name>..\BSP\Driver\bsp_pwm.c</Name> <Name>..\BSP\Driver\bsp_pwm.c</Name>
<ColumnNumber>18</ColumnNumber> <ColumnNumber>20</ColumnNumber>
<TopLine>1</TopLine> <TopLine>60</TopLine>
<CurrentLine>78</CurrentLine> <CurrentLine>78</CurrentLine>
<Folding>1</Folding> <Folding>1</Folding>
<ContractedFolders></ContractedFolders> <ContractedFolders></ContractedFolders>
...@@ -1911,7 +1911,7 @@ ...@@ -1911,7 +1911,7 @@
<Doc> <Doc>
<Name>..\BSP\Device\motor.c</Name> <Name>..\BSP\Device\motor.c</Name>
<ColumnNumber>0</ColumnNumber> <ColumnNumber>0</ColumnNumber>
<TopLine>5</TopLine> <TopLine>4</TopLine>
<CurrentLine>5</CurrentLine> <CurrentLine>5</CurrentLine>
<Folding>1</Folding> <Folding>1</Folding>
<ContractedFolders></ContractedFolders> <ContractedFolders></ContractedFolders>
...@@ -1920,12 +1920,30 @@ ...@@ -1920,12 +1920,30 @@
<Doc> <Doc>
<Name>..\BSP\Device\motor.h</Name> <Name>..\BSP\Device\motor.h</Name>
<ColumnNumber>13</ColumnNumber> <ColumnNumber>13</ColumnNumber>
<TopLine>70</TopLine> <TopLine>14</TopLine>
<CurrentLine>15</CurrentLine> <CurrentLine>15</CurrentLine>
<Folding>1</Folding> <Folding>1</Folding>
<ContractedFolders></ContractedFolders> <ContractedFolders></ContractedFolders>
<PaneID>0</PaneID> <PaneID>0</PaneID>
</Doc> </Doc>
<Doc>
<Name>..\BSP\Device\list_motor.c</Name>
<ColumnNumber>20</ColumnNumber>
<TopLine>52</TopLine>
<CurrentLine>63</CurrentLine>
<Folding>1</Folding>
<ContractedFolders></ContractedFolders>
<PaneID>0</PaneID>
</Doc>
<Doc>
<Name>../BSP/Device/list_motor.h</Name>
<ColumnNumber>0</ColumnNumber>
<TopLine>1</TopLine>
<CurrentLine>1</CurrentLine>
<Folding>1</Folding>
<ContractedFolders></ContractedFolders>
<PaneID>0</PaneID>
</Doc>
</MDIGroup> </MDIGroup>
</MDIGroups> </MDIGroups>
......
...@@ -68,7 +68,6 @@ ...@@ -68,7 +68,6 @@
/* USER CODE BEGIN PV */ /* USER CODE BEGIN PV */
int16_t led_cnt; int16_t led_cnt;
float target_speed; float target_speed;
motor_t m2006;
extern RC_ctrl_t rc_ctrl; extern RC_ctrl_t rc_ctrl;
//char buf[200]; //char buf[200];
...@@ -186,6 +185,20 @@ int main(void) ...@@ -186,6 +185,20 @@ int main(void)
// PWM_SetAllDuty(&htim1, 0, 0, 0, 0); // PWM_SetAllDuty(&htim1, 0, 0, 0, 0);
} }
if (rc_ctrl.rc.sw[0] == 1)
{
m2006.target = 15;
};
if (rc_ctrl.rc.sw[0] == 3)
{
m2006.target += 30;
};
if (rc_ctrl.rc.sw[0] == 2)
{
m2006.target += 60;
};
m3508_frontleft.target = 4*rc_ctrl.rc.ch[0] + 4*rc_ctrl.rc.ch[1] - 4*rc_ctrl.rc.ch[4]; m3508_frontleft.target = 4*rc_ctrl.rc.ch[0] + 4*rc_ctrl.rc.ch[1] - 4*rc_ctrl.rc.ch[4];
m3508_frontright.target = -(4*rc_ctrl.rc.ch[0] - 4*rc_ctrl.rc.ch[1] + 4*rc_ctrl.rc.ch[4]); m3508_frontright.target = -(4*rc_ctrl.rc.ch[0] - 4*rc_ctrl.rc.ch[1] + 4*rc_ctrl.rc.ch[4]);
m3508_backleft.target = -(4*rc_ctrl.rc.ch[0] + 4*rc_ctrl.rc.ch[1] + 4*rc_ctrl.rc.ch[4]); m3508_backleft.target = -(4*rc_ctrl.rc.ch[0] + 4*rc_ctrl.rc.ch[1] + 4*rc_ctrl.rc.ch[4]);
...@@ -195,7 +208,7 @@ int main(void) ...@@ -195,7 +208,7 @@ int main(void)
get_motor_data(&m3508_frontright); get_motor_data(&m3508_frontright);
get_motor_data(&m3508_backleft); get_motor_data(&m3508_backleft);
get_motor_data(&m3508_backright); get_motor_data(&m3508_backright);
get_motor_data(&m2006);
get_motor_data(&gm6020); get_motor_data(&gm6020);
/*Affichage de donnees sur le OLED*/ /*Affichage de donnees sur le OLED*/
...@@ -226,11 +239,11 @@ int main(void) ...@@ -226,11 +239,11 @@ int main(void)
set_motor_speed(&m3508_frontright); set_motor_speed(&m3508_frontright);
set_motor_speed(&m3508_backleft); set_motor_speed(&m3508_backleft);
set_motor_speed(&m3508_backright); set_motor_speed(&m3508_backright);
set_motor_speed(&m2006);
set_motor_speed(&gm6020); set_motor_speed(&gm6020);
set_motor_voltage(0, &m3508_frontleft, &m3508_frontright, &m3508_backleft, &m3508_backright); //0x200 set_motor_voltage(0, &m3508_frontleft, &m3508_frontright, &m3508_backleft, &m3508_backright); //0x200
set_motor_voltage(1, &gm6020, NULL, NULL, NULL); //0x1ff set_motor_voltage(1, &gm6020, NULL, &m2006, NULL); //0x1ff
HAL_Delay(10); HAL_Delay(10);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment