資源簡介
RPLIDAR A2官網(wǎng):http://www.slamtec.com/cn/Lidar/A2
用C#重新編寫了傳輸協(xié)議,本人代碼技術(shù)有限,程序若有寫的不好的地方,多多包涵
用C#重新編寫了傳輸協(xié)議,本人代碼技術(shù)有限,程序若有寫的不好的地方,多多包涵

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
using?System.IO.Ports;
using?System.Threading;
using?System.Runtime.InteropServices;
using?System.Diagnostics;???
namespace?RPLIDAR
{
????public?partial?class?Form1?:?Form
????{
????????#region?--?Load?value?--
????????Thread?read;
????????Thread?calcirclethread;
????????SerialPort?comm?=?new?SerialPort();
????????int?showfre?=?31;
????????ScanPoint[]?ScanData;
????????Byte[]?STARTSCAN?=?new?Byte[9]?{?0xA5?0x82?0x05?0x00?0x00?0x00?0x00?0x00?0x22?};
????????Byte[]?STOPSCAN?=?new?Byte[2]?{?0xA5?0x25};
????????Byte[]?STARTROTATE?=?new?Byte[6]?{?0xA5?0xF0?0x02?0xC4?0x02?0x91};
????????Byte[]?STOPROTATE?=?new?Byte[6]?{?0xA5?0xF0?0x02?0x00?0x00?0x57?};
????????string?input?=?““;
????????int?loop?=?0;
????????string?angle?=?““;
????????string?lastangle?=?““;
????????int?startalready?=?0;
????????int?startangle?=?0;
????????bool?StartOfNewScan?=?true;
????????int?typei?=?0;
????????double?typed?=?0;
????????readonly?string[]?HealtStatusStrings?=?{?“Good“?“Poor“?“Critical“?“Unknown“?};
????????Bitmap?m_bmp;
????????????????????????????????????//畫布中的圖像
????????Point?m_ptCanvas;???????????//畫布原點在設備上的坐標
????????Point?m_ptBmp;??????????????//圖像位于畫布坐標系中的坐標
????????float?m_nScale?=?1.0F;??????//縮放比例
????????Point?m_ptMouseMove;????????//鼠標移動是在設備坐標上的坐標
????????int?showangle?=?0;
????????bool?startshow?=?false;
????????int?oldangle?=?0;
????????float?olddistance?=?0;
????????bool?sendalready?=?false;
????????bool?startscan?=?false;
????????int?length?=?7;
????????int?checklen?=?0;
????????byte[]?buffer;
????????int?errornumber?=?1;
????????bool?checkalready?=?false;
????????string[]?lastdeg?=?new?string[2?16];
????????int?group?=?0;
????????static?string?port?=?“COM5“;
????????Stopwatch?watch?=?new?Stopwatch();
????????double?deltatime?=?0;
????????bool?DRAWCIRCLE?=?false;
????????Circle?nicecircle;
????????int[]?recordx?=?new?int[3231];
????????int[]?recordy?=?new?int[3231];
????????public?Form1()
????????{
????????????InitializeComponent();
????????????this.StartPosition?=?FormStartPosition.CenterScreen;
????????????this.pictureBox1.Borderstyle?=?Borderstyle.FixedSingle;
????????????this.pictureBox1.MouseWheel?+=?new?MouseEventHandler(pictureBox1_MouseWheel);
????????}
????????//Form?Load
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????read?=?new?Thread(new?ThreadStart(readvalue));
????????????read.IsBackground?=?true;
????????????calcirclethread?=?new?Thread(new?ThreadStart(circlethread));
????????????calcirclethread.IsBackground?=?true;
????????????m_bmp?=?new?Bitmap(pictureBox1.Width?pictureBox1.Height);
????????????m_ptCanvas?=?new?Point(pictureBox1.Width?/?2?pictureBox1.Height?/?2
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????15??2019-03-20?22:54??RPLIDAR\.git\COMMIT_EDITMSG
?????文件????????302??2019-03-20?22:55??RPLIDAR\.git\config
?????文件?????????25??2019-03-20?22:54??RPLIDAR\.git\desc
?????文件?????????97??2020-02-26?03:41??RPLIDAR\.git\FETCH_HEAD
?????文件?????????23??2019-03-20?22:54??RPLIDAR\.git\HEAD
?????文件????????478??2019-03-20?22:54??RPLIDAR\.git\hooks\applypatch-msg.sample
?????文件????????896??2019-03-20?22:54??RPLIDAR\.git\hooks\commit-msg.sample
?????文件???????3327??2019-03-20?22:54??RPLIDAR\.git\hooks\fsmonitor-watchman.sample
?????文件????????189??2019-03-20?22:54??RPLIDAR\.git\hooks\post-update.sample
?????文件????????424??2019-03-20?22:54??RPLIDAR\.git\hooks\pre-applypatch.sample
?????文件???????1638??2019-03-20?22:54??RPLIDAR\.git\hooks\pre-commit.sample
?????文件???????1348??2019-03-20?22:54??RPLIDAR\.git\hooks\pre-push.sample
?????文件???????4898??2019-03-20?22:54??RPLIDAR\.git\hooks\pre-reba
?????文件????????544??2019-03-20?22:54??RPLIDAR\.git\hooks\pre-receive.sample
?????文件???????1492??2019-03-20?22:54??RPLIDAR\.git\hooks\prepare-commit-msg.sample
?????文件???????3610??2019-03-20?22:54??RPLIDAR\.git\hooks\update.sample
?????文件???????4897??2020-02-21?00:28??RPLIDAR\.git\index
?????文件????????240??2019-03-20?22:54??RPLIDAR\.git\info\exclude
?????文件????????340??2020-02-21?00:28??RPLIDAR\.git\logs\HEAD
?????文件????????340??2020-02-21?00:28??RPLIDAR\.git\logs\refs\heads\master
?????文件????????331??2019-03-20?23:36??RPLIDAR\.git\logs\refs\remotes\origin\master
?????文件????????443??2019-03-20?22:54??RPLIDAR\.git\ob
?????文件???????1352??2019-03-20?22:54??RPLIDAR\.git\ob
?????文件?????????49??2019-03-20?22:54??RPLIDAR\.git\ob
?????文件????????558??2019-03-20?23:36??RPLIDAR\.git\ob
?????文件???????2638??2019-03-20?22:54??RPLIDAR\.git\ob
?????文件???????3299??2019-03-20?22:54??RPLIDAR\.git\ob
?????文件????????721??2019-03-20?22:54??RPLIDAR\.git\ob
?????文件????????117??2019-03-20?22:54??RPLIDAR\.git\ob
?????文件????????420??2019-03-20?22:54??RPLIDAR\.git\ob
............此處省略171個文件信息
評論
共有 條評論