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.
Fork of CRAC-Strat_2017_homologation_gros_rob by
Diff: Asservissement/Asservissement.cpp
- Revision:
- 9:d0042422d95a
- Parent:
- 6:eddfa414fd11
- Child:
- 11:ed13a480ddca
--- a/Asservissement/Asservissement.cpp	Wed Apr 27 13:05:03 2016 +0000
+++ b/Asservissement/Asservissement.cpp	Thu Apr 28 08:11:36 2016 +0000
@@ -134,3 +134,24 @@
 
     can1.write(msgTx);
 }
+
+void SetOdometrie (unsigned short canId, unsigned short x,unsigned short y,signed short theta)
+{
+    CANMessage msgTx=CANMessage();
+    msgTx.id=canId;
+    msgTx.format=CANStandard;
+    msgTx.type=CANData;
+    msgTx.len=6;
+
+        // x sur 2 octets
+    msgTx.data[0]=(unsigned char)x;
+    msgTx.data[1]=(unsigned char)(x>>8);
+    // y sur 2 octets
+    msgTx.data[2]=(unsigned char)y;
+    msgTx.data[3]=(unsigned char)(y>>8);
+    // theta signé sur 2 octets
+    msgTx.data[4]=(unsigned char)theta;
+    msgTx.data[5]=(unsigned char)(theta>>8);
+
+    can1.write(msgTx);
+}
    