diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..62a912e --- /dev/null +++ b/404.html @@ -0,0 +1,572 @@ + + + +
+ + + + + + + + + + + + + + +LiDAR is a remote sensing technology that uses laser beams to measure +distances and create detailed 3D maps of objects and environments.
+It stands for Light Detection and Ranging.
+By emitting laser pulses and analyzing the reflected light, LiDAR determines the range, elevation, and spatial +information of various surfaces and objects.
+LiDAR can be used in autonomous robots/vehicules to detect and measure +the distance to surrounding objects, enabling real-time obstacle avoidance +and enhancing overall safety.
+ +In forestry applications, LiDAR can help create detailed and +precise 3D maps of forests, enabling efficient forest management strategies, +including monitoring tree growth and health, assessing fire risks, and +optimizing logging operations.
+ +LiDAR scanning can aid in archaeological excavations, allowing +researchers to non-invasively create 3D models of sites, +helping with documentation, preservation, and analysis of cultural heritage, +artifacts, and structures.
+ + + + + + + + + + + + + + + + +#include <lidar.hpp>
+
+// declare a new instance of Lidar
+lidar::Lidar Lidar;
+
+void setup() {
+
+ // declare lidar configuration
+ lidar::LidarConfig config = {
+ .serial = Serial1, .motor_pin = 19, .motor_speed = 120, .timeout = 300};
+
+ // configure our lidar object
+ Lidar.setup(config);
+
+ // launch it as a service in the background
+ lidar::startService(Lidar);
+}
+
+void loop() {
+ // receive a point
+ lidar::LidarPoint point = Lidar.getCurrentPoint();
+ // process the point
+ doSomethingWithThePoint(point);
+}
+
To build a new LiDAR instance or service we need to pass on the configuration struct:
+lidar::LidarConfig
+Attribute | +Type | +Description | +
---|---|---|
serial |
+HardwareSerial | +defines the hardware serial used | +
motor_pin |
+int | +pin in esp32 used by lidar's motor | +
motor_speed |
+int | +motor speed between 120 "slow" and 360 "veryfast" | +
timeout |
+int | +used to skip data acquistion and move to the next operation | +
lidar::LidarConfig config =
+ {
+ .serial = Serial1,
+ .motor_pin = 19,
+ .motor_speed = 120,
+ .timeout = 300
+ };
+
function used to read the point: LIDAR::Lidar.getCurrentPoint()
+lidar::LidarPoint
+Attribute | +Type | +Description | +
---|---|---|
distance |
+float | +distance from lidar to surface in mm | +
angle |
+float | +relative angle at which the point was detected in degrees | +
quality |
+int | +quality of the point ranges from 1 low quality - 15 high quality | +
bool |
+startBit | +not implemented | +
This is LiDAR we use at Unimakers club
++ + +
+namespace lidar {
+
+// starts lidar service
+void startService(Lidar &lidar);
+
+struct LidarPoint {
+ float distance;
+ float angle;
+ uint8_t quality;
+ bool startBit;
+};
+
+struct LidarConfig {
+ // Hardware Serial, Serial1 or Serial2
+ HardwareSerial &serial;
+
+ // GPIO PIN
+ int motor_pin;
+
+ // 0 -> 360
+ int motor_speed;
+
+ //point aquisition timeout,
+ // might affect freshness of the points
+ int timeout;
+};
+
+class Lidar {
+ public:
+ Lidar();
+ ~Lidar();
+
+ // setup the lidar object
+ void setup(LidarConfig &config);
+
+ // get last processed point
+ const LidarPoint &getCurrentPoint();
+};
+}
+
#pragma once
+
+#include "Arduino.h"
+#include "commands.hpp"
+#include "types.hpp"
+
+namespace lidar {
+
+struct LidarPoint {
+ float distance;
+ float angle;
+ uint8_t quality;
+ bool startBit;
+};
+
+struct LidarConfig {
+ HardwareSerial &serial;
+ int motor_pin; // GPIO PIN
+ int motor_speed; // 0 -> 360
+ int timeout; // point aquisition timeout, might affect freshness of the
+ // points
+};
+
+class Lidar {
+ public:
+ enum {
+ LIDAR_SERIAL_BAUDRATE = 115200,
+ LIDAR_TIMEOUT = 500,
+ };
+
+ Lidar();
+ ~Lidar();
+
+ // the recommended way to setup the lidar and starts as a service
+ void setup(LidarConfig &config);
+
+ void setMotorPin(int pin);
+ void setLidarSpeed(int speed);
+
+ // use setup instead with a proper configuration
+ // open the given serial interface and try to connect to the lidar
+ void begin(HardwareSerial &serialobj);
+
+ // close the currently opened serial interface
+ void end();
+
+ // check whether the serial interface is opened
+ bool isOpen();
+
+ // retrieve currently received sample point
+ const LidarPoint &getCurrentPoint();
+
+ // try to reconnect in case of failure
+ void reconnect();
+
+ // data acquisition loop
+ const void loop();
+
+ // ask the lidar for its health info
+ u_result getHealth(lidar_response_device_health_t &healthinfo,
+ _u32 timeout = LIDAR_TIMEOUT);
+
+ // ask the lidar for its device info like the serial number
+ u_result getDeviceInfo(lidar_response_device_info_t &info,
+ _u32 timeout = LIDAR_TIMEOUT);
+
+ // start the measurement operation
+ u_result startScan(bool force = false, _u32 timeout = LIDAR_TIMEOUT * 2);
+
+ // stop the measurement operation
+ u_result stop();
+
+ // wait for one sample point to arrive
+ u_result scan(_u32 timeout = LIDAR_TIMEOUT);
+
+ protected:
+ u_result _sendCommand(_u8 cmd, const void *payload, size_t payloadsize);
+ u_result _waitResponseHeader(lidar_ans_header_t *header, _u32 timeout);
+
+ protected:
+ HardwareSerial *_bined_serialdev;
+ LidarPoint _currentMeasurement;
+ int _lidar_motor_pin;
+ int _lidar_speed;
+};
+
+// starts lidar service
+void startService(Lidar &lidar);
+
+} // namespace LIDAR
+
this is just a test of flowchart +the flowchart below doesn't make any sense
+flowchart LR
+ TaskManager --> LiDAR_Task
+ TaskManager --> Movement_Task
+ TaskManager --> Executor_Task
+ TaskManager --> Network_Task
+ TaskManager --> Vision_Task
+ EQL["EQL Processor"] --> Movement_Task
+ Executor_Task <--> Network_Task
+ Executor_Task <--> Vision_Task
+ Executor_Task <--> LiDAR_Task
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {"use strict";/*!
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */var Wa=/["'&<>]/;Vn.exports=Ua;function Ua(e){var t=""+e,r=Wa.exec(t);if(!r)return t;var o,n="",i=0,s=0;for(i=r.index;i