The explorer and mapper robot will be a robot with four wheels which will evolute in a room. Thanks to some ultrasonic ranging modules and AHRS, it will take some positions, then send and/or record them. With that data, we can plot the shape of the room and the object. I will use a Nucleo board, and perhaps add a hardware abstraction layer to also support an Arduino board in the robot. As the plotting application, I will use a computer or a Raspberry or a STM32F4 board with a screen. And of course, everything will be made with Ada.
LinksAdding the project in GitHub: https://github.com/Levraichacal/EMR1
I made a branch of AdaDriversLibrary and added the support of the Nucleo F411RE. You can find it at: https://github.com/Levraichacal/Ada_Drivers_Library. I also added to this branch the mpu6050 motion sensors.
On EMR1, I removed the unused drivers as I used the one in AdaDriversLibrary
I added the common and the blinky project to be sure that the builder work properly: link.
As I never use multitask in Ada and furthermore with the ravenscar norm, I made a small project with four tasks that toggle some LEDs at different speed (1, 2, 3, 4 seconds). This is the link to that project 2 - Task test. I will use tasks to:
- get the data from the MPU6050
- get the data from the HMC5883L
- get the data from the six HC-SR04
- calculate the AHRS
- drive the motor
- send the data.
Some extra things will be:
- get the data from 2 other MPU6050s
- calculate the Euler' angles of each
- drive the servomotors
- get the data from the two other HC-SR04
As I need a compass to have a cap, I chose the HMC5883L from honeywell. So I wrote the HMC5883L package for drive it. It is at the following link: HMC5883L driver.
To follow my project and add the changes, I put everything on my website.
I won't have the time to complete my project by the deadline: baby, moving and travelling for work have used all my free time. I will continue it when I will have free time again (probably next week) and publish everything on my website and my GitHub. Its application maps and scans using different sensors for detection in a military field or after climatic disasters like a security breach in the home or after an earthquake, tsunami etc.
The PlanThis is the plan that I wanted to follow.
For the robot:
1. Write the driver for the NucleoF411RE. (OK thanks to svd2ada)
2. Test the port with LEDs. (OK)
3. Test the task with ravenscar respect on the NucleoF411RE. (OK)
4. Write the driver for the MPU6050. (OK)
5. Write the driver for the HMC5883L. (OK)
6. Get and send the HMC5883L data with two different tasks. (In progress)
7. Get and send the MPU6050 data with two different tasks - the sending will be common with the other sensors. (In progress)
8. Write the AHRS with a task. (In progress)
9. Write the motors drivers. (In progress)
10. Write the drivers for the HC-SR04. (Not started but previously made with an Arduino in Ada)
11. Use the HC-SR04 for positioning the robot and to control its movement:
- go further from 10 cm until its at 30 cm
- turn left, and go further from 10 cm until 50 cm
- turn left and restart the scanning
12. Take all the data, and send it to each stop. The aim is to have the position of the robot and the different distances measured by the six HC-SR04. The position of the different HC-SR04 are known and the coordinates will be calculated by the receiver. (Extra)
13. Add calibration mode for the compass (HMC5883L), the IMU (MPU6050), the ultrasonic sensors (the six HC-SR04).
14. Add two HC-SR04 onto the platform to be controlled by two servo motors for 3D mapping.
15. Add control mode to manually direct the receiver parts.
16. Add other sensors: camera, gaz/oxygen detection, smoke detection, radioactivity sensor, metal detection, mines detection.
17. Support other board from STM and Arduino Due.
For the receiver:
1. Receive the data and print it. (In progress)
2. Calculate the coordinates and print it on the screen.
3. Plot the point representing the coordinates on the screen. (Extra)
4. Add a menu for connecting.
5. Add a touch for each sensor that needs to be calibrated.
6. Add a scale on the screen to zoom in and out on the map.
7. Add the 3D representation of the coordinates.
8. Add manual mode to control and use the accelerometers of the Disco1-F469 to control the movement.
The ArchitectureThe architecture will be as follows.
On the robot:
A semaphore for each sensors to protect the reading and writing of the data. It will keep it safe and avoid having a problem with the AHRS calculation or sending data to the receiver.
So it will be on those tasks:
1. Get the HMC5883L Data at 25 Hz
2. Get the MPU6050 Data at 25 Hz
3. Calculate the AHRS at 25 Hz
4. Send the data at 10 HZ
I will use a common PWM for the HC-SR04 and interruptions for the return of the information.
On the receiver:
The received data will interrupt once they arrive. A procedure will plot the data on the screen. It will use connecting mode, calibration and auto/manual mode.
*OPEN: Everything is protected under GPL3 licence. As mentioned previously, everything is stored on my GitHub. I used GPS IDE from AdaCore.
- COLLABORATIVE: Everything is explained on the website and the code is stored on GitHub. I will commit the driver on the AdaCore GitHub, also. Everybody is free to reuse my codes.
- DEPENDABLE: I used the ravenscar profile to follow the realtime rules and keep the system safe. I comment all my code before uploading it on GitHub to be readable.
- INVENTIVE: I don't know if a robot like mine has been already coded in Ada but it was for me a way to code in Ada and use Ravenscar profile and multitasking. And also, starting to code on the STM chip and with Ada, my favourite language (but I don't used it at work at the moment).
Comments