From 4f26f0ddae7f6a55ddcbc7301bc698d6c60e7803 Mon Sep 17 00:00:00 2001 From: UESTCsecurity Date: Wed, 24 Jan 2024 20:44:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3=E4=B8=8E?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Project/Project.uvguix.ASUS | 165 +++++----- .../PiRobot_Firmware v1.0/STM32/params.mk | 2 +- .../PiRobot_Firmware v1.0/STM32/pibot.uvoptx | 8 +- .../Pibot官方配置教程.md | 10 +- Hardware/UPbot-Tools/app.py | 2 +- .../STM32/BSPLIB/encoder.c | 283 +++++++++--------- .../STM32/Lib/KinematicModels/differential.h | 11 +- .../STM32/Lib/KinematicModels/omni3.h | 53 ++-- .../STM32/User/robot.cpp | 5 +- .../STM32/pibot.uvoptx | 12 +- Hardware/银星机器人底盘/README.md | 11 +- 11 files changed, 296 insertions(+), 266 deletions(-) diff --git a/Hardware/Firmware/GeekRobotTiny_Firmware v1.0/Project/Project.uvguix.ASUS b/Hardware/Firmware/GeekRobotTiny_Firmware v1.0/Project/Project.uvguix.ASUS index 271a436..1bca156 100644 --- a/Hardware/Firmware/GeekRobotTiny_Firmware v1.0/Project/Project.uvguix.ASUS +++ b/Hardware/Firmware/GeekRobotTiny_Firmware v1.0/Project/Project.uvguix.ASUS @@ -94,8 +94,8 @@ 0 - 430 - 01000000040000000100000001000000010000000100000000000000020000000000000001000000010000000000000028000000280000000100000002000000000000000100000069443A5C48617264776172652050726F6A6563745C526F626F7448617264776172652D55455354435C48617264776172655C4669726D776172655C4765656B526F626F7454696E795F4669726D776172652076312E305C48415244574152455C4D4F544F5C6361722E6300000000056361722E6300000000FFDC7800FFFFFFFF65443A5C48617264776172652050726F6A6563745C526F626F7448617264776172652D55455354435C48617264776172655C4669726D776172655C4765656B526F626F7454696E795F4669726D776172652076312E305C4452565C6273705F74696D65722E63000000000B6273705F74696D65722E6300000000BECEA100FFFFFFFF0100000010000000C5D4F200FFDC7800BECEA100F0A0A100BCA8E1009CC1B600F7B88600D9ADC200A5C2D700B3A6BE00EAD6A300F6FA7D00B5E99D005FC3CF00C1838300CACAD500010000000000000002000000D900000066000000AB06000005030000 + 556 + 01000000040000000100000001000000010000000100000000000000020000000000000001000000010000000000000028000000280000000100000003000000000000000100000065443A5C48617264776172652050726F6A6563745C526F626F7448617264776172652D55455354435C48617264776172655C4669726D776172655C4765656B526F626F7454696E795F4669726D776172652076312E305C4452565C6273705F74696D65722E63000000000B6273705F74696D65722E6300000000FFDC7800FFFFFFFF69443A5C48617264776172652050726F6A6563745C526F626F7448617264776172652D55455354435C48617264776172655C4669726D776172655C4765656B526F626F7454696E795F4669726D776172652076312E305C48415244574152455C4D4F544F5C6361722E6300000000056361722E6300000000BECEA100FFFFFFFF63443A5C48617264776172652050726F6A6563745C526F626F7448617264776172652D55455354435C48617264776172655C4669726D776172655C4765656B526F626F7454696E795F4669726D776172652076312E305C4452565C6273705F6969632E6300000000096273705F6969632E6300000000F0A0A100FFFFFFFF0100000010000000C5D4F200FFDC7800BECEA100F0A0A100BCA8E1009CC1B600F7B88600D9ADC200A5C2D700B3A6BE00EAD6A300F6FA7D00B5E99D005FC3CF00C1838300CACAD500010000000000000002000000D900000066000000AB06000005030000 @@ -118,7 +118,7 @@ 16 - 560000006D000000CE020000E9000000 + D900000066000000F0040000E2000000 @@ -174,7 +174,7 @@ 0 16 - 00000000DF010000F00400005B020000 + 03000000E2010000ED04000042020000 16 @@ -194,7 +194,7 @@ 0 16 - 03000000E2010000ED0400002E020000 + 03000000E2010000ED04000042020000 16 @@ -214,7 +214,7 @@ 0 16 - 03000000E2010000ED0400002E020000 + 03000000E2010000ED04000042020000 16 @@ -234,7 +234,7 @@ 0 16 - 03000000E2010000ED0400002E020000 + 03000000E2010000ED04000042020000 16 @@ -254,7 +254,7 @@ 0 16 - 1E04000066000000ED040000E9000000 + 1E04000066000000ED040000C2010000 16 @@ -274,7 +274,7 @@ 0 16 - D900000063000000F0040000CB000000 + DC00000066000000ED040000B2000000 16 @@ -314,7 +314,7 @@ 0 16 - 03000000E2010000ED0400002E020000 + 03000000E2010000ED04000042020000 16 @@ -334,7 +334,7 @@ 0 16 - 03000000E2010000ED0400002E020000 + 03000000E2010000ED04000042020000 16 @@ -354,7 +354,7 @@ 0 16 - 03000000E2010000ED0400002E020000 + 03000000E2010000ED04000042020000 16 @@ -374,7 +374,7 @@ 0 16 - 03000000E2010000ED0400002E020000 + 03000000E2010000ED04000042020000 16 @@ -394,7 +394,7 @@ 0 16 - 03000000E2010000ED0400002E020000 + 03000000E2010000ED04000042020000 16 @@ -414,7 +414,7 @@ 0 16 - 03000000E2010000ED0400002E020000 + 03000000E2010000ED04000042020000 16 @@ -514,7 +514,7 @@ 0 16 - 0300000009030000ED04000055030000 + 0300000009030000A806000055030000 16 @@ -534,7 +534,7 @@ 0 16 - D900000063000000F0040000CB000000 + DC00000066000000ED040000B2000000 16 @@ -594,7 +594,7 @@ 0 16 - 1B04000063000000F0040000DB010000 + 1E04000066000000ED040000C2010000 16 @@ -614,7 +614,7 @@ 0 16 - 00000000DF010000F004000047020000 + 03000000E2010000ED04000042020000 16 @@ -694,7 +694,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -714,7 +714,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -734,7 +734,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -754,7 +754,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -774,7 +774,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -794,7 +794,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -814,7 +814,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -834,7 +834,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -854,7 +854,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -874,7 +874,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -894,7 +894,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -914,7 +914,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -934,7 +934,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -954,7 +954,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -974,7 +974,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -994,7 +994,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1014,7 +1014,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1034,7 +1034,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1054,7 +1054,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1074,7 +1074,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1094,7 +1094,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1114,7 +1114,7 @@ 0 16 - 0300000066000000D200000042020000 + 0300000066000000D2000000D5020000 16 @@ -1134,7 +1134,7 @@ 0 16 - 0000000006030000F00400006E030000 + 0300000009030000A806000055030000 16 @@ -1154,7 +1154,7 @@ 0 16 - 0300000009030000ED04000055030000 + 0300000009030000A806000055030000 16 @@ -1174,7 +1174,7 @@ 0 16 - 03000000E2010000ED0400002E020000 + 03000000E2010000ED04000042020000 16 @@ -1194,7 +1194,7 @@ 0 16 - 03000000E2010000ED0400002E020000 + 03000000E2010000ED04000042020000 16 @@ -1214,7 +1214,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1234,7 +1234,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1254,7 +1254,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1274,7 +1274,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1294,7 +1294,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1314,7 +1314,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1334,7 +1334,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1354,7 +1354,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1374,7 +1374,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1394,7 +1394,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1414,7 +1414,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1434,7 +1434,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1454,7 +1454,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1474,7 +1474,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1494,7 +1494,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1514,7 +1514,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1534,7 +1534,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1554,7 +1554,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1574,7 +1574,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1594,7 +1594,7 @@ 0 16 - 1E04000066000000ED04000042010000 + 1E04000066000000ED040000C2010000 16 @@ -1608,7 +1608,7 @@ 0 0 0 - 32767 + 940 0 8192 0 @@ -1648,7 +1648,7 @@ 0 0 0 - 32767 + 463 0 8192 1 @@ -1668,7 +1668,7 @@ 0 0 0 - 32767 + 612 0 8192 2 @@ -1683,14 +1683,14 @@ 3119 - 000000000B000000000000000020000000000000FFFFFFFFFFFFFFFFD9000000CB000000F0040000CF000000000000000100001004000000010000000000000000000000FFFFFFFF06000000CB00000057010000CC000000F08B00005A01000079070000FFFF02000B004354616262656450616E650020000000000000560000006D000000CE020000E9000000D90000004F000000F0040000CB0000000000000040280046060000000B446973617373656D626C7900000000CB00000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A6572000000005701000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A657200000000CC00000001000000FFFFFFFFFFFFFFFF0E4C6F67696320416E616C797A657200000000F08B000001000000FFFFFFFFFFFFFFFF0D436F646520436F766572616765000000005A01000001000000FFFFFFFFFFFFFFFF11496E737472756374696F6E205472616365000000007907000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFCB00000001000000FFFFFFFFCB000000000000000040000000000000FFFFFFFFFFFFFFFF170400004F0000001B040000DB010000000000000200001004000000010000000000000000000000FFFFFFFF2B000000E2050000CA0900002D8C00002E8C00002F8C0000308C0000318C0000328C0000338C0000348C0000358C0000368C0000378C0000388C0000398C00003A8C00003B8C00003C8C00003D8C00003E8C00003F8C0000408C0000418C000050C3000051C3000052C3000053C3000054C3000055C3000056C3000057C3000058C3000059C300005AC300005BC300005CC300005DC300005EC300005FC3000060C3000061C3000062C3000063C3000001800040000000000000560000006D0000002B010000200100001B0400004F000000F0040000DB01000000000000404100462B0000000753796D626F6C7300000000E205000001000000FFFFFFFFFFFFFFFF0A5472616365204461746100000000CA09000001000000FFFFFFFFFFFFFFFF00000000002D8C000001000000FFFFFFFFFFFFFFFF00000000002E8C000001000000FFFFFFFFFFFFFFFF00000000002F8C000001000000FFFFFFFFFFFFFFFF0000000000308C000001000000FFFFFFFFFFFFFFFF0000000000318C000001000000FFFFFFFFFFFFFFFF0000000000328C000001000000FFFFFFFFFFFFFFFF0000000000338C000001000000FFFFFFFFFFFFFFFF0000000000348C000001000000FFFFFFFFFFFFFFFF0000000000358C000001000000FFFFFFFFFFFFFFFF0000000000368C000001000000FFFFFFFFFFFFFFFF0000000000378C000001000000FFFFFFFFFFFFFFFF0000000000388C000001000000FFFFFFFFFFFFFFFF0000000000398C000001000000FFFFFFFFFFFFFFFF00000000003A8C000001000000FFFFFFFFFFFFFFFF00000000003B8C000001000000FFFFFFFFFFFFFFFF00000000003C8C000001000000FFFFFFFFFFFFFFFF00000000003D8C000001000000FFFFFFFFFFFFFFFF00000000003E8C000001000000FFFFFFFFFFFFFFFF00000000003F8C000001000000FFFFFFFFFFFFFFFF0000000000408C000001000000FFFFFFFFFFFFFFFF0000000000418C000001000000FFFFFFFFFFFFFFFF000000000050C3000001000000FFFFFFFFFFFFFFFF000000000051C3000001000000FFFFFFFFFFFFFFFF000000000052C3000001000000FFFFFFFFFFFFFFFF000000000053C3000001000000FFFFFFFFFFFFFFFF000000000054C3000001000000FFFFFFFFFFFFFFFF000000000055C3000001000000FFFFFFFFFFFFFFFF000000000056C3000001000000FFFFFFFFFFFFFFFF000000000057C3000001000000FFFFFFFFFFFFFFFF000000000058C3000001000000FFFFFFFFFFFFFFFF000000000059C3000001000000FFFFFFFFFFFFFFFF00000000005AC3000001000000FFFFFFFFFFFFFFFF00000000005BC3000001000000FFFFFFFFFFFFFFFF00000000005CC3000001000000FFFFFFFFFFFFFFFF00000000005DC3000001000000FFFFFFFFFFFFFFFF00000000005EC3000001000000FFFFFFFFFFFFFFFF00000000005FC3000001000000FFFFFFFFFFFFFFFF000000000060C3000001000000FFFFFFFFFFFFFFFF000000000061C3000001000000FFFFFFFFFFFFFFFF000000000062C3000001000000FFFFFFFFFFFFFFFF000000000063C3000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFE205000001000000FFFFFFFFE2050000000000000010000001000000FFFFFFFFFFFFFFFFD50000004F000000D9000000EE020000010000000200001004000000010000000000000000000000FFFFFFFF05000000ED0300006D000000C3000000C40000007394000001800010000001000000560000006D0000002B01000020010000000000004F000000D5000000EE0200000000000040410056050000000750726F6A65637401000000ED03000001000000FFFFFFFFFFFFFFFF05426F6F6B73010000006D00000001000000FFFFFFFFFFFFFFFF0946756E6374696F6E7301000000C300000001000000FFFFFFFFFFFFFFFF0954656D706C6174657301000000C400000001000000FFFFFFFFFFFFFFFF09526567697374657273000000007394000001000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000001000000FFFFFFFFED03000001000000FFFFFFFFED030000000000000080000000000000FFFFFFFFFFFFFFFF00000000C7010000F0040000CB01000000000000010000100400000001000000000000000000000000000000000000000000000001000000C6000000FFFFFFFF0E0000008F070000930700009407000095070000960700009007000091070000B5010000B8010000B9050000BA050000BB050000BC050000CB09000001800080000000000000560000006D0000002B0100002001000000000000CB010000F00400005B02000000000000404100460E0000001343616C6C20537461636B202B204C6F63616C73000000008F07000001000000FFFFFFFFFFFFFFFF0755415254202331000000009307000001000000FFFFFFFFFFFFFFFF0755415254202332000000009407000001000000FFFFFFFFFFFFFFFF0755415254202333000000009507000001000000FFFFFFFFFFFFFFFF15446562756720287072696E74662920566965776572000000009607000001000000FFFFFFFFFFFFFFFF0757617463682031000000009007000001000000FFFFFFFFFFFFFFFF0757617463682032000000009107000001000000FFFFFFFFFFFFFFFF10547261636520457863657074696F6E7300000000B501000001000000FFFFFFFFFFFFFFFF0E4576656E7420436F756E7465727300000000B801000001000000FFFFFFFFFFFFFFFF084D656D6F7279203100000000B905000001000000FFFFFFFFFFFFFFFF084D656D6F7279203200000000BA05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203300000000BB05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203400000000BC05000001000000FFFFFFFFFFFFFFFF105472616365204E617669676174696F6E00000000CB09000001000000FFFFFFFFFFFFFFFFFFFFFFFF0000000001000000000000000000000001000000FFFFFFFF78020000CB0100007C0200005B02000000000000020000000400000000000000000000000000000000000000000000000000000002000000C6000000FFFFFFFF8F07000001000000FFFFFFFF8F07000001000000C6000000000000000080000001000000FFFFFFFFFFFFFFFF00000000EE020000AB060000F2020000010000000100001004000000010000000000000000000000FFFFFFFF04000000C5000000C7000000B40100007794000001800080000001000000560000006D000000CE020000E900000000000000F2020000AB0600006E0300000000000040820056040000000C4275696C64204F757470757401000000C500000001000000FFFFFFFFFFFFFFFF0D46696E6420496E2046696C657300000000C700000001000000FFFFFFFFFFFFFFFF0A4572726F72204C69737400000000B401000001000000FFFFFFFFFFFFFFFF0742726F77736572000000007794000001000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000001000000FFFFFFFFC500000001000000FFFFFFFFC5000000000000000000000000000000 + 000000000B000000000000000020000000000000FFFFFFFFFFFFFFFFD9000000CB000000F0040000CF000000000000000100000004000000010000000000000000000000FFFFFFFF06000000CB00000057010000CC000000F08B00005A01000079070000FFFF02000B004354616262656450616E650020000000000000D900000066000000F0040000E2000000D90000004F000000F0040000CB0000000000000040280046060000000B446973617373656D626C7900000000CB00000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A6572000000005701000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A657200000000CC00000001000000FFFFFFFFFFFFFFFF0E4C6F67696320416E616C797A657200000000F08B000001000000FFFFFFFFFFFFFFFF0D436F646520436F766572616765000000005A01000001000000FFFFFFFFFFFFFFFF11496E737472756374696F6E205472616365000000007907000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFCB00000001000000FFFFFFFFCB000000000000000040000000000000FFFFFFFFFFFFFFFF170400004F0000001B040000DB010000000000000200000004000000010000000000000000000000FFFFFFFF2B000000E2050000CA0900002D8C00002E8C00002F8C0000308C0000318C0000328C0000338C0000348C0000358C0000368C0000378C0000388C0000398C00003A8C00003B8C00003C8C00003D8C00003E8C00003F8C0000408C0000418C000050C3000051C3000052C3000053C3000054C3000055C3000056C3000057C3000058C3000059C300005AC300005BC300005CC300005DC300005EC300005FC3000060C3000061C3000062C3000063C30000018000400000000000001B04000066000000F0040000F20100001B0400004F000000F0040000DB01000000000000404100462B0000000753796D626F6C7300000000E205000001000000FFFFFFFFFFFFFFFF0A5472616365204461746100000000CA09000001000000FFFFFFFFFFFFFFFF00000000002D8C000001000000FFFFFFFFFFFFFFFF00000000002E8C000001000000FFFFFFFFFFFFFFFF00000000002F8C000001000000FFFFFFFFFFFFFFFF0000000000308C000001000000FFFFFFFFFFFFFFFF0000000000318C000001000000FFFFFFFFFFFFFFFF0000000000328C000001000000FFFFFFFFFFFFFFFF0000000000338C000001000000FFFFFFFFFFFFFFFF0000000000348C000001000000FFFFFFFFFFFFFFFF0000000000358C000001000000FFFFFFFFFFFFFFFF0000000000368C000001000000FFFFFFFFFFFFFFFF0000000000378C000001000000FFFFFFFFFFFFFFFF0000000000388C000001000000FFFFFFFFFFFFFFFF0000000000398C000001000000FFFFFFFFFFFFFFFF00000000003A8C000001000000FFFFFFFFFFFFFFFF00000000003B8C000001000000FFFFFFFFFFFFFFFF00000000003C8C000001000000FFFFFFFFFFFFFFFF00000000003D8C000001000000FFFFFFFFFFFFFFFF00000000003E8C000001000000FFFFFFFFFFFFFFFF00000000003F8C000001000000FFFFFFFFFFFFFFFF0000000000408C000001000000FFFFFFFFFFFFFFFF0000000000418C000001000000FFFFFFFFFFFFFFFF000000000050C3000001000000FFFFFFFFFFFFFFFF000000000051C3000001000000FFFFFFFFFFFFFFFF000000000052C3000001000000FFFFFFFFFFFFFFFF000000000053C3000001000000FFFFFFFFFFFFFFFF000000000054C3000001000000FFFFFFFFFFFFFFFF000000000055C3000001000000FFFFFFFFFFFFFFFF000000000056C3000001000000FFFFFFFFFFFFFFFF000000000057C3000001000000FFFFFFFFFFFFFFFF000000000058C3000001000000FFFFFFFFFFFFFFFF000000000059C3000001000000FFFFFFFFFFFFFFFF00000000005AC3000001000000FFFFFFFFFFFFFFFF00000000005BC3000001000000FFFFFFFFFFFFFFFF00000000005CC3000001000000FFFFFFFFFFFFFFFF00000000005DC3000001000000FFFFFFFFFFFFFFFF00000000005EC3000001000000FFFFFFFFFFFFFFFF00000000005FC3000001000000FFFFFFFFFFFFFFFF000000000060C3000001000000FFFFFFFFFFFFFFFF000000000061C3000001000000FFFFFFFFFFFFFFFF000000000062C3000001000000FFFFFFFFFFFFFFFF000000000063C3000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFE205000001000000FFFFFFFFE2050000000000000010000001000000FFFFFFFFFFFFFFFFD50000004F000000D9000000EE020000010000000200001004000000010000000000000000000000FFFFFFFF05000000ED0300006D000000C3000000C400000073940000018000100000010000000000000066000000D500000005030000000000004F000000D5000000EE0200000000000040410056050000000750726F6A65637401000000ED03000001000000FFFFFFFFFFFFFFFF05426F6F6B73010000006D00000001000000FFFFFFFFFFFFFFFF0946756E6374696F6E7301000000C300000001000000FFFFFFFFFFFFFFFF0954656D706C6174657301000000C400000001000000FFFFFFFFFFFFFFFF09526567697374657273000000007394000001000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000001000000FFFFFFFFED03000001000000FFFFFFFFED030000000000000080000000000000FFFFFFFFFFFFFFFF00000000C7010000F0040000CB01000000000000010000000400000001000000000000000000000000000000000000000000000001000000C6000000FFFFFFFF0E0000008F070000930700009407000095070000960700009007000091070000B5010000B8010000B9050000BA050000BB050000BC050000CB0900000180008000000000000000000000E2010000F00400007202000000000000CB010000F00400005B02000000000000404100460E0000001343616C6C20537461636B202B204C6F63616C73000000008F07000001000000FFFFFFFFFFFFFFFF0755415254202331000000009307000001000000FFFFFFFFFFFFFFFF0755415254202332000000009407000001000000FFFFFFFFFFFFFFFF0755415254202333000000009507000001000000FFFFFFFFFFFFFFFF15446562756720287072696E74662920566965776572000000009607000001000000FFFFFFFFFFFFFFFF0757617463682031000000009007000001000000FFFFFFFFFFFFFFFF0757617463682032000000009107000001000000FFFFFFFFFFFFFFFF10547261636520457863657074696F6E7300000000B501000001000000FFFFFFFFFFFFFFFF0E4576656E7420436F756E7465727300000000B801000001000000FFFFFFFFFFFFFFFF084D656D6F7279203100000000B905000001000000FFFFFFFFFFFFFFFF084D656D6F7279203200000000BA05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203300000000BB05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203400000000BC05000001000000FFFFFFFFFFFFFFFF105472616365204E617669676174696F6E00000000CB09000001000000FFFFFFFFFFFFFFFFFFFFFFFF0000000001000000000000000000000001000000FFFFFFFF78020000CB0100007C0200005B02000000000000020000000400000000000000000000000000000000000000000000000000000002000000C6000000FFFFFFFF8F07000001000000FFFFFFFF8F07000001000000C6000000000000000080000001000000FFFFFFFFFFFFFFFF00000000EE020000AB060000F2020000010000000100001004000000010000000000000000000000FFFFFFFF04000000C5000000C7000000B401000077940000018000800000010000000000000009030000AB0600008503000000000000F2020000AB0600006E0300000000000040820056040000000C4275696C64204F757470757401000000C500000001000000FFFFFFFFFFFFFFFF0D46696E6420496E2046696C657300000000C700000001000000FFFFFFFFFFFFFFFF0A4572726F72204C69737400000000B401000001000000FFFFFFFFFFFFFFFF0742726F77736572000000007794000001000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000001000000FFFFFFFFC500000001000000FFFFFFFFC5000000000000000000000000000000 59392 File 2002 - 00200000010000002800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000000004000000000000000000000000000000000100000001000000018022E100000000000005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000004000700000000000000000000000000000000010000000100000001802CE10000000004000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000004000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000004000C0000000000000000000000000000000001000000010000000180F4B00000000004000D000000000000000000000000000000000100000001000000018036B10000000004000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF88000000000000460000000000000000000000000000000001000000010000000180FE880000000000004500000000000000000000000000000000010000000100000001800B810000000000001300000000000000000000000000000000010000000100000001800C810000000000001400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F0880000020000000F000000000000000000000000000000000100000001000000FFFF0100120043555646696E64436F6D626F427574746F6EE803000000000000000000000000000000000000000000000001000000010000009600000002002050FFFFFFFF0096000000000000000000018024E10000000000001100000000000000000000000000000000010000000100000001800A810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018022800000020000001500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000160000000000000000000000000000000001000000010000000180C988000000000400180000000000000000000000000000000001000000010000000180C788000000000000190000000000000000000000000000000001000000010000000180C8880000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E4C010000020001001A0000000F2650726F6A6563742057696E646F77000000000000000000000000010000000100000000000000000000000100000008002880DD880000000000001A0000000750726F6A656374000000000000000000000000010000000100000000000000000000000100000000002880DC8B0000000000003A00000005426F6F6B73000000000000000000000000010000000100000000000000000000000100000000002880E18B0000000000003B0000000946756E6374696F6E73000000000000000000000000010000000100000000000000000000000100000000002880E28B000000000000400000000954656D706C6174657300000000000000000000000001000000010000000000000000000000010000000000288018890000000000003D0000000E536F757263652042726F777365720000000000000000000000000100000001000000000000000000000001000000000028800000000000000400FFFFFFFF00000000000000000000000000010000000100000000000000000000000100000000002880D988000000000000390000000C4275696C64204F7574707574000000000000000000000000010000000100000000000000000000000100000000002880E38B000000000000410000000B46696E64204F75747075740000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001B000000000000000000000000000000000100000001000000000000000446696C65FF7F0000 + 00200000010000002800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000000004000000000000000000000000000000000100000001000000018022E100000000000005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000004000700000000000000000000000000000000010000000100000001802CE10000000004000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000004000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000004000C0000000000000000000000000000000001000000010000000180F4B00000000004000D000000000000000000000000000000000100000001000000018036B10000000004000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF88000000000000460000000000000000000000000000000001000000010000000180FE880000000000004500000000000000000000000000000000010000000100000001800B810000000000001300000000000000000000000000000000010000000100000001800C810000000000001400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F0880000020000000F000000000000000000000000000000000100000001000000FFFF0100120043555646696E64436F6D626F427574746F6EE803000000000000000000000000000000000000000000000001000000010000009600000002002050FFFFFFFF0096000000000000000000018024E10000000000001100000000000000000000000000000000010000000100000001800A810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018022800000020000001500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000160000000000000000000000000000000001000000010000000180C988000000000400180000000000000000000000000000000001000000010000000180C788000000000000190000000000000000000000000000000001000000010000000180C8880000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E4C010000020001001A0000000F2650726F6A6563742057696E646F77000000000000000000000000010000000100000000000000000000000100000008002880DD880000000000001A0000000750726F6A656374000000000000000000000000010000000100000000000000000000000100000000002880DC8B0000000000003A00000005426F6F6B73000000000000000000000000010000000100000000000000000000000100000000002880E18B0000000000003B0000000946756E6374696F6E73000000000000000000000000010000000100000000000000000000000100000000002880E28B000000000000400000000954656D706C6174657300000000000000000000000001000000010000000000000000000000010000000000288018890000000000003D0000000E536F757263652042726F777365720000000000000000000000000100000001000000000000000000000001000000000028800000000000000400FFFFFFFF00000000000000000001000000000000000100000000000000000000000100000000002880D988000000000000390000000C4275696C64204F7574707574000000000000000000000000010000000100000000000000000000000100000000002880E38B000000000000410000000B46696E64204F75747075740000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001B000000000000000000000000000000000100000001000000000000000446696C65AC030000 1423 @@ -1706,7 +1706,7 @@ Build 676 - 00200000010000001000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F0000000000001C0000000000000000000000000000000001000000010000000180D07F0000000000001D000000000000000000000000000000000100000001000000018030800000000000001E00000000000000000000000000000000010000000100000001809E8A0000000000001F0000000000000000000000000000000001000000010000000180D17F0000000004002000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000002100000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001900434D4643546F6F6C426172436F6D626F426F78427574746F6EBA00000000000000000000000000000000000000000000000001000000010000009600000003002050000000000750524F4A454354960000000000000001000750524F4A454354000000000180EB880000000000002200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000230000000000000000000000000000000001000000010000000180B08A000000000400240000000000000000000000000000000001000000010000000180A8010000000000004E00000000000000000000000000000000010000000100000001807202000000000000530000000000000000000000000000000001000000010000000180BE010000000000005000000000000000000000000000000000010000000100000000000000054275696C64FF7F0000 + 00200000010000001000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F0000000000001C0000000000000000000000000000000001000000010000000180D07F0000000000001D000000000000000000000000000000000100000001000000018030800000000000001E00000000000000000000000000000000010000000100000001809E8A0000000000001F0000000000000000000000000000000001000000010000000180D17F0000000004002000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000002100000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001900434D4643546F6F6C426172436F6D626F426F78427574746F6EBA00000000000000000000000000000000000000000000000001000000010000009600000003002050000000000750524F4A454354960000000000000001000750524F4A454354000000000180EB880000000000002200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000230000000000000000000000000000000001000000010000000180B08A000000000400240000000000000000000000000000000001000000010000000180A8010000000000004E00000000000000000000000000000000010000000100000001807202000000000000530000000000000000000000000000000001000000010000000180BE010000000000005000000000000000000000000000000000010000000100000000000000054275696C64CF010000 583 @@ -1722,7 +1722,7 @@ Debug 2373 - 00200000000000001900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000002500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000002600000000000000000000000000000000010000000100000001801D800000000000002700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000002800000000000000000000000000000000010000000100000001801B80000000000000290000000000000000000000000000000001000000010000000180E57F0000000000002A00000000000000000000000000000000010000000100000001801C800000000000002B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000002C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B0000000000002D0000000000000000000000000000000001000000010000000180F07F0000000000002E0000000000000000000000000000000001000000010000000180E8880000000000003700000000000000000000000000000000010000000100000001803B010000000000002F0000000000000000000000000000000001000000010000000180BB8A00000000000030000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E0E01000000000000310000000D57617463682057696E646F7773000000000000000000000000010000000100000000000000000000000100000003001380D88B00000000000031000000085761746368202631000000000000000000000000010000000100000000000000000000000100000000001380D98B00000000000031000000085761746368202632000000000000000000000000010000000100000000000000000000000100000000001380CE01000000000000FFFFFFFF0C576174636820416E63686F720100000000000000000000000100000001000000000000000000000001000000000013800F01000000000000320000000E4D656D6F72792057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380D28B00000000000032000000094D656D6F7279202631000000000000000000000000010000000100000000000000000000000100000000001380D38B00000000000032000000094D656D6F7279202632000000000000000000000000010000000100000000000000000000000100000000001380D48B00000000000032000000094D656D6F7279202633000000000000000000000000010000000100000000000000000000000100000000001380D58B00000000000032000000094D656D6F72792026340000000000000000000000000100000001000000000000000000000001000000000013801001000000000000330000000E53657269616C2057696E646F77730000000000000000000000000100000001000000000000000000000001000000040013809307000000000000330000000855415254202326310000000000000000000000000100000001000000000000000000000001000000000013809407000000000000330000000855415254202326320000000000000000000000000100000001000000000000000000000001000000000013809507000000000000330000000855415254202326330000000000000000000000000100000001000000000000000000000001000000000013809607000000000000330000001626446562756720287072696E746629205669657765720000000000000000000000000100000001000000000000000000000001000000000013803C010000000000003400000010416E616C797369732057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380658A000000000000340000000F264C6F67696320416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380DC7F0000000000003E0000001526506572666F726D616E636520416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380E788000000000000380000000E26436F646520436F766572616765000000000000000000000000010000000100000000000000000000000100000000001380CD01000000000000FFFFFFFF0F416E616C7973697320416E63686F7201000000000000000000000001000000010000000000000000000000010000000000138053010000000000003F0000000D54726163652057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013805401000000000000FFFFFFFF115472616365204D656E7520416E63686F720100000000000000000000000100000001000000000000000000000001000000000013802901000000000000350000001553797374656D205669657765722057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013804B01000000000000FFFFFFFF1453797374656D2056696577657220416E63686F720100000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000013800189000000000000360000000F26546F6F6C626F782057696E646F7700000000000000000000000001000000010000000000000000000000010000000300138044C5000000000000FFFFFFFF0E5570646174652057696E646F77730100000000000000000000000100000001000000000000000000000001000000000013800000000000000400FFFFFFFF000000000000000000000000000100000001000000000000000000000001000000000013805B01000000000000FFFFFFFF12546F6F6C626F78204D656E75416E63686F720100000000000000000000000100000001000000000000000000000001000000000000000000054465627567FF7F0000 + 00200000000000001900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000002500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000002600000000000000000000000000000000010000000100000001801D800000000000002700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000002800000000000000000000000000000000010000000100000001801B80000000000000290000000000000000000000000000000001000000010000000180E57F0000000000002A00000000000000000000000000000000010000000100000001801C800000000000002B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000002C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B0000000000002D0000000000000000000000000000000001000000010000000180F07F0000000000002E0000000000000000000000000000000001000000010000000180E8880000000000003700000000000000000000000000000000010000000100000001803B010000000000002F0000000000000000000000000000000001000000010000000180BB8A00000000000030000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E0E01000000000000310000000D57617463682057696E646F7773000000000000000000000000010000000100000000000000000000000100000003001380D88B00000000000031000000085761746368202631000000000000000000000000010000000100000000000000000000000100000000001380D98B00000000000031000000085761746368202632000000000000000000000000010000000100000000000000000000000100000000001380CE01000000000000FFFFFFFF0C576174636820416E63686F720000000000000000010000000000000001000000000000000000000001000000000013800F01000000000000320000000E4D656D6F72792057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380D28B00000000000032000000094D656D6F7279202631000000000000000000000000010000000100000000000000000000000100000000001380D38B00000000000032000000094D656D6F7279202632000000000000000000000000010000000100000000000000000000000100000000001380D48B00000000000032000000094D656D6F7279202633000000000000000000000000010000000100000000000000000000000100000000001380D58B00000000000032000000094D656D6F72792026340000000000000000000000000100000001000000000000000000000001000000000013801001000000000000330000000E53657269616C2057696E646F77730000000000000000000000000100000001000000000000000000000001000000040013809307000000000000330000000855415254202326310000000000000000000000000100000001000000000000000000000001000000000013809407000000000000330000000855415254202326320000000000000000000000000100000001000000000000000000000001000000000013809507000000000000330000000855415254202326330000000000000000000000000100000001000000000000000000000001000000000013809607000000000000330000001626446562756720287072696E746629205669657765720000000000000000000000000100000001000000000000000000000001000000000013803C010000000000003400000010416E616C797369732057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380658A000000000000340000000F264C6F67696320416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380DC7F0000000000003E0000001526506572666F726D616E636520416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380E788000000000000380000000E26436F646520436F766572616765000000000000000000000000010000000100000000000000000000000100000000001380CD01000000000000FFFFFFFF0F416E616C7973697320416E63686F7200000000000000000100000000000000010000000000000000000000010000000000138053010000000000003F0000000D54726163652057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013805401000000000000FFFFFFFF115472616365204D656E7520416E63686F720000000000000000010000000000000001000000000000000000000001000000000013802901000000000000350000001553797374656D205669657765722057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013804B01000000000000FFFFFFFF1453797374656D2056696577657220416E63686F720000000000000000010000000000000001000000000000000000000001000000000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000013800189000000000000360000000F26546F6F6C626F782057696E646F7700000000000000000000000001000000010000000000000000000000010000000300138044C5000000000000FFFFFFFF0E5570646174652057696E646F77730000000000000000010000000000000001000000000000000000000001000000000013800000000000000400FFFFFFFF000000000000000000010000000000000001000000000000000000000001000000000013805B01000000000000FFFFFFFF12546F6F6C626F78204D656E75416E63686F72000000000000000001000000000000000100000000000000000000000100000000000000000005446562756764020000 898 @@ -1748,18 +1748,27 @@ 100 0 - ..\HARDWARE\MOTO\car.c - 30 - 1 - 22 + ..\DRV\bsp_timer.c + 37 + 146 + 170 1 0 - ..\DRV\bsp_timer.c + ..\HARDWARE\MOTO\car.c + 11 + 1 + 21 + 1 + + 0 + + + ..\DRV\bsp_iic.c 0 - 154 + 1 1 1 diff --git a/Hardware/Pibot驱动底盘/PiRobot_Firmware v1.0/STM32/params.mk b/Hardware/Pibot驱动底盘/PiRobot_Firmware v1.0/STM32/params.mk index 1a61e24..ee4fa4b 100644 --- a/Hardware/Pibot驱动底盘/PiRobot_Firmware v1.0/STM32/params.mk +++ b/Hardware/Pibot驱动底盘/PiRobot_Firmware v1.0/STM32/params.mk @@ -20,7 +20,7 @@ -DMOTOR_DRIVER_TB6612=1 -DMOTOR_DRIVER_DRV8870=2 --DMOTOR_DRIVER=MOTOR_DRIVER_DRV8870 +-DMOTOR_DRIVER=MOTOR_DRIVER_TB6612 #uart -DMASTER_USART=3 diff --git a/Hardware/Pibot驱动底盘/PiRobot_Firmware v1.0/STM32/pibot.uvoptx b/Hardware/Pibot驱动底盘/PiRobot_Firmware v1.0/STM32/pibot.uvoptx index 9ae53f8..56471ba 100644 --- a/Hardware/Pibot驱动底盘/PiRobot_Firmware v1.0/STM32/pibot.uvoptx +++ b/Hardware/Pibot驱动底盘/PiRobot_Firmware v1.0/STM32/pibot.uvoptx @@ -82,17 +82,17 @@ 0 Base Board Schematics (MCBSTM32E) - D:\Program Files\Keilv5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e-base-board-schematics.pdf + C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e-base-board-schematics.pdf 1 Display Board Schematics (MCBSTM32E) - D:\Program Files\Keilv5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e-display-board-schematics.pdf + C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e-display-board-schematics.pdf 2 User Manual (MCBSTM32E) - D:\Program Files\Keilv5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e.chm + C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e.chm 3 @@ -139,7 +139,7 @@ 0 ST-LINKIII-KEIL_SWO - -U303030303030303030303031 -I0 -O206 -S1 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM) + -U303030303030303030303031 -O206 -S1 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM) 0 diff --git a/Hardware/Pibot驱动底盘/Pibot官方配置教程.md b/Hardware/Pibot驱动底盘/Pibot官方配置教程.md index a877c9e..39c57d9 100644 --- a/Hardware/Pibot驱动底盘/Pibot官方配置教程.md +++ b/Hardware/Pibot驱动底盘/Pibot官方配置教程.md @@ -68,7 +68,7 @@ struct head char version[16]; //固件版本 char time[16]; //构建时间 } - ``` +``` - 交互数据测试 - 发送(十六进制): `5a 00 00 5a` - 接收(十六进制): `5a 00 20 76 32 2e 30 2e 30 00 00 00 00 00 00 00 00 00 00 32 30 32 30 30 31 30 39 2d 6d 33 65 33 00 00 00 d1` @@ -136,7 +136,7 @@ struct head - 交互数据测试 - 发送(十六进制): `5a 02 00 5c` - 接收(十六进制): `5a 02 40 41 00 af 00 2c 00 0a 40 01 8c 0a 00 00 0a 00 fa 00 32 00 00 00 c8 00 47 5a 00 01 0f 0f 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 82` -![get params](png/get_params.png) + ![get params](png/get_params.png) ``` 固定帧头:0x5a 消息id:0x02 @@ -227,8 +227,8 @@ struct head short v_liner_x; //线速度 前>0 后<0 cm/s short v_liner_y; //差分轮 为0 cm/s short v_angular_z; //角速度 左>0 右<0 0.01rad/s 100 means 1 rad/s - long x; //里程计坐标x cm (这里long为4字节,下同) - long y; //里程计坐标y cm + long x; //里程计坐标x cm (这里long为4字节,下同) + long y; //里程计坐标y cm short yaw; //里程计航角 0.01rad 100 means 1 rad } ``` @@ -326,7 +326,7 @@ mz=[7B 94 94 C3] // -297.160004 { float encoder_count[4]; // 各电机编码器计数 } -``` + ``` ### 3.2.10 电机控制 - 请求:Master->Board diff --git a/Hardware/UPbot-Tools/app.py b/Hardware/UPbot-Tools/app.py index 3d24691..d43ebc3 100644 --- a/Hardware/UPbot-Tools/app.py +++ b/Hardware/UPbot-Tools/app.py @@ -14,7 +14,7 @@ from PyQt5.QtCore import QObject,pyqtSignal import pb import threading -port = "COM6" +port = "COM4" pypibot.assistant.enableGlobalExcept() # log.enableFileLog(log_dir + "ros_$(Date8)_$(filenumber2).log") diff --git a/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/BSPLIB/encoder.c b/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/BSPLIB/encoder.c index 1931d4c..d32c13c 100644 --- a/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/BSPLIB/encoder.c +++ b/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/BSPLIB/encoder.c @@ -1,155 +1,164 @@ #ifdef __cplusplus -extern "C" { -#endif +extern "C" +{ +#endif #include "encoder.h" #include "nvic.h" #include "print.h" -#define ENCODER_TIM_PERIOD (u16)(60000) // number of pulses per revolution +#define ENCODER_TIM_PERIOD (u16)(60000) // number of pulses per revolution -void Encoder_Init(TIM_TypeDef* TIMx , unsigned char GPIO_AF) //Initialize encoder mode, input parameter TIM1 TIM2 TIM3 -{ - TIM_ICInitTypeDef TIM_ICInitStructure; - GPIO_InitTypeDef GPIO_InitStructure; - TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; - if( TIMx == TIM2){ - - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2 , ENABLE); /* enable clock */ - if(GPIO_AF == 0){ - //---------------------------------------------------------------TIM2 CHI1 CHI2---PA0 PA1; - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE); - GPIO_StructInit(&GPIO_InitStructure); - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; - GPIO_Init(GPIOA, &GPIO_InitStructure); - } - else if(GPIO_AF == 1){ - //---------------------------------------------------------------TIM2 CHI1 CHI2---PA15 PB3; - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO , ENABLE); - GPIO_PinRemapConfig(GPIO_FullRemap_TIM2,ENABLE); - GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE);// This is very important! + void Encoder_Init(TIM_TypeDef *TIMx, unsigned char GPIO_AF) // Initialize encoder mode, input parameter TIM1 TIM2 TIM3 + { + TIM_ICInitTypeDef TIM_ICInitStructure; + GPIO_InitTypeDef GPIO_InitStructure; + TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; + if (TIMx == TIM2) + { - GPIO_StructInit(&GPIO_InitStructure); - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; - GPIO_Init(GPIOA, &GPIO_InitStructure); - - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; - GPIO_Init(GPIOB, &GPIO_InitStructure); - } - TIM2_NVIC_Configuration(); //enable interrupt - } - - else if( TIMx == TIM3){ - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3|RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOA , ENABLE); /* enable clock */ - if(GPIO_AF == 0){ - //---------------------------------------------------------------TIM3 CHI1 CHI2---PA6 PA7; - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE); - GPIO_StructInit(&GPIO_InitStructure); - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; - GPIO_Init(GPIOA, &GPIO_InitStructure); - } - else if (GPIO_AF == 1){ - //---------------------------------------------------------------TIM3 CHI1 CHI2---PB4 PB5; - GPIO_PinRemapConfig(GPIO_PartialRemap_TIM3,ENABLE); - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB , ENABLE); - GPIO_StructInit(&GPIO_InitStructure); - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_5; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; - GPIO_Init(GPIOB, &GPIO_InitStructure); - } - TIM3_NVIC_Configuration(); //enable interrupt - - } - - else if( TIMx == TIM4){ - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4 , ENABLE); /* enable clock */ - if(GPIO_AF == 0){ - //---------------------------------------------------------------TIM4 CHI1 CHI2---PB6 PB7; - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB , ENABLE); - GPIO_StructInit(&GPIO_InitStructure); - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; - GPIO_Init(GPIOB, &GPIO_InitStructure); - } - else if (GPIO_AF == 1){ - //---------------------------------------------------------------TIM4 CHI1 CHI2---PD12 PD13; - GPIO_PinRemapConfig(GPIO_Remap_TIM4,ENABLE); - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD , ENABLE); - GPIO_StructInit(&GPIO_InitStructure); - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; - GPIO_Init(GPIOD, &GPIO_InitStructure); - - } - TIM4_NVIC_Configuration(); + RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); /* enable clock */ + if (GPIO_AF == 0) + { + //---------------------------------------------------------------TIM2 CHI1 CHI2---PA0 PA1; + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); + GPIO_StructInit(&GPIO_InitStructure); + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; + GPIO_Init(GPIOA, &GPIO_InitStructure); + } + else if (GPIO_AF == 1) + { + //---------------------------------------------------------------TIM2 CHI1 CHI2---PA15 PB3; + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO, ENABLE); + GPIO_PinRemapConfig(GPIO_FullRemap_TIM2, ENABLE); + GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE); // This is very important! - } - else if( TIMx == TIM5){ + GPIO_StructInit(&GPIO_InitStructure); + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; + GPIO_Init(GPIOA, &GPIO_InitStructure); - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM5 , ENABLE); - - if(GPIO_AF == 0){ - //---------------------------------------------------------------TIM5 CHI1 CHI2---PA0 PA1; - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE); - GPIO_StructInit(&GPIO_InitStructure); - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; - GPIO_Init(GPIOA, &GPIO_InitStructure); + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; + GPIO_Init(GPIOB, &GPIO_InitStructure); + } + TIM2_NVIC_Configuration(); // enable interrupt } - TIM5_NVIC_Configuration(); + + else if (TIMx == TIM3) + { + RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3 | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOA, ENABLE); /* enable clock */ + if (GPIO_AF == 0) + { + //---------------------------------------------------------------TIM3 CHI1 CHI2---PA6 PA7; + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); + GPIO_StructInit(&GPIO_InitStructure); + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; + GPIO_Init(GPIOA, &GPIO_InitStructure); + } + else if (GPIO_AF == 1) + { + //---------------------------------------------------------------TIM3 CHI1 CHI2---PB4 PB5; + GPIO_PinRemapConfig(GPIO_PartialRemap_TIM3, ENABLE); + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); + GPIO_StructInit(&GPIO_InitStructure); + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_5; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; + GPIO_Init(GPIOB, &GPIO_InitStructure); + } + TIM3_NVIC_Configuration(); // enable interrupt + } + + else if (TIMx == TIM4) + { + RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4, ENABLE); /* enable clock */ + if (GPIO_AF == 0) + { + //---------------------------------------------------------------TIM4 CHI1 CHI2---PB6 PB7; + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); + GPIO_StructInit(&GPIO_InitStructure); + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; + GPIO_Init(GPIOB, &GPIO_InitStructure); + } + else if (GPIO_AF == 1) + { + //---------------------------------------------------------------TIM4 CHI1 CHI2---PD12 PD13; + GPIO_PinRemapConfig(GPIO_Remap_TIM4, ENABLE); + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE); + GPIO_StructInit(&GPIO_InitStructure); + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; + GPIO_Init(GPIOD, &GPIO_InitStructure); + } + TIM4_NVIC_Configuration(); + } + else if (TIMx == TIM5) + { + + RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM5, ENABLE); + + if (GPIO_AF == 0) + { + //---------------------------------------------------------------TIM5 CHI1 CHI2---PA0 PA1; + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); + GPIO_StructInit(&GPIO_InitStructure); + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; + GPIO_Init(GPIOA, &GPIO_InitStructure); + } + TIM5_NVIC_Configuration(); + } + + // 设定TIM_CKD_DIV1和TIM_ICFilter主要起到的是滤除高频信号噪声的作用 + TIM_TimeBaseStructInit(&TIM_TimeBaseStructure); + TIM_TimeBaseStructure.TIM_Prescaler = 0x0; /* prescler : 72M/72 */ + TIM_TimeBaseStructure.TIM_Period = ENCODER_TIM_PERIOD; + TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; + TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; /* count upwards */ + TIM_TimeBaseInit(TIMx, &TIM_TimeBaseStructure); + + TIM_EncoderInterfaceConfig(TIMx, TIM_EncoderMode_TI12, TIM_ICPolarity_Rising, TIM_ICPolarity_Rising); + TIM_ICStructInit(&TIM_ICInitStructure); + TIM_ICInitStructure.TIM_ICFilter = 10; + TIM_ICInit(TIMx, &TIM_ICInitStructure); + TIM_Cmd(TIMx, ENABLE); + TIMx->CNT = 0x7fff; } - TIM_TimeBaseStructInit(&TIM_TimeBaseStructure); - TIM_TimeBaseStructure.TIM_Prescaler= 0x0; /* prescler : 72M/72 */ - TIM_TimeBaseStructure.TIM_Period = ENCODER_TIM_PERIOD; - TIM_TimeBaseStructure.TIM_ClockDivision=TIM_CKD_DIV1; - TIM_TimeBaseStructure.TIM_CounterMode=TIM_CounterMode_Up; /* count upwards */ - TIM_TimeBaseInit(TIMx , &TIM_TimeBaseStructure); + float PB_Get_Encode_TIM2(void) + { + float cnt; + cnt = (float)((uint16_t)0x7fff) - (float)((uint16_t)(TIM2->CNT)); //! (float) is must + TIM2->CNT = 0x7fff; + return cnt; + } + float Get_EncoderTIM3(void) + { + float cnt; + cnt = (float)((uint16_t)30000) - (float)((uint16_t)(TIM3->CNT)); + TIM3->CNT = 30000; + return cnt; + } - TIM_EncoderInterfaceConfig(TIMx, TIM_EncoderMode_TI12,TIM_ICPolarity_Rising, TIM_ICPolarity_Rising); - TIM_ICStructInit(&TIM_ICInitStructure); - TIM_ICInitStructure.TIM_ICFilter = 10; - TIM_ICInit(TIMx, &TIM_ICInitStructure); - TIM_Cmd(TIMx, ENABLE); - TIMx->CNT = 0x7fff; -} + float Get_EncoderTIM4(void) + { + float cnt; + cnt = (float)((uint16_t)30000) - (float)((uint16_t)(TIM4->CNT)); + TIM4->CNT = 30000; + return cnt; + } -float PB_Get_Encode_TIM2(void) -{ - float cnt; - cnt = (float)((uint16_t)0x7fff) - (float)((uint16_t)(TIM2->CNT)) ; //! (float) is must - TIM2->CNT = 0x7fff; - return cnt; -} - -float Get_EncoderTIM3(void) -{ - float cnt; - cnt = (float)((uint16_t)30000) - (float)((uint16_t)(TIM3->CNT)) ; - TIM3->CNT = 30000; - return cnt; -} - -float Get_EncoderTIM4(void) -{ - float cnt; - cnt = (float)((uint16_t)30000) - (float)((uint16_t)(TIM4->CNT)) ; - TIM4->CNT = 30000; - return cnt; -} - -float PB_Get_Encode_TIM5(void) -{ - float cnt; - cnt = (float)((uint16_t)0x7fff) - (float)((uint16_t)(TIM5->CNT)) ; - TIM5->CNT = 0x7fff; - return cnt; -} + float PB_Get_Encode_TIM5(void) + { + float cnt; + cnt = (float)((uint16_t)0x7fff) - (float)((uint16_t)(TIM5->CNT)); + TIM5->CNT = 0x7fff; + return cnt; + } #ifdef __cplusplus } -#endif +#endif diff --git a/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/Lib/KinematicModels/differential.h b/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/Lib/KinematicModels/differential.h index b06e9d6..af1569d 100644 --- a/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/Lib/KinematicModels/differential.h +++ b/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/Lib/KinematicModels/differential.h @@ -19,15 +19,16 @@ public: virtual void motionSolver(float* robot_speed, float* motor_speed) { // robot_speed[0] x robot_speed[1] y robot_speed[2] z motor_speed[0] = (-robot_speed[0] + robot_speed[2] * body_radius)/ wheel_radius; - motor_speed[1] = (robot_speed[0] + robot_speed[2] * body_radius) / wheel_radius; + motor_speed[1] = ( robot_speed[0] + robot_speed[2] * body_radius) / wheel_radius; } //反解算, 把各个轮子的速度转为机器人的速度 ,这里通过固定时间间隔转为里程 virtual void get_odom(struct Odom* odom, float* motor_dis, unsigned long interval) { - float dxy_ave = (-motor_dis[0] + motor_dis[1]) / 2.0; - float dth = (motor_dis[0] + motor_dis[1]) / (2* body_radius); - float vxy = 1000 * dxy_ave / interval; - float vth = 1000 * dth / interval; + + float dxy_ave = (-motor_dis[0] + motor_dis[1]) / 2.0; + float dth = ( motor_dis[0] + motor_dis[1]) / (2* body_radius); + float vxy = 1000 * dxy_ave / interval; + float vth = 1000 * dth / interval; odom->vel_x = vxy; odom->vel_y = 0; diff --git a/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/Lib/KinematicModels/omni3.h b/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/Lib/KinematicModels/omni3.h index 9028c3c..fac1a77 100644 --- a/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/Lib/KinematicModels/omni3.h +++ b/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/Lib/KinematicModels/omni3.h @@ -4,10 +4,9 @@ #include "model.h" #include "math.h" -//定义Motor数目 +// 定义Motor数目 #define MOTOR_COUNT 3 - #define sqrt_of_3 1.732f // 3轮全向模型接口实现 @@ -16,33 +15,37 @@ class Omni3 : public Model public: Omni3() {} Omni3(float _wheel_radius, float _body_radius) : Model(_wheel_radius, _body_radius) {} - - //运动解算 把给到机器人的速度分解为各个轮子速度 - void motionSolver(float* robot_speed, float* motor_speed) { + + // 运动解算 把给到机器人的速度分解为各个轮子速度 + void motionSolver(float *robot_speed, float *motor_speed) + { // robot_speed[0] x robot_speed[1] y robot_speed[2] z - motor_speed[0] = (robot_speed[1] + robot_speed[2] * body_radius)/ wheel_radius; - motor_speed[1] = (-robot_speed[0]*sqrt_of_3*0.5 - robot_speed[1]*0.5 + robot_speed[2] * body_radius) / wheel_radius; - motor_speed[2] = (robot_speed[0]*sqrt_of_3*0.5 - robot_speed[1]*0.5 + robot_speed[2] * body_radius) / wheel_radius; - } - - //反解算, 把各个轮子的速度转为机器人的速度 ,这里通过固定时间间隔转为里程 - void get_odom(struct Odom* odom, float* motor_dis, unsigned long interval) { - if (motor_dis[0]!=0 || motor_dis[1]!=0 || motor_dis[2]!=0){ - //speed - float dvx = (-motor_dis[1]+motor_dis[2])*sqrt_of_3/3.0f; - float dvy = (motor_dis[0]*2-motor_dis[1]-motor_dis[2])/3.0f; - float dvth = (motor_dis[0]+motor_dis[1]+motor_dis[2])/ (3 * body_radius); - odom->vel_x = dvx / interval; - odom->vel_y = dvy / interval; - odom->vel_z = dvth / interval; + motor_speed[0] = (robot_speed[1] + robot_speed[2] * body_radius) / wheel_radius; + motor_speed[1] = (-robot_speed[0] * sqrt_of_3 * 0.5 - robot_speed[1] * 0.5 + robot_speed[2] * body_radius) / wheel_radius; + motor_speed[2] = (robot_speed[0] * sqrt_of_3 * 0.5 - robot_speed[1] * 0.5 + robot_speed[2] * body_radius) / wheel_radius; + } + + // 反解算, 把各个轮子的速度转为机器人的速度 ,这里通过固定时间间隔转为里程 + void get_odom(struct Odom *odom, float *motor_dis, unsigned long interval) + { + if (motor_dis[0] != 0 || motor_dis[1] != 0 || motor_dis[2] != 0) + { + // speed + float dvx = (-motor_dis[1] + motor_dis[2] ) * sqrt_of_3 / 3.0f; + float dvy = ( motor_dis[0] * 2 - motor_dis[1] - motor_dis[2]) / 3.0f; + float dvth = ( motor_dis[0] + motor_dis[1] + motor_dis[2]) / (3 * body_radius); + + odom->vel_x = dvx / interval; + odom->vel_y = dvy / interval; + odom->vel_z = dvth / interval; float th = odom->z; - //odometry - float dx = (-sin(th)*motor_dis[0]*2+(-sqrt_of_3*cos(th)+sin(th))*motor_dis[1]+(sqrt_of_3*cos(th)+sin(th))*motor_dis[2])/3.0f; - float dy = (cos(th)*motor_dis[0]*2+(-sqrt_of_3*sin(th)-cos(th))*motor_dis[1]+(sqrt_of_3*sin(th)-cos(th))*motor_dis[2])/3.0f; - float dth = (motor_dis[0]+motor_dis[1]+motor_dis[2])/ (3 * body_radius); - + // odometry + float dx = (-sin(th) * motor_dis[0] * 2 + (-sqrt_of_3 * cos(th) + sin(th)) * motor_dis[1] + (sqrt_of_3 * cos(th) + sin(th)) * motor_dis[2]) / 3.0f; + float dy = (cos(th) * motor_dis[0] * 2 + (-sqrt_of_3 * sin(th) - cos(th)) * motor_dis[1] + (sqrt_of_3 * sin(th) - cos(th)) * motor_dis[2]) / 3.0f; + float dth = (motor_dis[0] + motor_dis[1] + motor_dis[2]) / (3 * body_radius); + odom->x += dx; odom->y += dy; odom->z += dth; diff --git a/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/User/robot.cpp b/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/User/robot.cpp index 0e0e7fc..d3b4599 100644 --- a/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/User/robot.cpp +++ b/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/User/robot.cpp @@ -432,7 +432,7 @@ void Robot::DoKinmatics() DataHolder::get()->pid_data.input[i] = int(input[i]); DataHolder::get()->pid_data.output[i] = int(feedback[i]); } - + log("output=%ld %ld", output[0], output[1]); #if PID_DEBUG_OUTPUT #if MOTOR_COUNT==2 log("output=%ld %ld", output[0], output[1]); @@ -486,7 +486,8 @@ void Robot::CalcOdom() #endif float dis[MOTOR_COUNT] = {0}; for (int i=0;iget_increment_count_for_odom()*__PI*DataHolder::get()->parameter.params.wheel_diameter*0.001/DataHolder::get()->parameter.params.encoder_resolution/DataHolder::get()->parameter.params.motor_ratio; #if ODOM_DEBUG_OUTPUT log(" %ld ", long(dis[i]*1000000)); diff --git a/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/pibot.uvoptx b/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/pibot.uvoptx index c0f2aba..77f4bf3 100644 --- a/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/pibot.uvoptx +++ b/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/pibot.uvoptx @@ -82,17 +82,17 @@ 0 Base Board Schematics (MCBSTM32E) - D:\Program Files\Keilv5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e-base-board-schematics.pdf + C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e-base-board-schematics.pdf 1 Display Board Schematics (MCBSTM32E) - D:\Program Files\Keilv5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e-display-board-schematics.pdf + C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e-display-board-schematics.pdf 2 User Manual (MCBSTM32E) - D:\Program Files\Keilv5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e.chm + C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.1.0\Documents\mcbstm32e.chm 3 @@ -199,7 +199,7 @@ FWlib - 0 + 1 0 0 0 @@ -339,7 +339,7 @@ CMSIS - 0 + 1 0 0 0 @@ -415,7 +415,7 @@ STARTUP - 0 + 1 0 0 0 diff --git a/Hardware/银星机器人底盘/README.md b/Hardware/银星机器人底盘/README.md index 601c025..d5a4786 100644 --- a/Hardware/银星机器人底盘/README.md +++ b/Hardware/银星机器人底盘/README.md @@ -64,7 +64,14 @@ if (pwm_value > 5) { ​ 目前银星机器人采用的是霍尔编码器,但是其磁环的参数是未知的。常见的磁环的有22个极性。那么电机转动一圈下来就会产生44个脉冲计数。霍尔编码器原理详情见《霍尔编码器原理》。 ```c -// 运动距离 = (编码器数值 / 编码器一圈脉冲计数) * 减速比 * 轮子直径 / 2 * PI -dis = (encoder_num / ENCODER_RATIO) * reduction ratio * wheel_diameter / 2 * PI; +// 运动距离 = 编码器数值 / 编码器一圈脉冲计数 / 减速比 * 轮子直径 * PI +dis = (encoder_num / ENCODER_RATIO) / reduction ratio * wheel_diameter / PI; +``` + +​ 对应的,在`robot.cpp`中,可以看到里程计的换算,轮子直径原始是mm单位乘以0.001转m: + +```C++ +// 距离 = 编码器的增量 * PI * 轮子直径/ 编码器一圈脉冲计数 / 电机减速比 +dis[i] = encoder[i]->get_increment_count_for_odom()*__PI*DataHolder::get()->parameter.params.wheel_diameter*0.001/DataHolder::get()->parameter.params.encoder_resolution/DataHolder::get()->parameter.params.motor_ratio; ```