incluscao do kinect

This commit is contained in:
Diego Freitas 2024-05-14 07:08:37 -03:00
parent 161ca0ccab
commit b037dc88f0
30 changed files with 10871 additions and 182 deletions

Binary file not shown.

View File

@ -2,6 +2,14 @@
"Version": 1,
"WorkspaceRootPath": "C:\\ZendionINC\\agrobot_base\\AgroBase\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|c:\\zendioninc\\agrobot_base\\agrobase\\agrobase\\forms\\frmkinect.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmkinect.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|c:\\zendioninc\\agrobot_base\\agrobase\\agrobase\\forms\\frmkinect.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmkinect.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
},
{
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|c:\\zendioninc\\agrobot_base\\agrobase\\agrobase\\forms\\frmpinout.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmpinout.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
@ -19,12 +27,37 @@
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "frmKinect.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmKinect.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\frmKinect.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmKinect.cs",
"RelativeToolTip": "AgroBase\\Forms\\frmKinect.cs",
"ViewState": "AQIAAAsBAAAAAAAAAADwv4sAAAAMAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-05-13T16:12:47.193Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "frmKinect.cs [Design]",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmKinect.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\frmKinect.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmKinect.cs [Design]",
"RelativeToolTip": "AgroBase\\Forms\\frmKinect.cs [Design]",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-05-13T16:12:16.688Z",
"EditorCaption": " [Design]"
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "frmPinout.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmPinout.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\frmPinout.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmPinout.cs",
"RelativeToolTip": "AgroBase\\Forms\\frmPinout.cs",
"ViewState": "AQIAALcAAAAAAAAAAAAYwB8BAAAMAAAA",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAEBAABbAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-05-10T11:31:13.293Z",
"EditorCaption": ""

File diff suppressed because one or more lines are too long

View File

@ -87,6 +87,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>.\Microsoft.DirectX.DirectInput.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Kinect, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="MQTTnet, Version=3.1.1.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7, processorArchitecture=MSIL">
<HintPath>..\packages\MQTTnet.3.1.1\lib\net461\MQTTnet.dll</HintPath>
</Reference>
@ -210,6 +211,12 @@
<Compile Include="Forms\frmGPS.Designer.cs">
<DependentUpon>frmGPS.cs</DependentUpon>
</Compile>
<Compile Include="Forms\frmKinect.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmKinect.Designer.cs">
<DependentUpon>frmKinect.cs</DependentUpon>
</Compile>
<Compile Include="Forms\frmMapa.cs">
<SubType>Form</SubType>
</Compile>
@ -529,6 +536,9 @@
<EmbeddedResource Include="Forms\frmGPS.resx">
<DependentUpon>frmGPS.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmKinect.resx">
<DependentUpon>frmKinect.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmMapa.resx">
<DependentUpon>frmMapa.cs</DependentUpon>
</EmbeddedResource>

View File

@ -0,0 +1,109 @@
namespace AgroBase.Forms
{
partial class frmKinect
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.picProfundidade = new System.Windows.Forms.PictureBox();
this.picRGB = new System.Windows.Forms.PictureBox();
this.trackBarAngle = new System.Windows.Forms.TrackBar();
this.gridDados = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.picProfundidade)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picRGB)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBarAngle)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridDados)).BeginInit();
this.SuspendLayout();
//
// picProfundidade
//
this.picProfundidade.Location = new System.Drawing.Point(12, 57);
this.picProfundidade.Name = "picProfundidade";
this.picProfundidade.Size = new System.Drawing.Size(666, 569);
this.picProfundidade.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.picProfundidade.TabIndex = 0;
this.picProfundidade.TabStop = false;
//
// picRGB
//
this.picRGB.Location = new System.Drawing.Point(694, 57);
this.picRGB.Name = "picRGB";
this.picRGB.Size = new System.Drawing.Size(476, 396);
this.picRGB.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.picRGB.TabIndex = 1;
this.picRGB.TabStop = false;
//
// trackBarAngle
//
this.trackBarAngle.Location = new System.Drawing.Point(694, 459);
this.trackBarAngle.Name = "trackBarAngle";
this.trackBarAngle.Orientation = System.Windows.Forms.Orientation.Vertical;
this.trackBarAngle.Size = new System.Drawing.Size(56, 167);
this.trackBarAngle.TabIndex = 2;
this.trackBarAngle.TickFrequency = 5;
this.trackBarAngle.TickStyle = System.Windows.Forms.TickStyle.Both;
this.trackBarAngle.Scroll += new System.EventHandler(this.trackBarAngle_Scroll);
//
// gridDados
//
this.gridDados.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridDados.Location = new System.Drawing.Point(1188, 57);
this.gridDados.Name = "gridDados";
this.gridDados.RowHeadersWidth = 51;
this.gridDados.RowTemplate.Height = 24;
this.gridDados.Size = new System.Drawing.Size(360, 569);
this.gridDados.TabIndex = 4;
//
// frmKinect
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1560, 657);
this.Controls.Add(this.gridDados);
this.Controls.Add(this.trackBarAngle);
this.Controls.Add(this.picRGB);
this.Controls.Add(this.picProfundidade);
this.Name = "frmKinect";
this.Text = "frmKinect";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmKinect_FormClosing);
this.Load += new System.EventHandler(this.frmKinect_Load);
((System.ComponentModel.ISupportInitialize)(this.picProfundidade)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picRGB)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBarAngle)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridDados)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox picProfundidade;
private System.Windows.Forms.PictureBox picRGB;
private System.Windows.Forms.TrackBar trackBarAngle;
private System.Windows.Forms.DataGridView gridDados;
}
}

View File

@ -0,0 +1,426 @@
using Microsoft.Kinect;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace AgroBase.Forms
{
public partial class frmKinect : Form
{
private KinectSensor kinectSensor;
double dt = 0.5;
double[] velocidade = new double[3];
double[] aceleracaoAnterior = new double[3];
DateTime UltimaLeitura = DateTime.Now;
DateTime UltimaLeituraObstaculo = DateTime.Now;
List<Obstaculo> Obstaculos = new List<Obstaculo>();
public frmKinect()
{
InitializeComponent();
}
private void frmKinect_Load(object sender, EventArgs e)
{
// Inicialize o Kinect Sensor
kinectSensor = KinectSensor.KinectSensors.FirstOrDefault();
if (kinectSensor != null)
{
// Habilitar a câmera RGB
kinectSensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
// Habilitar a câmera de profundidade
kinectSensor.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);
// Associar eventos de captura de imagem
kinectSensor.AllFramesReady += KinectSensor_AllFramesReady;
// Iniciar o sensor
kinectSensor.Start();
trackBarAngle.Maximum = kinectSensor.MaxElevationAngle;
trackBarAngle.Minimum = kinectSensor.MinElevationAngle;
trackBarAngle.Value = kinectSensor.ElevationAngle;
gridDados.Columns.Clear();
gridDados.Rows.Clear();
gridDados.Columns.Add("clDado", "Dado");
gridDados.Columns.Add("clValor", "Valor");
gridDados.Rows.Add(new string[] { "Elevação", "0" });
gridDados.Rows.Add(new string[] { "Acelerômetro X", "0" });
gridDados.Rows.Add(new string[] { "Acelerômetro Y", "0" });
gridDados.Rows.Add(new string[] { "Acelerômetro Z", "0" });
gridDados.Rows.Add(new string[] { "Inclinação Frontal", "0" });
gridDados.Rows.Add(new string[] { "Inclinação Lateral", "0" });
gridDados.Rows.Add(new string[] { "Giro Lateral", "0" });
gridDados.Rows.Add(new string[] { "Velocidade X", "0" });
gridDados.Rows.Add(new string[] { "Velocidade Y", "0" });
gridDados.Rows.Add(new string[] { "Velocidade Z", "0" });
gridDados.Rows.Add(new string[] { "Colisão", "Não" });
}
else
{
MessageBox.Show("Kinect não detectado.");
}
}
private void KinectSensor_AllFramesReady(object sender, AllFramesReadyEventArgs e)
{
using (ColorImageFrame colorFrame = e.OpenColorImageFrame())
using (DepthImageFrame depthFrame = e.OpenDepthImageFrame())
{
if (colorFrame == null || depthFrame == null)
return;
// Converter os quadros para Bitmaps
Bitmap colorBitmap = ConvertColorFrameToBitmap(colorFrame);
Bitmap depthBitmap = ConvertDepthFrameToBitmap(depthFrame);
// Exibir os Bitmaps nos Picture Boxes
picRGB.Image = colorBitmap;
//picProfundidade.Image = depthBitmap;
AtualizarGrid();
// Detectar obstáculos
Obstaculos = DetectarObstaculos(depthFrame);
// Desenhar border boxes nos obstáculos detectados
using (Graphics g = Graphics.FromImage(depthBitmap))
{
foreach (var obstaculo in Obstaculos)
{
DesenharBorderBox(g, obstaculo, depthFrame.Width, depthFrame.Height, picProfundidade);
}
}
picProfundidade.Image = depthBitmap;
}
}
private void AtualizarGrid()
{
if (UltimaLeitura.AddSeconds(dt) > DateTime.Now || kinectSensor.Status != KinectStatus.Connected)
{
return;
}
UltimaLeitura = DateTime.Now;
var a = kinectSensor.CoordinateMapper;
var Acelerometro = kinectSensor.AccelerometerGetCurrentReading();
double pitch = Math.Atan2(Acelerometro.Y, Math.Sqrt(Math.Pow(Acelerometro.X, 2) + Math.Pow(Acelerometro.Z, 2))) * (180 / Math.PI);
double roll = Math.Atan2(Acelerometro.X, Math.Sqrt(Math.Pow(Acelerometro.Y, 2) + Math.Pow(Acelerometro.Z, 2))) * (180 / Math.PI);
double yaw = Math.Atan2(Acelerometro.Z, Math.Sqrt(Math.Pow(Acelerometro.X, 2) + Math.Pow(Acelerometro.Y, 2))) * (180 / Math.PI);
aceleracaoAnterior[0] = Acelerometro.X;
aceleracaoAnterior[1] = Acelerometro.Y;
aceleracaoAnterior[2] = Acelerometro.Z;
// Loop para calcular a velocidade em cada eixo
velocidade[0] += (Acelerometro.X + aceleracaoAnterior[0]) / 2 * dt;
velocidade[1] += (Acelerometro.Y + aceleracaoAnterior[1]) / 2 * dt;
velocidade[2] += (Acelerometro.Z + aceleracaoAnterior[2]) / 2 * dt;
double totalAcceleration = Math.Sqrt(Math.Pow(Acelerometro.X, 2) + Math.Pow(Acelerometro.Y, 2) + Math.Pow(Acelerometro.Z, 2));
double threshold = 1.2;
gridDados.Rows[0].Cells[1].Value = kinectSensor.ElevationAngle;
gridDados.Rows[1].Cells[1].Value = Acelerometro.X;
gridDados.Rows[2].Cells[1].Value = Acelerometro.Y;
gridDados.Rows[3].Cells[1].Value = Acelerometro.Z;
gridDados.Rows[4].Cells[1].Value = pitch;
gridDados.Rows[5].Cells[1].Value = roll;
gridDados.Rows[6].Cells[1].Value = yaw;
gridDados.Rows[7].Cells[1].Value = velocidade[0];
gridDados.Rows[8].Cells[1].Value = velocidade[1];
gridDados.Rows[9].Cells[1].Value = velocidade[2];
gridDados.Rows[10].Cells[1].Value = totalAcceleration > threshold ? "Sim" : "Não";
}
private void frmKinect_FormClosing(object sender, FormClosingEventArgs e)
{
if (kinectSensor != null)
{
kinectSensor.Stop();
}
}
private Bitmap ConvertColorFrameToBitmap(ColorImageFrame colorFrame)
{
if (colorFrame == null)
return null;
// Criar um array para os pixels de cor
byte[] pixels = new byte[colorFrame.PixelDataLength];
// Copiar os pixels do quadro para o array
colorFrame.CopyPixelDataTo(pixels);
// Criar um bitmap
Bitmap bitmap = new Bitmap(colorFrame.Width, colorFrame.Height, PixelFormat.Format32bppRgb);
// Bloquear o bitmap para escrita
BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, colorFrame.Width, colorFrame.Height), ImageLockMode.WriteOnly, bitmap.PixelFormat);
// Copiar os pixels para o bitmap
IntPtr ptr = bitmapData.Scan0;
Marshal.Copy(pixels, 0, ptr, pixels.Length);
// Desbloquear o bitmap
bitmap.UnlockBits(bitmapData);
return bitmap;
}
private Bitmap ConvertDepthFrameToBitmap(DepthImageFrame depthFrame)
{
if (depthFrame == null)
return null;
// Criar um array para os pixels de profundidade
short[] depthPixels = new short[depthFrame.PixelDataLength];
// Copiar os pixels do quadro para o array
depthFrame.CopyPixelDataTo(depthPixels);
// Criar um bitmap
Bitmap bitmap = new Bitmap(depthFrame.Width, depthFrame.Height, PixelFormat.Format32bppRgb);
// Definir as cores para a imagem de profundidade
Color[] depthColors = new Color[depthPixels.Length];
// Mapear os valores de profundidade para as cores
for (int i = 0; i < depthPixels.Length; i++)
{
// Obter o valor de profundidade em metros
float depthInMeters = (float)depthPixels[i] / 1000.0f;
// Mapear o valor de profundidade para uma cor de escala de cinza
byte intensity = (byte)(255 - (255 * Math.Min(1.0f, depthInMeters / 4.0f)));
// Criar uma cor de escala de cinza
depthColors[i] = Color.FromArgb(intensity, intensity, intensity);
}
// Bloquear o bitmap para escrita
BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, depthFrame.Width, depthFrame.Height), ImageLockMode.WriteOnly, bitmap.PixelFormat);
// Copiar os pixels para o bitmap
byte[] pixelData = new byte[depthColors.Length * 4]; // RGBA (4 bytes por pixel)
for (int i = 0; i < depthColors.Length; i++)
{
pixelData[i * 4] = depthColors[i].R;
pixelData[i * 4 + 1] = depthColors[i].G;
pixelData[i * 4 + 2] = depthColors[i].B;
pixelData[i * 4 + 3] = 255; // Alpha
}
Marshal.Copy(pixelData, 0, bitmapData.Scan0, pixelData.Length);
// Desbloquear o bitmap
bitmap.UnlockBits(bitmapData);
return bitmap;
}
private void trackBarAngle_Scroll(object sender, EventArgs e)
{
if (kinectSensor != null && kinectSensor.Status == KinectStatus.Connected)
{
try
{
kinectSensor.ElevationAngle = trackBarAngle.Value;
}
catch (Exception ex)
{
}
}
else
{
MessageBox.Show("O Kinect não está conectado ou não está em um estado adequado.");
}
}
private List<Obstaculo> DetectarObstaculos(DepthImageFrame depthFrame)
{
if (UltimaLeituraObstaculo.AddSeconds(dt) > DateTime.Now || kinectSensor.Status != KinectStatus.Connected)
{
return Obstaculos;
}
UltimaLeituraObstaculo = DateTime.Now;
// Pré-processamento: Converter dados brutos em matriz 2D
float[,] depthMatrix = ConvertDepthFrameToMatrix(depthFrame);
// Segmentação: Aplicar limiarização adaptativa para identificar obstáculos
float limiarDeProfundidade = 3000f; // 3 metros
float[,] segmentedMatrix = AplicarLimiarizacao(depthMatrix, limiarDeProfundidade);
// Agrupamento: Identificar regiões contíguas que representam obstáculos
List<Obstaculo> _Obstaculos = IdentificarObstaculos(depthMatrix, segmentedMatrix);
return _Obstaculos;
}
private float[,] ConvertDepthFrameToMatrix(DepthImageFrame depthFrame)
{
// Inicializar a matriz 2D com as dimensões do frame de profundidade
int width = depthFrame.Width;
int height = depthFrame.Height;
float[,] depthMatrix = new float[width, height];
short[] rawDepthData = new short[depthFrame.PixelDataLength];
depthFrame.CopyPixelDataTo(rawDepthData);
for (int i = 0; i < rawDepthData.Length; i++)
{
int x = i % width;
int y = i / width;
depthMatrix[x, y] = (rawDepthData[i] >> DepthImageFrame.PlayerIndexBitmaskWidth) / 1000.0f;
}
return depthMatrix;
}
private float[,] AplicarLimiarizacao(float[,] depthMatrix, float limiar)
{
int width = depthMatrix.GetLength(0);
int height = depthMatrix.GetLength(1);
float[,] segmentedMatrix = new float[width, height];
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
float distancia = depthMatrix[x, y];
// Aplicar limiar: Se a profundidade for menor que o limiar, considerar como obstáculo (1), senão como fundo (0)
segmentedMatrix[x, y] = distancia > 0 && distancia < limiar ? 1 : 0;
}
}
return segmentedMatrix;
}
private List<Obstaculo> IdentificarObstaculos(float[,] depthMatrix, float[,] segmentedMatrix)
{
int width = segmentedMatrix.GetLength(0);
int height = segmentedMatrix.GetLength(1);
bool[,] visited = new bool[width, height];
List<Obstaculo> obstaculos = new List<Obstaculo>();
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
if (segmentedMatrix[x, y] == 1 && !visited[x, y])
{
Obstaculo obstaculo = ExplorarObstaculo(depthMatrix, segmentedMatrix, visited, x, y, width, height);
if (obstaculo != null)
{
obstaculos.Add(obstaculo);
}
}
}
}
return obstaculos;
}
private Obstaculo ExplorarObstaculo(float[,] depths, float[,] matrix, bool[,] visited, int startX, int startY, int width, int height)
{
Queue<(int, int)> pixels = new Queue<(int, int)>();
pixels.Enqueue((startX, startY));
visited[startX, startY] = true;
int minX = startX, maxX = startX, minY = startY, maxY = startY;
float totalDepth = 0;
int count = 0;
while (pixels.Count > 0)
{
(int x, int y) = pixels.Dequeue();
totalDepth += depths[x, y];
count++;
minX = Math.Min(minX, x);
maxX = Math.Max(maxX, x);
minY = Math.Min(minY, y);
maxY = Math.Max(maxY, y);
// Verificar vizinhos
for (int nx = Math.Max(x - 1, 0); nx <= Math.Min(x + 1, width - 1); nx++)
{
for (int ny = Math.Max(y - 1, 0); ny <= Math.Min(y + 1, height - 1); ny++)
{
if (matrix[nx, ny] == 1 && !visited[nx, ny])
{
pixels.Enqueue((nx, ny));
visited[nx, ny] = true;
}
}
}
}
if (count > 0) // Verifica se realmente encontrou um obstáculo
{
return new Obstaculo
{
X = minX,
Y = minY,
Width = maxX - minX + 1,
Height = maxY - minY + 1,
Distance = totalDepth / count // Média da profundidade
};
}
return null;
}
private void DesenharBorderBox(Graphics g, Obstaculo obstaculo, int originalWidth, int originalHeight, PictureBox picBox)
{
// Calcular o fator de escala
float scaleX = (float)picBox.Width / originalWidth;
float scaleY = (float)picBox.Height / originalHeight;
// Ajustar as coordenadas e dimensões do obstáculo de acordo com a escala
int adjustedX = (int)(obstaculo.X * scaleX);
int adjustedY = (int)(obstaculo.Y * scaleY);
int adjustedWidth = (int)(obstaculo.Width * scaleX);
int adjustedHeight = (int)(obstaculo.Height * scaleY);
// Definir a cor e a espessura da linha da border box
Pen pen = new Pen(Color.Red, 2);
// Desenhar o retângulo ao redor do obstáculo
g.DrawRectangle(pen, adjustedX, adjustedY, adjustedWidth, adjustedHeight);
}
}
class Obstaculo
{
public int X { get; set; }
public int Y { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public float Distance { get; set; }
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -90,6 +90,7 @@ namespace AgroBase
this.btnIniciarOperacao = new System.Windows.Forms.Button();
this.lblModoOperacao = new System.Windows.Forms.Label();
this.cmbModoOperacao = new System.Windows.Forms.ComboBox();
this.btnKinect = new System.Windows.Forms.Button();
this.gpbAcoes.SuspendLayout();
this.erroStrip.SuspendLayout();
this.pnlLateral.SuspendLayout();
@ -114,11 +115,11 @@ namespace AgroBase
this.gpbAcoes.Controls.Add(this.erroStrip);
this.gpbAcoes.Controls.Add(this.pnlLateral);
this.gpbAcoes.Dock = System.Windows.Forms.DockStyle.Right;
this.gpbAcoes.Location = new System.Drawing.Point(441, 0);
this.gpbAcoes.Margin = new System.Windows.Forms.Padding(2);
this.gpbAcoes.Location = new System.Drawing.Point(588, 0);
this.gpbAcoes.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbAcoes.Name = "gpbAcoes";
this.gpbAcoes.Padding = new System.Windows.Forms.Padding(2);
this.gpbAcoes.Size = new System.Drawing.Size(587, 609);
this.gpbAcoes.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbAcoes.Size = new System.Drawing.Size(783, 750);
this.gpbAcoes.TabIndex = 0;
this.gpbAcoes.TabStop = false;
this.gpbAcoes.Text = "Conexão";
@ -128,17 +129,17 @@ namespace AgroBase
this.erroStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
this.erroStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.lblStripErro});
this.erroStrip.Location = new System.Drawing.Point(2, 585);
this.erroStrip.Location = new System.Drawing.Point(3, 722);
this.erroStrip.Name = "erroStrip";
this.erroStrip.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0);
this.erroStrip.Size = new System.Drawing.Size(583, 22);
this.erroStrip.Padding = new System.Windows.Forms.Padding(1, 0, 13, 0);
this.erroStrip.Size = new System.Drawing.Size(777, 26);
this.erroStrip.TabIndex = 1;
this.erroStrip.Text = "statusStrip1";
//
// lblStripErro
//
this.lblStripErro.Name = "lblStripErro";
this.lblStripErro.Size = new System.Drawing.Size(49, 17);
this.lblStripErro.Size = new System.Drawing.Size(62, 20);
this.lblStripErro.Text = "Iniciado";
//
// pnlLateral
@ -152,18 +153,19 @@ namespace AgroBase
this.pnlLateral.Controls.Add(this.gpbNovoDispositivo);
this.pnlLateral.Controls.Add(this.btnNovoDispositivo);
this.pnlLateral.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlLateral.Location = new System.Drawing.Point(2, 15);
this.pnlLateral.Margin = new System.Windows.Forms.Padding(2);
this.pnlLateral.Location = new System.Drawing.Point(3, 17);
this.pnlLateral.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlLateral.Name = "pnlLateral";
this.pnlLateral.Size = new System.Drawing.Size(583, 592);
this.pnlLateral.Size = new System.Drawing.Size(777, 731);
this.pnlLateral.TabIndex = 0;
//
// chbConexaoautomatica
//
this.chbConexaoautomatica.AutoSize = true;
this.chbConexaoautomatica.Location = new System.Drawing.Point(172, 28);
this.chbConexaoautomatica.Location = new System.Drawing.Point(229, 34);
this.chbConexaoautomatica.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chbConexaoautomatica.Name = "chbConexaoautomatica";
this.chbConexaoautomatica.Size = new System.Drawing.Size(123, 17);
this.chbConexaoautomatica.Size = new System.Drawing.Size(152, 20);
this.chbConexaoautomatica.TabIndex = 21;
this.chbConexaoautomatica.Text = "Conexão automática";
this.chbConexaoautomatica.UseVisualStyleBackColor = true;
@ -171,11 +173,11 @@ namespace AgroBase
// gpbDispositivos
//
this.gpbDispositivos.Controls.Add(this.lstDisponiveis);
this.gpbDispositivos.Location = new System.Drawing.Point(161, 78);
this.gpbDispositivos.Margin = new System.Windows.Forms.Padding(2);
this.gpbDispositivos.Location = new System.Drawing.Point(215, 96);
this.gpbDispositivos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbDispositivos.Name = "gpbDispositivos";
this.gpbDispositivos.Padding = new System.Windows.Forms.Padding(2);
this.gpbDispositivos.Size = new System.Drawing.Size(413, 133);
this.gpbDispositivos.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbDispositivos.Size = new System.Drawing.Size(551, 164);
this.gpbDispositivos.TabIndex = 3;
this.gpbDispositivos.TabStop = false;
this.gpbDispositivos.Text = "Dispositivos disponíveis";
@ -183,20 +185,20 @@ namespace AgroBase
// lstDisponiveis
//
this.lstDisponiveis.HideSelection = false;
this.lstDisponiveis.Location = new System.Drawing.Point(11, 20);
this.lstDisponiveis.Margin = new System.Windows.Forms.Padding(2);
this.lstDisponiveis.Location = new System.Drawing.Point(15, 25);
this.lstDisponiveis.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.lstDisponiveis.Name = "lstDisponiveis";
this.lstDisponiveis.Size = new System.Drawing.Size(252, 102);
this.lstDisponiveis.Size = new System.Drawing.Size(335, 125);
this.lstDisponiveis.TabIndex = 0;
this.lstDisponiveis.UseCompatibleStateImageBehavior = false;
this.lstDisponiveis.View = System.Windows.Forms.View.List;
//
// btnRemover
//
this.btnRemover.Location = new System.Drawing.Point(87, 50);
this.btnRemover.Margin = new System.Windows.Forms.Padding(2);
this.btnRemover.Location = new System.Drawing.Point(116, 62);
this.btnRemover.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnRemover.Name = "btnRemover";
this.btnRemover.Size = new System.Drawing.Size(62, 23);
this.btnRemover.Size = new System.Drawing.Size(83, 28);
this.btnRemover.TabIndex = 12;
this.btnRemover.Text = "Remover";
this.btnRemover.UseVisualStyleBackColor = true;
@ -205,10 +207,9 @@ namespace AgroBase
// lblDispositivos
//
this.lblDispositivos.AutoSize = true;
this.lblDispositivos.Location = new System.Drawing.Point(20, 10);
this.lblDispositivos.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDispositivos.Location = new System.Drawing.Point(27, 12);
this.lblDispositivos.Name = "lblDispositivos";
this.lblDispositivos.Size = new System.Drawing.Size(63, 13);
this.lblDispositivos.Size = new System.Drawing.Size(81, 16);
this.lblDispositivos.TabIndex = 11;
this.lblDispositivos.Text = "Dispositivos";
//
@ -216,10 +217,10 @@ namespace AgroBase
//
this.cmbDispositivos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbDispositivos.FormattingEnabled = true;
this.cmbDispositivos.Location = new System.Drawing.Point(22, 26);
this.cmbDispositivos.Margin = new System.Windows.Forms.Padding(2);
this.cmbDispositivos.Location = new System.Drawing.Point(29, 32);
this.cmbDispositivos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmbDispositivos.Name = "cmbDispositivos";
this.cmbDispositivos.Size = new System.Drawing.Size(128, 21);
this.cmbDispositivos.Size = new System.Drawing.Size(169, 24);
this.cmbDispositivos.TabIndex = 10;
this.cmbDispositivos.SelectedIndexChanged += new System.EventHandler(this.cmbDispositivos_SelectedIndexChanged);
//
@ -231,11 +232,11 @@ namespace AgroBase
this.gpbNovoDispositivo.Controls.Add(this.lblDescricao);
this.gpbNovoDispositivo.Controls.Add(this.lblTipo);
this.gpbNovoDispositivo.Enabled = false;
this.gpbNovoDispositivo.Location = new System.Drawing.Point(16, 78);
this.gpbNovoDispositivo.Margin = new System.Windows.Forms.Padding(2);
this.gpbNovoDispositivo.Location = new System.Drawing.Point(21, 96);
this.gpbNovoDispositivo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbNovoDispositivo.Name = "gpbNovoDispositivo";
this.gpbNovoDispositivo.Padding = new System.Windows.Forms.Padding(2);
this.gpbNovoDispositivo.Size = new System.Drawing.Size(141, 133);
this.gpbNovoDispositivo.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbNovoDispositivo.Size = new System.Drawing.Size(188, 164);
this.gpbNovoDispositivo.TabIndex = 9;
this.gpbNovoDispositivo.TabStop = false;
this.gpbNovoDispositivo.Text = "Novo Dispositivo";
@ -244,18 +245,18 @@ namespace AgroBase
//
this.cmbTipos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbTipos.FormattingEnabled = true;
this.cmbTipos.Location = new System.Drawing.Point(7, 37);
this.cmbTipos.Margin = new System.Windows.Forms.Padding(2);
this.cmbTipos.Location = new System.Drawing.Point(9, 46);
this.cmbTipos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmbTipos.Name = "cmbTipos";
this.cmbTipos.Size = new System.Drawing.Size(128, 21);
this.cmbTipos.Size = new System.Drawing.Size(169, 24);
this.cmbTipos.TabIndex = 2;
//
// btnSalvar
//
this.btnSalvar.Location = new System.Drawing.Point(7, 101);
this.btnSalvar.Margin = new System.Windows.Forms.Padding(2);
this.btnSalvar.Location = new System.Drawing.Point(9, 124);
this.btnSalvar.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSalvar.Name = "btnSalvar";
this.btnSalvar.Size = new System.Drawing.Size(127, 20);
this.btnSalvar.Size = new System.Drawing.Size(169, 25);
this.btnSalvar.TabIndex = 9;
this.btnSalvar.Text = "Salvar";
this.btnSalvar.UseVisualStyleBackColor = true;
@ -263,38 +264,36 @@ namespace AgroBase
//
// txtDescricao
//
this.txtDescricao.Location = new System.Drawing.Point(7, 76);
this.txtDescricao.Margin = new System.Windows.Forms.Padding(2);
this.txtDescricao.Location = new System.Drawing.Point(9, 94);
this.txtDescricao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtDescricao.Name = "txtDescricao";
this.txtDescricao.Size = new System.Drawing.Size(128, 20);
this.txtDescricao.Size = new System.Drawing.Size(169, 22);
this.txtDescricao.TabIndex = 3;
//
// lblDescricao
//
this.lblDescricao.AutoSize = true;
this.lblDescricao.Location = new System.Drawing.Point(4, 60);
this.lblDescricao.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDescricao.Location = new System.Drawing.Point(5, 74);
this.lblDescricao.Name = "lblDescricao";
this.lblDescricao.Size = new System.Drawing.Size(55, 13);
this.lblDescricao.Size = new System.Drawing.Size(69, 16);
this.lblDescricao.TabIndex = 2;
this.lblDescricao.Text = "Descrição";
//
// lblTipo
//
this.lblTipo.AutoSize = true;
this.lblTipo.Location = new System.Drawing.Point(4, 20);
this.lblTipo.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTipo.Location = new System.Drawing.Point(5, 25);
this.lblTipo.Name = "lblTipo";
this.lblTipo.Size = new System.Drawing.Size(28, 13);
this.lblTipo.Size = new System.Drawing.Size(35, 16);
this.lblTipo.TabIndex = 0;
this.lblTipo.Text = "Tipo";
//
// btnNovoDispositivo
//
this.btnNovoDispositivo.Location = new System.Drawing.Point(22, 50);
this.btnNovoDispositivo.Margin = new System.Windows.Forms.Padding(2);
this.btnNovoDispositivo.Location = new System.Drawing.Point(29, 62);
this.btnNovoDispositivo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnNovoDispositivo.Name = "btnNovoDispositivo";
this.btnNovoDispositivo.Size = new System.Drawing.Size(60, 23);
this.btnNovoDispositivo.Size = new System.Drawing.Size(80, 28);
this.btnNovoDispositivo.TabIndex = 8;
this.btnNovoDispositivo.Text = "Novo dispositivo";
this.btnNovoDispositivo.UseVisualStyleBackColor = true;
@ -309,41 +308,41 @@ namespace AgroBase
this.lblStripOperacao,
this.lblStripOperacaoStatus,
this.lblStripMqtt});
this.generalStrip.Location = new System.Drawing.Point(0, 587);
this.generalStrip.Location = new System.Drawing.Point(0, 724);
this.generalStrip.Name = "generalStrip";
this.generalStrip.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0);
this.generalStrip.Size = new System.Drawing.Size(441, 22);
this.generalStrip.Padding = new System.Windows.Forms.Padding(1, 0, 13, 0);
this.generalStrip.Size = new System.Drawing.Size(588, 26);
this.generalStrip.TabIndex = 1;
this.generalStrip.Text = "statusStrip1";
//
// lblStripJoystick
//
this.lblStripJoystick.Name = "lblStripJoystick";
this.lblStripJoystick.Size = new System.Drawing.Size(129, 17);
this.lblStripJoystick.Size = new System.Drawing.Size(161, 20);
this.lblStripJoystick.Text = "Joystick: Desconectado";
//
// lblStripJoystickComando
//
this.lblStripJoystickComando.Name = "lblStripJoystickComando";
this.lblStripJoystickComando.Size = new System.Drawing.Size(16, 17);
this.lblStripJoystickComando.Size = new System.Drawing.Size(18, 20);
this.lblStripJoystickComando.Text = "...";
//
// lblStripOperacao
//
this.lblStripOperacao.Name = "lblStripOperacao";
this.lblStripOperacao.Size = new System.Drawing.Size(104, 17);
this.lblStripOperacao.Size = new System.Drawing.Size(130, 20);
this.lblStripOperacao.Text = "Operação: Manual";
//
// lblStripOperacaoStatus
//
this.lblStripOperacaoStatus.Name = "lblStripOperacaoStatus";
this.lblStripOperacaoStatus.Size = new System.Drawing.Size(74, 17);
this.lblStripOperacaoStatus.Size = new System.Drawing.Size(94, 20);
this.lblStripOperacaoStatus.Text = "Não iniciado";
//
// lblStripMqtt
//
this.lblStripMqtt.Name = "lblStripMqtt";
this.lblStripMqtt.Size = new System.Drawing.Size(119, 15);
this.lblStripMqtt.Size = new System.Drawing.Size(150, 20);
this.lblStripMqtt.Text = "MQTT: Desconectado";
//
// gpbMovimentacao
@ -352,11 +351,11 @@ namespace AgroBase
this.gpbMovimentacao.Controls.Add(this.trkKmh);
this.gpbMovimentacao.Controls.Add(this.trkRPM);
this.gpbMovimentacao.Controls.Add(this.lblRPM);
this.gpbMovimentacao.Location = new System.Drawing.Point(9, 63);
this.gpbMovimentacao.Margin = new System.Windows.Forms.Padding(2);
this.gpbMovimentacao.Location = new System.Drawing.Point(12, 78);
this.gpbMovimentacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbMovimentacao.Name = "gpbMovimentacao";
this.gpbMovimentacao.Padding = new System.Windows.Forms.Padding(2);
this.gpbMovimentacao.Size = new System.Drawing.Size(330, 85);
this.gpbMovimentacao.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbMovimentacao.Size = new System.Drawing.Size(440, 105);
this.gpbMovimentacao.TabIndex = 2;
this.gpbMovimentacao.TabStop = false;
this.gpbMovimentacao.Text = "Controle Movimentação";
@ -364,20 +363,19 @@ namespace AgroBase
// lblKmh
//
this.lblKmh.AutoSize = true;
this.lblKmh.Location = new System.Drawing.Point(166, 20);
this.lblKmh.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblKmh.Location = new System.Drawing.Point(221, 25);
this.lblKmh.Name = "lblKmh";
this.lblKmh.Size = new System.Drawing.Size(100, 13);
this.lblKmh.Size = new System.Drawing.Size(122, 16);
this.lblKmh.TabIndex = 23;
this.lblKmh.Text = "Velocidade: 3 km/h";
//
// trkKmh
//
this.trkKmh.Location = new System.Drawing.Point(168, 37);
this.trkKmh.Margin = new System.Windows.Forms.Padding(2);
this.trkKmh.Location = new System.Drawing.Point(224, 46);
this.trkKmh.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.trkKmh.Maximum = 34;
this.trkKmh.Name = "trkKmh";
this.trkKmh.Size = new System.Drawing.Size(158, 45);
this.trkKmh.Size = new System.Drawing.Size(211, 56);
this.trkKmh.TabIndex = 22;
this.trkKmh.TickFrequency = 2;
this.trkKmh.Value = 3;
@ -385,12 +383,12 @@ namespace AgroBase
//
// trkRPM
//
this.trkRPM.Location = new System.Drawing.Point(4, 37);
this.trkRPM.Margin = new System.Windows.Forms.Padding(2);
this.trkRPM.Location = new System.Drawing.Point(5, 46);
this.trkRPM.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.trkRPM.Maximum = 500;
this.trkRPM.Minimum = 5;
this.trkRPM.Name = "trkRPM";
this.trkRPM.Size = new System.Drawing.Size(158, 45);
this.trkRPM.Size = new System.Drawing.Size(211, 56);
this.trkRPM.TabIndex = 20;
this.trkRPM.TickFrequency = 20;
this.trkRPM.Value = 5;
@ -399,20 +397,19 @@ namespace AgroBase
// lblRPM
//
this.lblRPM.AutoSize = true;
this.lblRPM.Location = new System.Drawing.Point(2, 20);
this.lblRPM.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblRPM.Location = new System.Drawing.Point(3, 25);
this.lblRPM.Name = "lblRPM";
this.lblRPM.Size = new System.Drawing.Size(43, 13);
this.lblRPM.Size = new System.Drawing.Size(50, 16);
this.lblRPM.TabIndex = 21;
this.lblRPM.Text = "RPM: 5";
//
// tkbAngulo
//
this.tkbAngulo.Location = new System.Drawing.Point(4, 95);
this.tkbAngulo.Margin = new System.Windows.Forms.Padding(2);
this.tkbAngulo.Location = new System.Drawing.Point(5, 117);
this.tkbAngulo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.tkbAngulo.Maximum = 180;
this.tkbAngulo.Name = "tkbAngulo";
this.tkbAngulo.Size = new System.Drawing.Size(314, 45);
this.tkbAngulo.Size = new System.Drawing.Size(419, 56);
this.tkbAngulo.TabIndex = 17;
this.tkbAngulo.TickFrequency = 5;
this.tkbAngulo.ValueChanged += new System.EventHandler(this.tkbRampa_ValueChanged);
@ -420,31 +417,29 @@ namespace AgroBase
// lblAngulo
//
this.lblAngulo.AutoSize = true;
this.lblAngulo.Location = new System.Drawing.Point(2, 79);
this.lblAngulo.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblAngulo.Location = new System.Drawing.Point(3, 97);
this.lblAngulo.Name = "lblAngulo";
this.lblAngulo.Size = new System.Drawing.Size(56, 13);
this.lblAngulo.Size = new System.Drawing.Size(67, 16);
this.lblAngulo.TabIndex = 16;
this.lblAngulo.Text = "Angulo: 0º";
//
// lblVelocidade
//
this.lblVelocidade.AutoSize = true;
this.lblVelocidade.Location = new System.Drawing.Point(2, 19);
this.lblVelocidade.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblVelocidade.Location = new System.Drawing.Point(3, 23);
this.lblVelocidade.Name = "lblVelocidade";
this.lblVelocidade.Size = new System.Drawing.Size(80, 13);
this.lblVelocidade.Size = new System.Drawing.Size(102, 16);
this.lblVelocidade.TabIndex = 15;
this.lblVelocidade.Text = "Velocidade: 1%";
//
// tkbVelocidade
//
this.tkbVelocidade.Location = new System.Drawing.Point(4, 35);
this.tkbVelocidade.Margin = new System.Windows.Forms.Padding(2);
this.tkbVelocidade.Location = new System.Drawing.Point(5, 43);
this.tkbVelocidade.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.tkbVelocidade.Maximum = 100;
this.tkbVelocidade.Minimum = 1;
this.tkbVelocidade.Name = "tkbVelocidade";
this.tkbVelocidade.Size = new System.Drawing.Size(314, 45);
this.tkbVelocidade.Size = new System.Drawing.Size(419, 56);
this.tkbVelocidade.TabIndex = 14;
this.tkbVelocidade.TickFrequency = 5;
this.tkbVelocidade.Value = 1;
@ -452,10 +447,10 @@ namespace AgroBase
//
// btnVer
//
this.btnVer.Location = new System.Drawing.Point(256, 20);
this.btnVer.Margin = new System.Windows.Forms.Padding(2);
this.btnVer.Location = new System.Drawing.Point(341, 25);
this.btnVer.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnVer.Name = "btnVer";
this.btnVer.Size = new System.Drawing.Size(63, 20);
this.btnVer.Size = new System.Drawing.Size(84, 25);
this.btnVer.TabIndex = 13;
this.btnVer.Text = "Ver";
this.btnVer.UseVisualStyleBackColor = true;
@ -463,10 +458,10 @@ namespace AgroBase
//
// btnJoyAtt
//
this.btnJoyAtt.Location = new System.Drawing.Point(121, 20);
this.btnJoyAtt.Margin = new System.Windows.Forms.Padding(2);
this.btnJoyAtt.Location = new System.Drawing.Point(161, 25);
this.btnJoyAtt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnJoyAtt.Name = "btnJoyAtt";
this.btnJoyAtt.Size = new System.Drawing.Size(63, 20);
this.btnJoyAtt.Size = new System.Drawing.Size(84, 25);
this.btnJoyAtt.TabIndex = 12;
this.btnJoyAtt.Text = "Atualizar";
this.btnJoyAtt.UseVisualStyleBackColor = true;
@ -474,10 +469,10 @@ namespace AgroBase
//
// btnJoyEdt
//
this.btnJoyEdt.Location = new System.Drawing.Point(188, 20);
this.btnJoyEdt.Margin = new System.Windows.Forms.Padding(2);
this.btnJoyEdt.Location = new System.Drawing.Point(251, 25);
this.btnJoyEdt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnJoyEdt.Name = "btnJoyEdt";
this.btnJoyEdt.Size = new System.Drawing.Size(63, 20);
this.btnJoyEdt.Size = new System.Drawing.Size(84, 25);
this.btnJoyEdt.TabIndex = 11;
this.btnJoyEdt.Text = "Editar";
this.btnJoyEdt.UseVisualStyleBackColor = true;
@ -487,10 +482,10 @@ namespace AgroBase
//
this.cmbJoysticks.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbJoysticks.FormattingEnabled = true;
this.cmbJoysticks.Location = new System.Drawing.Point(4, 21);
this.cmbJoysticks.Margin = new System.Windows.Forms.Padding(2);
this.cmbJoysticks.Location = new System.Drawing.Point(5, 26);
this.cmbJoysticks.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmbJoysticks.Name = "cmbJoysticks";
this.cmbJoysticks.Size = new System.Drawing.Size(112, 21);
this.cmbJoysticks.Size = new System.Drawing.Size(148, 24);
this.cmbJoysticks.TabIndex = 3;
//
// timerDispositivos
@ -505,11 +500,11 @@ namespace AgroBase
| System.Windows.Forms.AnchorStyles.Right)));
this.gpbSensoriamento.Controls.Add(this.lblSenMotores);
this.gpbSensoriamento.Controls.Add(this.gridSenMotores);
this.gpbSensoriamento.Location = new System.Drawing.Point(9, 413);
this.gpbSensoriamento.Margin = new System.Windows.Forms.Padding(2);
this.gpbSensoriamento.Location = new System.Drawing.Point(12, 508);
this.gpbSensoriamento.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbSensoriamento.Name = "gpbSensoriamento";
this.gpbSensoriamento.Padding = new System.Windows.Forms.Padding(2);
this.gpbSensoriamento.Size = new System.Drawing.Size(428, 172);
this.gpbSensoriamento.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbSensoriamento.Size = new System.Drawing.Size(571, 212);
this.gpbSensoriamento.TabIndex = 13;
this.gpbSensoriamento.TabStop = false;
this.gpbSensoriamento.Text = "Sensoriamento";
@ -517,10 +512,9 @@ namespace AgroBase
// lblSenMotores
//
this.lblSenMotores.AutoSize = true;
this.lblSenMotores.Location = new System.Drawing.Point(9, 19);
this.lblSenMotores.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblSenMotores.Location = new System.Drawing.Point(12, 23);
this.lblSenMotores.Name = "lblSenMotores";
this.lblSenMotores.Size = new System.Drawing.Size(45, 13);
this.lblSenMotores.Size = new System.Drawing.Size(56, 16);
this.lblSenMotores.TabIndex = 1;
this.lblSenMotores.Text = "Motores";
//
@ -530,20 +524,20 @@ namespace AgroBase
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.gridSenMotores.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridSenMotores.Location = new System.Drawing.Point(4, 35);
this.gridSenMotores.Margin = new System.Windows.Forms.Padding(2);
this.gridSenMotores.Location = new System.Drawing.Point(5, 43);
this.gridSenMotores.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gridSenMotores.Name = "gridSenMotores";
this.gridSenMotores.RowHeadersWidth = 51;
this.gridSenMotores.RowTemplate.Height = 24;
this.gridSenMotores.Size = new System.Drawing.Size(419, 132);
this.gridSenMotores.Size = new System.Drawing.Size(559, 162);
this.gridSenMotores.TabIndex = 0;
//
// btnDiagnosticos
//
this.btnDiagnosticos.Location = new System.Drawing.Point(4, 17);
this.btnDiagnosticos.Margin = new System.Windows.Forms.Padding(2);
this.btnDiagnosticos.Location = new System.Drawing.Point(5, 21);
this.btnDiagnosticos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnDiagnosticos.Name = "btnDiagnosticos";
this.btnDiagnosticos.Size = new System.Drawing.Size(84, 20);
this.btnDiagnosticos.Size = new System.Drawing.Size(112, 25);
this.btnDiagnosticos.TabIndex = 14;
this.btnDiagnosticos.Text = "Diagnósticos";
this.btnDiagnosticos.UseVisualStyleBackColor = true;
@ -551,10 +545,10 @@ namespace AgroBase
//
// btnAcompanhamento
//
this.btnAcompanhamento.Location = new System.Drawing.Point(4, 42);
this.btnAcompanhamento.Margin = new System.Windows.Forms.Padding(2);
this.btnAcompanhamento.Location = new System.Drawing.Point(5, 52);
this.btnAcompanhamento.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnAcompanhamento.Name = "btnAcompanhamento";
this.btnAcompanhamento.Size = new System.Drawing.Size(84, 20);
this.btnAcompanhamento.Size = new System.Drawing.Size(112, 25);
this.btnAcompanhamento.TabIndex = 15;
this.btnAcompanhamento.Text = "Plotagem";
this.btnAcompanhamento.UseVisualStyleBackColor = true;
@ -562,10 +556,10 @@ namespace AgroBase
//
// btnAtuCamera
//
this.btnAtuCamera.Location = new System.Drawing.Point(4, 67);
this.btnAtuCamera.Margin = new System.Windows.Forms.Padding(2);
this.btnAtuCamera.Location = new System.Drawing.Point(5, 82);
this.btnAtuCamera.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnAtuCamera.Name = "btnAtuCamera";
this.btnAtuCamera.Size = new System.Drawing.Size(84, 20);
this.btnAtuCamera.Size = new System.Drawing.Size(112, 25);
this.btnAtuCamera.TabIndex = 16;
this.btnAtuCamera.Text = "Ver solo";
this.btnAtuCamera.UseVisualStyleBackColor = true;
@ -573,10 +567,10 @@ namespace AgroBase
//
// btnMapas
//
this.btnMapas.Location = new System.Drawing.Point(4, 118);
this.btnMapas.Margin = new System.Windows.Forms.Padding(2);
this.btnMapas.Location = new System.Drawing.Point(5, 145);
this.btnMapas.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnMapas.Name = "btnMapas";
this.btnMapas.Size = new System.Drawing.Size(84, 20);
this.btnMapas.Size = new System.Drawing.Size(112, 25);
this.btnMapas.TabIndex = 17;
this.btnMapas.Text = "Mapas";
this.btnMapas.UseVisualStyleBackColor = true;
@ -584,10 +578,10 @@ namespace AgroBase
//
// btnSenCamera
//
this.btnSenCamera.Location = new System.Drawing.Point(4, 93);
this.btnSenCamera.Margin = new System.Windows.Forms.Padding(2);
this.btnSenCamera.Location = new System.Drawing.Point(5, 114);
this.btnSenCamera.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSenCamera.Name = "btnSenCamera";
this.btnSenCamera.Size = new System.Drawing.Size(84, 20);
this.btnSenCamera.Size = new System.Drawing.Size(112, 25);
this.btnSenCamera.TabIndex = 18;
this.btnSenCamera.Text = "Ver caminho";
this.btnSenCamera.UseVisualStyleBackColor = true;
@ -599,11 +593,11 @@ namespace AgroBase
this.gpbJoystick.Controls.Add(this.btnJoyEdt);
this.gpbJoystick.Controls.Add(this.btnJoyAtt);
this.gpbJoystick.Controls.Add(this.btnVer);
this.gpbJoystick.Location = new System.Drawing.Point(9, 10);
this.gpbJoystick.Margin = new System.Windows.Forms.Padding(2);
this.gpbJoystick.Location = new System.Drawing.Point(12, 12);
this.gpbJoystick.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbJoystick.Name = "gpbJoystick";
this.gpbJoystick.Padding = new System.Windows.Forms.Padding(2);
this.gpbJoystick.Size = new System.Drawing.Size(330, 49);
this.gpbJoystick.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbJoystick.Size = new System.Drawing.Size(440, 60);
this.gpbJoystick.TabIndex = 18;
this.gpbJoystick.TabStop = false;
this.gpbJoystick.Text = "Joystick";
@ -614,17 +608,18 @@ namespace AgroBase
this.gpbControleDirecional.Controls.Add(this.tkbAngulo);
this.gpbControleDirecional.Controls.Add(this.lblAngulo);
this.gpbControleDirecional.Controls.Add(this.lblVelocidade);
this.gpbControleDirecional.Location = new System.Drawing.Point(9, 154);
this.gpbControleDirecional.Margin = new System.Windows.Forms.Padding(2);
this.gpbControleDirecional.Location = new System.Drawing.Point(12, 190);
this.gpbControleDirecional.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbControleDirecional.Name = "gpbControleDirecional";
this.gpbControleDirecional.Padding = new System.Windows.Forms.Padding(2);
this.gpbControleDirecional.Size = new System.Drawing.Size(330, 149);
this.gpbControleDirecional.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbControleDirecional.Size = new System.Drawing.Size(440, 183);
this.gpbControleDirecional.TabIndex = 19;
this.gpbControleDirecional.TabStop = false;
this.gpbControleDirecional.Text = "Controle Direcional";
//
// gpbAtalhos
//
this.gpbAtalhos.Controls.Add(this.btnKinect);
this.gpbAtalhos.Controls.Add(this.btnSimulador);
this.gpbAtalhos.Controls.Add(this.btnSonar);
this.gpbAtalhos.Controls.Add(this.btnAtuCalibragem);
@ -635,21 +630,21 @@ namespace AgroBase
this.gpbAtalhos.Controls.Add(this.btnSenCamera);
this.gpbAtalhos.Controls.Add(this.btnAtuCamera);
this.gpbAtalhos.Controls.Add(this.btnMapas);
this.gpbAtalhos.Location = new System.Drawing.Point(344, 10);
this.gpbAtalhos.Margin = new System.Windows.Forms.Padding(2);
this.gpbAtalhos.Location = new System.Drawing.Point(459, 12);
this.gpbAtalhos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbAtalhos.Name = "gpbAtalhos";
this.gpbAtalhos.Padding = new System.Windows.Forms.Padding(2);
this.gpbAtalhos.Size = new System.Drawing.Size(93, 292);
this.gpbAtalhos.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbAtalhos.Size = new System.Drawing.Size(124, 359);
this.gpbAtalhos.TabIndex = 20;
this.gpbAtalhos.TabStop = false;
this.gpbAtalhos.Text = "Atalhos";
//
// btnSimulador
//
this.btnSimulador.Location = new System.Drawing.Point(4, 236);
this.btnSimulador.Margin = new System.Windows.Forms.Padding(2);
this.btnSimulador.Location = new System.Drawing.Point(5, 290);
this.btnSimulador.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSimulador.Name = "btnSimulador";
this.btnSimulador.Size = new System.Drawing.Size(84, 20);
this.btnSimulador.Size = new System.Drawing.Size(112, 25);
this.btnSimulador.TabIndex = 23;
this.btnSimulador.Text = "Simulador";
this.btnSimulador.UseVisualStyleBackColor = true;
@ -657,10 +652,10 @@ namespace AgroBase
//
// btnSonar
//
this.btnSonar.Location = new System.Drawing.Point(4, 213);
this.btnSonar.Margin = new System.Windows.Forms.Padding(2);
this.btnSonar.Location = new System.Drawing.Point(5, 262);
this.btnSonar.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSonar.Name = "btnSonar";
this.btnSonar.Size = new System.Drawing.Size(84, 20);
this.btnSonar.Size = new System.Drawing.Size(112, 25);
this.btnSonar.TabIndex = 22;
this.btnSonar.Text = "Sonar";
this.btnSonar.UseVisualStyleBackColor = true;
@ -668,10 +663,10 @@ namespace AgroBase
//
// btnAtuCalibragem
//
this.btnAtuCalibragem.Location = new System.Drawing.Point(4, 189);
this.btnAtuCalibragem.Margin = new System.Windows.Forms.Padding(2);
this.btnAtuCalibragem.Location = new System.Drawing.Point(5, 233);
this.btnAtuCalibragem.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnAtuCalibragem.Name = "btnAtuCalibragem";
this.btnAtuCalibragem.Size = new System.Drawing.Size(84, 20);
this.btnAtuCalibragem.Size = new System.Drawing.Size(112, 25);
this.btnAtuCalibragem.TabIndex = 21;
this.btnAtuCalibragem.Text = "Atuador";
this.btnAtuCalibragem.UseVisualStyleBackColor = true;
@ -679,10 +674,10 @@ namespace AgroBase
//
// btnContornos
//
this.btnContornos.Location = new System.Drawing.Point(4, 166);
this.btnContornos.Margin = new System.Windows.Forms.Padding(2);
this.btnContornos.Location = new System.Drawing.Point(5, 204);
this.btnContornos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnContornos.Name = "btnContornos";
this.btnContornos.Size = new System.Drawing.Size(84, 20);
this.btnContornos.Size = new System.Drawing.Size(112, 25);
this.btnContornos.TabIndex = 20;
this.btnContornos.Text = "Contornos";
this.btnContornos.UseVisualStyleBackColor = true;
@ -690,10 +685,10 @@ namespace AgroBase
//
// btnGPS
//
this.btnGPS.Location = new System.Drawing.Point(4, 142);
this.btnGPS.Margin = new System.Windows.Forms.Padding(2);
this.btnGPS.Location = new System.Drawing.Point(5, 175);
this.btnGPS.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnGPS.Name = "btnGPS";
this.btnGPS.Size = new System.Drawing.Size(84, 20);
this.btnGPS.Size = new System.Drawing.Size(112, 25);
this.btnGPS.TabIndex = 19;
this.btnGPS.Text = "GPS";
this.btnGPS.UseVisualStyleBackColor = true;
@ -707,21 +702,21 @@ namespace AgroBase
this.gpbOperacao.Controls.Add(this.btnIniciarOperacao);
this.gpbOperacao.Controls.Add(this.lblModoOperacao);
this.gpbOperacao.Controls.Add(this.cmbModoOperacao);
this.gpbOperacao.Location = new System.Drawing.Point(9, 307);
this.gpbOperacao.Margin = new System.Windows.Forms.Padding(2);
this.gpbOperacao.Location = new System.Drawing.Point(12, 378);
this.gpbOperacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbOperacao.Name = "gpbOperacao";
this.gpbOperacao.Padding = new System.Windows.Forms.Padding(2);
this.gpbOperacao.Size = new System.Drawing.Size(428, 101);
this.gpbOperacao.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbOperacao.Size = new System.Drawing.Size(571, 124);
this.gpbOperacao.TabIndex = 21;
this.gpbOperacao.TabStop = false;
this.gpbOperacao.Text = "Operação";
//
// btnIHM
//
this.btnIHM.Location = new System.Drawing.Point(296, 63);
this.btnIHM.Margin = new System.Windows.Forms.Padding(2);
this.btnIHM.Location = new System.Drawing.Point(395, 78);
this.btnIHM.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnIHM.Name = "btnIHM";
this.btnIHM.Size = new System.Drawing.Size(122, 33);
this.btnIHM.Size = new System.Drawing.Size(163, 41);
this.btnIHM.TabIndex = 16;
this.btnIHM.Text = "IHM";
this.btnIHM.UseVisualStyleBackColor = true;
@ -729,10 +724,10 @@ namespace AgroBase
//
// btnConfigurarOperacao
//
this.btnConfigurarOperacao.Location = new System.Drawing.Point(121, 63);
this.btnConfigurarOperacao.Margin = new System.Windows.Forms.Padding(2);
this.btnConfigurarOperacao.Location = new System.Drawing.Point(161, 78);
this.btnConfigurarOperacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnConfigurarOperacao.Name = "btnConfigurarOperacao";
this.btnConfigurarOperacao.Size = new System.Drawing.Size(122, 33);
this.btnConfigurarOperacao.Size = new System.Drawing.Size(163, 41);
this.btnConfigurarOperacao.TabIndex = 15;
this.btnConfigurarOperacao.Text = "Configurar Operação";
this.btnConfigurarOperacao.UseVisualStyleBackColor = true;
@ -741,20 +736,20 @@ namespace AgroBase
// chbDebugMode
//
this.chbDebugMode.AutoSize = true;
this.chbDebugMode.Location = new System.Drawing.Point(134, 40);
this.chbDebugMode.Margin = new System.Windows.Forms.Padding(2);
this.chbDebugMode.Location = new System.Drawing.Point(179, 49);
this.chbDebugMode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.chbDebugMode.Name = "chbDebugMode";
this.chbDebugMode.Size = new System.Drawing.Size(109, 17);
this.chbDebugMode.Size = new System.Drawing.Size(135, 20);
this.chbDebugMode.TabIndex = 14;
this.chbDebugMode.Text = "Modo Depuração";
this.chbDebugMode.UseVisualStyleBackColor = true;
//
// btnIniciarOperacao
//
this.btnIniciarOperacao.Location = new System.Drawing.Point(7, 63);
this.btnIniciarOperacao.Margin = new System.Windows.Forms.Padding(2);
this.btnIniciarOperacao.Location = new System.Drawing.Point(9, 78);
this.btnIniciarOperacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnIniciarOperacao.Name = "btnIniciarOperacao";
this.btnIniciarOperacao.Size = new System.Drawing.Size(109, 33);
this.btnIniciarOperacao.Size = new System.Drawing.Size(145, 41);
this.btnIniciarOperacao.TabIndex = 13;
this.btnIniciarOperacao.Text = "Iniciar Operação";
this.btnIniciarOperacao.UseVisualStyleBackColor = true;
@ -763,10 +758,9 @@ namespace AgroBase
// lblModoOperacao
//
this.lblModoOperacao.AutoSize = true;
this.lblModoOperacao.Location = new System.Drawing.Point(4, 22);
this.lblModoOperacao.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblModoOperacao.Location = new System.Drawing.Point(5, 27);
this.lblModoOperacao.Name = "lblModoOperacao";
this.lblModoOperacao.Size = new System.Drawing.Size(34, 13);
this.lblModoOperacao.Size = new System.Drawing.Size(42, 16);
this.lblModoOperacao.TabIndex = 13;
this.lblModoOperacao.Text = "Modo";
//
@ -774,18 +768,29 @@ namespace AgroBase
//
this.cmbModoOperacao.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbModoOperacao.FormattingEnabled = true;
this.cmbModoOperacao.Location = new System.Drawing.Point(7, 38);
this.cmbModoOperacao.Margin = new System.Windows.Forms.Padding(2);
this.cmbModoOperacao.Location = new System.Drawing.Point(9, 47);
this.cmbModoOperacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmbModoOperacao.Name = "cmbModoOperacao";
this.cmbModoOperacao.Size = new System.Drawing.Size(110, 21);
this.cmbModoOperacao.Size = new System.Drawing.Size(145, 24);
this.cmbModoOperacao.TabIndex = 13;
this.cmbModoOperacao.SelectedIndexChanged += new System.EventHandler(this.cmbModoOperacao_SelectedIndexChanged);
//
// btnKinect
//
this.btnKinect.Location = new System.Drawing.Point(5, 319);
this.btnKinect.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnKinect.Name = "btnKinect";
this.btnKinect.Size = new System.Drawing.Size(112, 25);
this.btnKinect.TabIndex = 24;
this.btnKinect.Text = "Kinect";
this.btnKinect.UseVisualStyleBackColor = true;
this.btnKinect.Click += new System.EventHandler(this.btnKinect_Click);
//
// frmPrincipal
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1028, 609);
this.ClientSize = new System.Drawing.Size(1371, 750);
this.Controls.Add(this.gpbOperacao);
this.Controls.Add(this.gpbAtalhos);
this.Controls.Add(this.gpbControleDirecional);
@ -794,7 +799,7 @@ namespace AgroBase
this.Controls.Add(this.gpbSensoriamento);
this.Controls.Add(this.generalStrip);
this.Controls.Add(this.gpbAcoes);
this.Margin = new System.Windows.Forms.Padding(2);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "frmPrincipal";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Agro Base";
@ -894,6 +899,7 @@ namespace AgroBase
private System.Windows.Forms.Button btnAtuCalibragem;
private System.Windows.Forms.Button btnSonar;
private System.Windows.Forms.Button btnSimulador;
private System.Windows.Forms.Button btnKinect;
}
}

View File

@ -319,5 +319,11 @@ namespace AgroBase
frmSimulacaoMapaGPS frm = new frmSimulacaoMapaGPS();
frm.Show();
}
private void btnKinect_Click(object sender, EventArgs e)
{
frmKinect frmKinect = new frmKinect();
frmKinect.Show();
}
}
}

View File

@ -213,7 +213,10 @@ namespace AgroBase.Comum
public void AdicionarMensagemFila(string Dados)
{
FilaService.AdicionarMensagemFila(Dispositivo, Dados);
if (PortaCOM() != "")
{
FilaService.AdicionarMensagemFila(Dispositivo, Dados);
}
}
public Control InstanciarDispositivo(int index)

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
8e2d0b7a37f6d69cae4c2fdfb49e5efe7022e4017728fe2df6b21acde94e1f59
95c797dbe9373c4dcf5956870d3069604dc75d1e01e8901cbe99102cd73c9f40

View File

@ -441,4 +441,7 @@ C:\ZendionINC\agrobot_base\AgroBase\AgroBase\bin\Debug\Python\Models\deeplabv3pl
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\bin\Debug\AgroBase.exe.config
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\bin\Debug\AgroBase.exe
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\bin\Debug\AgroBase.pdb
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.CopyComplete
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmKinect.resources
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\bin\Debug\Microsoft.Kinect.dll
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\bin\Debug\Microsoft.Kinect.xml
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.Up2Date

View File

@ -0,0 +1,58 @@
#include <Wire.h>
#define AS5600_ADDRESS 0x36 // Endereço I2C do AS5600
int pino = 34;
int _Angulo_Offset = 0;
void setup() {
Serial.begin(115200);
pinMode(pino, INPUT);
Wire.begin();
}
void loop() {
int16_t angle = 0; //readAS5600Angle();
double angle2 = AferirPosicao();
Serial.print("Ângulo I2C: ");
Serial.print(angle);
Serial.print(", Ângulo PWM: ");
Serial.println(angle2);
delay(1000); // Espera 1 segundo antes de fazer a próxima leitura
}
int16_t readAS5600Angle() {
Wire.beginTransmission(AS5600_ADDRESS); // Inicia comunicação com o sensor
Wire.write(0x0E); // Endereço do registro que contém o valor do ângulo
Wire.endTransmission(false); // Termina a transmissão
// Inicia a transmissão para leitura de dados
Wire.requestFrom(AS5600_ADDRESS, 2); // Lê 2 bytes (16 bits) do registro de ângulo
// Espera até que os dados estejam disponíveis
while (Wire.available() < 2) {
delay(1);
}
// Lê os dados
uint16_t rawData = Wire.read();
rawData = rawData << 8 | Wire.read(); // Junta os bytes para formar um inteiro
// Converte o valor para um ângulo em graus
float angle = rawData * 360.0 / 4096.0;
return angle;
}
double AferirPosicao() {
// Lê o valor analógico do pino conectado à saída analógica do AS5600
int sensorValue = analogRead(pino);
// Converte a leitura para ângulo (0V a 3.3V corresponde a 0 a 360 graus)
double _angulo = (sensorValue / 4095.0) * 360.0;
// Ajusta o ângulo com o offset
double angulo_com_offset = _angulo - _Angulo_Offset; // Considerando que o offset pode ser positivo ou negativo
// Normaliza o ângulo para o intervalo de -180 a 180 graus
while (angulo_com_offset > 180) angulo_com_offset -= 360;
while (angulo_com_offset < -180) angulo_com_offset += 360;
return angulo_com_offset;
}

29
Python/kinect_v1.py Normal file
View File

@ -0,0 +1,29 @@
import pygame
from pykinect import nui
# Inicialize o pygame
pygame.init()
# Crie uma janela
screen = pygame.display.set_mode((640, 480), pygame.HWSURFACE | pygame.DOUBLEBUF, 32)
# Inicialize o Kinect
kinect = nui.Runtime()
# Loop principal
while True:
# Verifique se há eventos de saída
for event in pygame.event.get():
if event.type == pygame.QUIT:
kinect.close()
pygame.quit()
quit()
# Obtenha uma imagem da câmera RGB
video = kinect.video_stream.get_next_frame()
if video:
frame_surface = pygame.image.frombuffer(video.image.bits, (video.image.width, video.image.height), "RGB").convert()
screen.blit(frame_surface, (0, 0))
# Atualize a tela
pygame.display.update()