Arduino libraries and application files for the GPS and IMU data acquisition and sending it through CAN bus.
- On Windows: tutorial link
- On Linux: tutorial link
- Go to Tools / Board / Boards Manager and type "due".
- Install the "Arduino SAM Boards (32-bits ARM Cortex-M3)" (the version used for the project is the 1.6.12).
If your computer does not recognize the COM port, please follow the instructions of this Arduino tutorial.
Once your program is ready to be upload to the Arduino Due, setup the connection :
- Plug the Arduino Due board to your computer with a micro USB cable with the programming port.
- Go to Tools/Board and select "Arduino Due (programming port)".
- Select the active COM port in Tools/Port (next to the one active it should be written "programming port").
Then, press Ctrl+U
or click on the "Upload" button (right arrow next to the check logo).
All you need is to copy-paste all the directories from the "libraries" directory to your Arduino Library folder. On Windows, this folder can be found on Documents/Arduino/libraries
, on Linux it should be at ~/Arduino/libraries
.
Then, you just have to open the Due_code_CAN_GPS_IMU.ino
file and upload it to the Due board.
NB: You need, of course, to plug all the needed shield on the Due board.
Here is the list:
- The CAN shield (CAN-BUS shield V2.0 by Seed Studio)
- The GPS shield (X-NUCLEO-GNSS1A1)
- The IMU shield (X-NUCLEO-IKS01A2)
Name | ID |
---|---|
11bits | |
GPS (latitude and longitude) | 0x201 |
IMU_ACCELXY (x and y acceleration) | 0x202 |
IMU_MAGNETOXY (x and y magnetic fields) | 0x203 |
IMU_ROTATIONXY (x and y rotation) | 0x204 |
IMU_ACCELMAGNETOZ (z acceleration and z magnetic field) | 0x205 |
IMU_ROTATIONZ (z rotation) | 0x206 |
- From: Arduino Due
- To: Raspberry Pi
- Lenght (Bytes): 8
- Data field:
Bytes 0-3 | Bytes 4-7 |
---|---|
latitude | longitude |
- latitude
- Hexadecimal value of the latitude. The value is an integer, if you want the decimal degree value you need to divide it by 10^7.
- longitude
- Hexadecimal value of the longitude. As for the latitude, the longitude value is an integer, if you want the decimal degree value you need to divide it by 10^7.
- From: Arduino Due
- To: Raspberry Pi
- Lenght (Bytes): 8
- Data field:
Bytes 0-3 | Bytes 4-7 |
---|---|
x_acceleration | y_acceleration |
- x_acceleration
- Hexadecimal value of acceleration on the x axis. The current unit is mg (millig). In order to convert it to m/s² you will have to divide it by 1000 and then multiply it with g = 9.807.
- y_acceleration
- Hexadecimal value of acceleration on the y axis. The current unit is mg (millig). In order to convert it to m/s² you will have to divide it by 1000 and then multiply it with g = 9.807.
- From: Arduino Due
- To: Raspberry Pi
- Lenght (Bytes): 8
- Data field:
Bytes 0-3 | Bytes 4-7 |
---|---|
x_magneto | y_magneto |
- x_magneto
- Hexadecimal value of the magnetic field on the x axis. The current unit is mGauss (milliGauss). In order to convert it to Tesla you will have to divide it by 10^7.
- y_magneto
- Hexadecimal value of the magnetic field on the y axis. The current unit is mGauss (milliGauss). In order to convert it to Tesla you will have to divide it by 10^7.
- From: Arduino Due
- To: Raspberry Pi
- Lenght (Bytes): 8
- Data field:
Bytes 0-3 | Bytes 4-7 |
---|---|
x_rotation | y_rotation |
- x_rotation
- Hexadecimal value of the rotation on the x axis. The current unit is mdps (milli degres per seconde). In order to convert it to rad/s you will have to divide it by 1000 and then multiply it with (pi/180).
- x_rotation
- Hexadecimal value of the rotation on the y axis. The current unit is mdps (milli degres per seconde). In order to convert it to rad/s you will have to divide it by 1000 and then multiply it with (pi/180).
- From: Arduino Due
- To: Raspberry Pi
- Lenght (Bytes): 8
- Data field:
Bytes 0-3 | Bytes 4-7 |
---|---|
z_acceleration | z_magneto |
- z_acceleration
- Hexadecimal value of acceleration on the z axis. The current unit is mg (millig). In order to convert it to m/s² you will have to divide it by 1000 and then multiply it with g = 9.807.
- z_magneto
- Hexadecimal value of the magnetic field on the z axis. The current unit is mGauss (milliGauss). In order to convert it to Tesla you will have to divide it by 10^7.
- From: Arduino Due
- To: Raspberry Pi
- Lenght (Bytes): 4
- Data field:
Bytes 0-3 |
---|
z_rotation |
- z_rotation
- Hexadecimal value of the rotation on the z axis. The current unit is mdps (milli degres per seconde). In order to convert it to rad/s you will have to divide it by 1000 and then multiply it with (pi/180).