Aller au contenu


dakota99

Inscrit(e) (le) 29 août 2021
Déconnecté Dernière activité févr. 14 2024 07:28
-----

Messages que j'ai postés

Dans le sujet : UGV à base d'éléments de trottinette ou d'hoverboard

13 février 2024 - 09:48

Bonjour Oracid

Moi je suis d'accord avec Madame. Je trouve que c'est très bien. Très clair. Très didactique.

Merci beaucoup et continue stp.


Dans le sujet : Communication MODBUS RTU

08 février 2024 - 03:13

Thank you Tnera for your reply.

I'm still searching and asking questions to the technical support wich is unreachable...

So I'm quite sure it is MODBUS RTU. So it is a serial communication. That's why I can not find any ip adress.

But I do not have any com port created.

From my point of view I need a converter or a software tool to emulate a serial port....

I will try ChatGPT

Thank you :)


Dans le sujet : Lidar rotatif

31 octobre 2023 - 09:47

Bonjour

J'ai branché le Lidar LD19 sur une Arduino Mega. UART 3

Installé la librairie LD06.h

Le lidar tourne mais rien ne s'affiche dans le moniteur série

Code :

#include "ld06.h"
LD06 ld06(Serial3);  

void setup() {
  Serial.begin(9600);  // Start the Serial you want to display data
  ld06.init();         // Init Serial Lidar to 230400 Bauds and set lidar pwm pin mode if pwm pin is specified
  Serial.println("setup completed"); 
}

void loop() {
  if (ld06.readScan()) {             // Read lidar packets and return true when a new full 360° scan is available
    ld06.printScanTeleplot(Serial);  // Print full scan using teleplot format (check :https://teleplot.fr/)
    ld06.printScanCSV(Serial);  // Print scan in csv format
    if (ld06.isNewScan()) {     // Even if fullScan is disabled you can know when last data chunk have a loop closure
      Serial.println("This is a new scan! ");
    }
    Serial.println(ld06.getSpeed());        // Show the lidar speed in degrees ° / second
    Serial.println(ld06.getAngleStep());    // Show the angle step resolution in degree
    uint16_t n = ld06.getNbPointsInScan();  // Give the number of points in the scan, can be usefull with filtering to tell if there are abstacles around the lidar
    Serial.println(String() + "There are " + ld06.getNbPointsInScan() + " lidar points in the defined range !");
    for (uint16_t i = 0; i < n; i++) {
      Serial.println(String() + ld06.getPoints(i)->angle + "," + ld06.getPoints(i)->distance + ";");  // example to show how to extract data. ->x, ->y and ->intensity are also available.
    }
  }
}

J'en déduis qu'il n'est probablement compatible avec cette librairie.

 

Par contre si je l'utilise avec le code du RPLIDAR SLAMTEC AM08

Des données sont affichées mais pas cohérentes.

#include <RPLidar.h>
RPLidar lidar;               
                        
void setup() {
  Serial.begin(9600);
  lidar.begin(Serial3);
  pinMode(RPLIDAR_MOTOR, OUTPUT);  // set pin modes
  Serial.println("SETUP completed");
}

void loop() {
  if (IS_OK(lidar.waitPoint())) {
    float dis = lidar.getCurrentPoint().distance; //distance in mm 
    float angle = lidar.getCurrentPoint().angle; //angle in degree
    bool  startBit = lidar.getCurrentPoint().startBit; //whether this point is belong to a new scan
    byte  quality  = lidar.getCurrentPoint().quality; //quality of the current measurement

    if (angle > 0 && angle < 10 && dis > 0){
    dis = dis / 10;
    Serial.print(angle);
    Serial.print(" --- ");
    Serial.println(dis);
    }
    
  } else {
    Serial.println("RPlidar not working");
    rplidar_response_device_info_t info;    // try to detect RPLIDAR... 
    if (IS_OK(lidar.getDeviceInfo(info, 100))) {       // detected...
       lidar.startScan();
       delay(1000);
    }
  }
}

Le Lidar est immobile devant une paroi à une distance de 40cm
 

1.64 --- 1241.40
7.80 --- 1025.15
1.81 --- 1094.53
2.58 --- 1280.85
4.00 --- 896.25
8.78 --- 1384.95
1.59 --- 1235.15
1.34 --- 1368.28
8.78 --- 619.20
5.11 --- 288.38
2.20 --- 819.53
4.36 --- 821.90
9.28 --- 632.08
3.25 --- 16.00
3.83 --- 1521.90
9.03 --- 773.08
0.77 --- 825.90
0.11 --- 1025.95
1.00 --- 513.10
8.50 --- 294.60
4.56 --- 917.35
7.00 --- 1230.75
8.00 --- 823.75
6.00 --- 1229.95
0.17 --- 5.10
2.08 --- 1025.15
5.50 --- 1434.55
5.55 --- 896.25
2.75 --- 1491.30
4.58 --- 1241.50
1.50 --- 1030.70
7.05 --- 1025.10
2.56 --- 1587.80
0.06 --- 1104.07
2.58 --- 1026.70
0.56 --- 1440.30
6.78 --- 1027.50
6.05 --- 1024.30
1.02 --- 1299.75
1.00 --- 1024.35
2.00 --- 615.35
5.00 --- 629.10

 

 

 

 

 

 


Dans le sujet : Lidar rotatif

29 octobre 2023 - 06:33

Merci Mike118.

A regarder de plus près le LIDAR LD06 semble fort proche de celui que j'ai acheté LD19

La Datasheet est fort similaire.

Peut-être que ta librairie fonctionne sur ce modèle aussi.

Ce qui est dommage c'est qu'il est livré avec un seul câble qui va du Lidar vers le convertisseur USB.

Il faut donc le couper pour le connecter à la Mega.

Je vais quand même essayer...


Dans le sujet : Lidar rotatif

29 octobre 2023 - 07:58

Bonjour,

Je souhaite obtenir 5 distances comme je le fais actuellement avec un Arduino Mega.

Gauche à 90°

Gauche à 45°

Devant

Droite à 45°

Droite à 90°

 

Concernant le format, je m'adapte

Mais avec le Lidar actuel connecté à l'Arduino Mega il envoie l'angle, la distance et la qualité. Et on filtre les données utiles.

Merci