[JacoBot] Arduino #4

Open
Adrien wants to merge 29 commits from Adrien/JacoBot:main into main
Member
No description provided.
Adrien changed title from [JacoBot] Motor encoder basic Arduino implementation with PID to [JacoBot] Arduino robot 2024-04-13 14:28:32 +02:00
Adrien changed title from [JacoBot] Arduino robot to [JacoPad/JacoBot] Arduino 2024-04-23 15:49:21 +02:00
This reverts commit 97dd28a88a.

	deleted:    jacopad/arduino/README.md
	deleted:    jacopad/arduino/main.cpp
	deleted:    jacopad/arduino/token.cpp
	deleted:    jacopad/arduino/token.h
Adrien changed title from [JacoPad/JacoBot] Arduino to [JacoBot] Arduino 2024-04-23 19:27:06 +02:00
benvii left a comment

Good job bro 💪, see my comment to make it a bit more readable.

Good job bro 💪, see my comment to make it a bit more readable.
@ -0,0 +3,4 @@
#include "MotorEncoder.h"
#define pi 3.1415
Car::Car(MotorEncoder* m1, MotorEncoder* m2, float distance)
Owner
  • Add comment see example bellow
  • m1 rename it to left or right
  • m2 rename it to right or left
/**
     * @brief Create a new instance of car
     *
     * This constructor initializes the a Car with 2 motors and the distance between 2 wheels.
     *
     * @param m1 ?
.....
     */
- [ ] Add comment see example bellow - [ ] m1 rename it to left or right - [ ] m2 rename it to right or left ```c++ /** * @brief Create a new instance of car * * This constructor initializes the a Car with 2 motors and the distance between 2 wheels. * * @param m1 ? ..... */ ```
Adrien marked this conversation as resolved
@ -0,0 +7,4 @@
: m_m1(m1), m_m2(m2), m_distance(distance) {
}
void Car::forward(float distance, double setPoint) { //distance : mm
Owner

Add doc string also, see style here : https://www.doxygen.nl/manual/docblocks.html

  • Use doxygen doc string
  • Explain what's the meaning of setPoint, i think it's the number of cycle / rotation ?
Add doc string also, see style here : https://www.doxygen.nl/manual/docblocks.html - [ ] Use doxygen doc string - [ ] Explain what's the meaning of setPoint, i think it's the number of cycle / rotation ?
Adrien marked this conversation as resolved
@ -0,0 +14,4 @@
double m2_duration = 0;
m_m1->setPoint = setPoint;
m_m2->setPoint = setPoint/m2_mmp*m1_mmp;
while(m1_duration<distance/m1_mmp && m2_duration<distance/m2_mmp) {
Owner

Compute this distance/m1_mmp and this distance/m2_mmp only once, store this before the while in 2 variables.

Compute this `distance/m1_mmp` and this `distance/m2_mmp` only once, store this before the while in 2 variables.
Adrien marked this conversation as resolved
@ -0,0 +32,4 @@
m_m2->stop();
}
void Car::turn(float angle, double setPoint) { //angle : degre
Owner
  • Tell that setPoint is the number of detection seen by the encodor between 2 correction (PWM computed changes).

  • Comment the method using doxygen

- [ ] Tell that setPoint is the number of detection seen by the encodor between 2 correction (PWM computed changes). - [ ] Comment the method using doxygen
Author
Member

I will put this in MotoEncoder.h

I will put this in MotoEncoder.h
Adrien marked this conversation as resolved
@ -0,0 +4,4 @@
class Car {
private:
float m_distance;// mm
Owner

Rename it to distance_between_wheels, add a comment it to indicate that it use to rotate right or left.

Rename it to distance_between_wheels, add a comment it to indicate that it use to rotate right or left.
Adrien marked this conversation as resolved
@ -0,0 +5,4 @@
class Car {
private:
float m_distance;// mm
MotorEncoder* m_m1;
Owner

Rename it to m_left or m_right.

Rename it to m_left or m_right.
Adrien marked this conversation as resolved
@ -0,0 +6,4 @@
private:
float m_distance;// mm
MotorEncoder* m_m1;
MotorEncoder* m_m2;
Owner

Rename it to m_left or m_right.

Rename it to m_left or m_right.
Adrien marked this conversation as resolved
@ -0,0 +3,4 @@
#include "Radio.h"
#include "MotorEncoder.h"
#include "Car.h"
Owner

Put all pins in constant using explicit naming :

#define  MLEFT_ENCODER_A       1
#define  MLEFT_ENCODER_B       1
Put all pins in constant using explicit naming : ``` #define MLEFT_ENCODER_A 1 #define MLEFT_ENCODER_B 1 ```
Adrien marked this conversation as resolved
@ -0,0 +29,4 @@
//car.forward(100,50);
}
void loop() {
Owner
  • Add TODO here indicating that some dev still need to be done to map radio messages to the right car movement, create an issue for that so that we don't forget it
- [ ] Add TODO here indicating that some dev still need to be done to map radio messages to the right car movement, create an issue for that so that we don't forget it
Adrien marked this conversation as resolved
@ -0,0 +12,4 @@
Serial.println("Error while initialise the NRF module");
while (1);
}
Serial.println("Module initialised");
Owner

Serial.println("Radio module initialised");

` Serial.println("Radio module initialised"); `
Adrien marked this conversation as resolved
benvii changed title from [JacoBot] Arduino to WIP: [JacoBot] Arduino 2024-04-24 11:09:02 +02:00
benvii changed title from WIP: [JacoBot] Arduino to [JacoBot] Arduino 2024-04-25 15:16:47 +02:00
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u main:Adrien-main
git switch Adrien-main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MDL29/JacoBot!4
No description provided.