Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: VNH5019
Dependents: Aigamozu_Robot_展示会 Aigamozu_Robot_March Aigamozu_Robot_templete
Fork of AigamozuControlPackets by
Diff: AigamozuControlPackets.cpp
- Revision:
- 45:2f47c25a3562
- Parent:
- 43:e011cf13dbb2
- Child:
- 46:c35184266e00
diff -r e011cf13dbb2 -r 2f47c25a3562 AigamozuControlPackets.cpp
--- a/AigamozuControlPackets.cpp Sun Oct 30 04:45:11 2016 +0000
+++ b/AigamozuControlPackets.cpp Sat Mar 11 14:57:17 2017 +0000
@@ -1,14 +1,15 @@
#include "AigamozuControlPackets.h"
#include "VNH5019.h"
-#define RIGHT_SPEED 32
-#define LEFT_SPEED 16
-#define FORWARD_SPEED 32
+#define RIGHT_SPEED 96
+#define LEFT_SPEED 96
+#define FORWARD_SPEED 96
//////////////////////////////
// Init //
//////////////////////////////
AigamozuControlPackets::AigamozuControlPackets(VNH5019 agzSheild):_agzSheild(agzSheild){
+ packetData = new uint8_t[50];
}
//////////////////////////////
@@ -33,6 +34,22 @@
}
}
+
+//////////////////////////////
+// Robot -> Manager //
+//////////////////////////////
+
+ void AigamozuControlPackets::SendDataCommand(uint8_t fromID, uint8_t toID, uint8_t gx,uint8_t gy, uint8_t gz, uint8_t ax, uint8_t ay,uint8_t az, uint8_t flag)
+ {
+
+ uint8_t tmp[] = {'A','G','S','M','F',fromID,'T',toID, gx, gy, gz, ax, ay, az,flag,'A','G','E'};
+ for(int i = 0; i < SEND_DATA_COMMNAD_LENGTH; i++) packetData[i] = tmp[i];
+ packetLength = SEND_DATA_COMMNAD_LENGTH;
+
+ }
+
+
+
//////////////////////////////
// each mode interrupt //
//////////////////////////////
@@ -52,12 +69,12 @@
*/
if(nowMode == AUTO_GPS_MODE){
- if(Move_Timer.read_ms() < 5000){
+ //if(Move_Timer.read_ms() < 5000){
_agzSheild.changeSpeed(1,LEFT_SPEED,1,RIGHT_SPEED);//turn
- }else if(Move_Timer.read_ms() >= 5000 && Move_Timer.read_ms() < 6000){
- _agzSheild.changeSpeed(0,0,0,0);//stop
- Move_Timer.reset();
- }
+ // }else if(Move_Timer.read_ms() >= 5000 && Move_Timer.read_ms() < 6000){
+ // _agzSheild.changeSpeed(0,0,0,0);//stop
+ // Move_Timer.reset();
+ //}
/*
if(Move_Timer.read_ms() < 4000){
_agzSheild.changeSpeed(1,LEFT_SPEED,1,RIGHT_SPEED);//turn
