Little fix
This commit is contained in:
@ -17,6 +17,7 @@ namespace TelemetryIO.Models
|
||||
public string name = "";
|
||||
public float[] raw_imu = new float[6];
|
||||
public float[] imu = new float[6];
|
||||
public float[] filtered_imu = new float[6];
|
||||
public float[] g_integration = new float[3];
|
||||
public float[] euler = new float[3];
|
||||
public float[] quaternion = new float[4];
|
||||
@ -43,6 +44,13 @@ namespace TelemetryIO.Models
|
||||
dictMonitor.Add("Gy", new VarAddress(IMU_ADDRESS, 4));
|
||||
dictMonitor.Add("Gz", new VarAddress(IMU_ADDRESS, 5));
|
||||
|
||||
dictMonitor.Add("filtered_Ax", new VarAddress(FILTERED_IMU_ADDRESS, 0));
|
||||
dictMonitor.Add("filtered_Ay", new VarAddress(FILTERED_IMU_ADDRESS, 1));
|
||||
dictMonitor.Add("filtered_Az", new VarAddress(FILTERED_IMU_ADDRESS, 2));
|
||||
dictMonitor.Add("filtered_Gx", new VarAddress(FILTERED_IMU_ADDRESS, 3));
|
||||
dictMonitor.Add("filtered_Gy", new VarAddress(FILTERED_IMU_ADDRESS, 4));
|
||||
dictMonitor.Add("filtered_Gz", new VarAddress(FILTERED_IMU_ADDRESS, 5));
|
||||
|
||||
dictMonitor.Add("Gx_int", new VarAddress(G_INTEGRATION_ADDRESS, 0));
|
||||
dictMonitor.Add("Gy_int", new VarAddress(G_INTEGRATION_ADDRESS, 1));
|
||||
dictMonitor.Add("Gz_int", new VarAddress(G_INTEGRATION_ADDRESS, 2));
|
||||
@ -122,6 +130,10 @@ namespace TelemetryIO.Models
|
||||
set_float(euler, data, offset, len);
|
||||
break;
|
||||
|
||||
case FILTERED_IMU_ADDRESS://IMU
|
||||
set_float(filtered_imu, data, offset, len);
|
||||
break;
|
||||
|
||||
case BAT_ADDRESS://battery
|
||||
set_float(battery, data, offset, len);
|
||||
break;
|
||||
@ -178,6 +190,7 @@ namespace TelemetryIO.Models
|
||||
public const int Q_ADDRESS = 2;
|
||||
public const int G_INTEGRATION_ADDRESS = 3;
|
||||
public const int EULER_ADDRESS = 4;
|
||||
public const int FILTERED_IMU_ADDRESS = 5;
|
||||
|
||||
public const int BAT_ADDRESS = 50;
|
||||
|
||||
|
372
TelemetryIO/TestQuaternion.Designer.cs
generated
Normal file
372
TelemetryIO/TestQuaternion.Designer.cs
generated
Normal file
@ -0,0 +1,372 @@
|
||||
namespace TelemetryIO
|
||||
{
|
||||
partial class TestQuaternion
|
||||
{
|
||||
/// <summary>
|
||||
/// Обязательная переменная конструктора.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Освободить все используемые ресурсы.
|
||||
/// </summary>
|
||||
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Код, автоматически созданный конструктором компонентов
|
||||
|
||||
/// <summary>
|
||||
/// Требуемый метод для поддержки конструктора — не изменяйте
|
||||
/// содержимое этого метода с помощью редактора кода.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.YAW_track = new System.Windows.Forms.TrackBar();
|
||||
this.YAW_label = new System.Windows.Forms.Label();
|
||||
this.ROLL_label = new System.Windows.Forms.Label();
|
||||
this.ROLL_track = new System.Windows.Forms.TrackBar();
|
||||
this.PITCH_label = new System.Windows.Forms.Label();
|
||||
this.PITCH_track = new System.Windows.Forms.TrackBar();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.Psi_label = new System.Windows.Forms.Label();
|
||||
this.Theta_label = new System.Windows.Forms.Label();
|
||||
this.Phi_label = new System.Windows.Forms.Label();
|
||||
this.Qy_label = new System.Windows.Forms.Label();
|
||||
this.Qx_label = new System.Windows.Forms.Label();
|
||||
this.Qw_label = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.Qz_label = new System.Windows.Forms.Label();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
this.Reset_quaternion = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.YAW_track)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ROLL_track)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.PITCH_track)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// YAW_track
|
||||
//
|
||||
this.YAW_track.Location = new System.Drawing.Point(131, 27);
|
||||
this.YAW_track.Maximum = 180;
|
||||
this.YAW_track.Name = "YAW_track";
|
||||
this.YAW_track.Orientation = System.Windows.Forms.Orientation.Vertical;
|
||||
this.YAW_track.Size = new System.Drawing.Size(45, 104);
|
||||
this.YAW_track.TabIndex = 0;
|
||||
this.YAW_track.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
|
||||
this.YAW_track.Scroll += new System.EventHandler(this.YAW_track_Scroll);
|
||||
//
|
||||
// YAW_label
|
||||
//
|
||||
this.YAW_label.AutoSize = true;
|
||||
this.YAW_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.YAW_label.Location = new System.Drawing.Point(145, 138);
|
||||
this.YAW_label.Name = "YAW_label";
|
||||
this.YAW_label.Size = new System.Drawing.Size(16, 17);
|
||||
this.YAW_label.TabIndex = 1;
|
||||
this.YAW_label.Text = "0";
|
||||
this.YAW_label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// ROLL_label
|
||||
//
|
||||
this.ROLL_label.AutoSize = true;
|
||||
this.ROLL_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.ROLL_label.Location = new System.Drawing.Point(43, 138);
|
||||
this.ROLL_label.Name = "ROLL_label";
|
||||
this.ROLL_label.Size = new System.Drawing.Size(16, 17);
|
||||
this.ROLL_label.TabIndex = 3;
|
||||
this.ROLL_label.Text = "0";
|
||||
this.ROLL_label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// ROLL_track
|
||||
//
|
||||
this.ROLL_track.Location = new System.Drawing.Point(29, 27);
|
||||
this.ROLL_track.Maximum = 180;
|
||||
this.ROLL_track.Name = "ROLL_track";
|
||||
this.ROLL_track.Orientation = System.Windows.Forms.Orientation.Vertical;
|
||||
this.ROLL_track.Size = new System.Drawing.Size(45, 104);
|
||||
this.ROLL_track.TabIndex = 2;
|
||||
this.ROLL_track.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
|
||||
this.ROLL_track.Scroll += new System.EventHandler(this.ROLL_track_Scroll);
|
||||
//
|
||||
// PITCH_label
|
||||
//
|
||||
this.PITCH_label.AutoSize = true;
|
||||
this.PITCH_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.PITCH_label.Location = new System.Drawing.Point(94, 138);
|
||||
this.PITCH_label.Name = "PITCH_label";
|
||||
this.PITCH_label.Size = new System.Drawing.Size(16, 17);
|
||||
this.PITCH_label.TabIndex = 5;
|
||||
this.PITCH_label.Text = "0";
|
||||
this.PITCH_label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// PITCH_track
|
||||
//
|
||||
this.PITCH_track.Location = new System.Drawing.Point(80, 27);
|
||||
this.PITCH_track.Maximum = 180;
|
||||
this.PITCH_track.Name = "PITCH_track";
|
||||
this.PITCH_track.Orientation = System.Windows.Forms.Orientation.Vertical;
|
||||
this.PITCH_track.Size = new System.Drawing.Size(45, 104);
|
||||
this.PITCH_track.TabIndex = 4;
|
||||
this.PITCH_track.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
|
||||
this.PITCH_track.Scroll += new System.EventHandler(this.PITCH_track_Scroll);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label1.Location = new System.Drawing.Point(379, 44);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(28, 17);
|
||||
this.label1.TabIndex = 6;
|
||||
this.label1.Text = "Phi";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label2.Location = new System.Drawing.Point(362, 61);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(45, 17);
|
||||
this.label2.TabIndex = 7;
|
||||
this.label2.Text = "Theta";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label3.Location = new System.Drawing.Point(380, 78);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(27, 17);
|
||||
this.label3.TabIndex = 8;
|
||||
this.label3.Text = "Psi";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// Psi_label
|
||||
//
|
||||
this.Psi_label.AutoSize = true;
|
||||
this.Psi_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.Psi_label.Location = new System.Drawing.Point(425, 78);
|
||||
this.Psi_label.Name = "Psi_label";
|
||||
this.Psi_label.Size = new System.Drawing.Size(27, 17);
|
||||
this.Psi_label.TabIndex = 11;
|
||||
this.Psi_label.Text = "Psi";
|
||||
this.Psi_label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// Theta_label
|
||||
//
|
||||
this.Theta_label.AutoSize = true;
|
||||
this.Theta_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.Theta_label.Location = new System.Drawing.Point(425, 61);
|
||||
this.Theta_label.Name = "Theta_label";
|
||||
this.Theta_label.Size = new System.Drawing.Size(45, 17);
|
||||
this.Theta_label.TabIndex = 10;
|
||||
this.Theta_label.Text = "Theta";
|
||||
this.Theta_label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// Phi_label
|
||||
//
|
||||
this.Phi_label.AutoSize = true;
|
||||
this.Phi_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.Phi_label.Location = new System.Drawing.Point(425, 44);
|
||||
this.Phi_label.Name = "Phi_label";
|
||||
this.Phi_label.Size = new System.Drawing.Size(28, 17);
|
||||
this.Phi_label.TabIndex = 9;
|
||||
this.Phi_label.Text = "Phi";
|
||||
this.Phi_label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// Qy_label
|
||||
//
|
||||
this.Qy_label.AutoSize = true;
|
||||
this.Qy_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.Qy_label.Location = new System.Drawing.Point(270, 78);
|
||||
this.Qy_label.Name = "Qy_label";
|
||||
this.Qy_label.Size = new System.Drawing.Size(16, 17);
|
||||
this.Qy_label.TabIndex = 17;
|
||||
this.Qy_label.Text = "0";
|
||||
this.Qy_label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// Qx_label
|
||||
//
|
||||
this.Qx_label.AutoSize = true;
|
||||
this.Qx_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.Qx_label.Location = new System.Drawing.Point(270, 61);
|
||||
this.Qx_label.Name = "Qx_label";
|
||||
this.Qx_label.Size = new System.Drawing.Size(16, 17);
|
||||
this.Qx_label.TabIndex = 16;
|
||||
this.Qx_label.Text = "0";
|
||||
this.Qx_label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// Qw_label
|
||||
//
|
||||
this.Qw_label.AutoSize = true;
|
||||
this.Qw_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.Qw_label.Location = new System.Drawing.Point(270, 44);
|
||||
this.Qw_label.Name = "Qw_label";
|
||||
this.Qw_label.Size = new System.Drawing.Size(16, 17);
|
||||
this.Qw_label.TabIndex = 15;
|
||||
this.Qw_label.Text = "1";
|
||||
this.Qw_label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label7.Location = new System.Drawing.Point(225, 78);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(15, 17);
|
||||
this.label7.TabIndex = 14;
|
||||
this.label7.Text = "y";
|
||||
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label8.Location = new System.Drawing.Point(226, 61);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(14, 17);
|
||||
this.label8.TabIndex = 13;
|
||||
this.label8.Text = "x";
|
||||
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label9.Location = new System.Drawing.Point(223, 44);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(17, 17);
|
||||
this.label9.TabIndex = 12;
|
||||
this.label9.Text = "w";
|
||||
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// Qz_label
|
||||
//
|
||||
this.Qz_label.AutoSize = true;
|
||||
this.Qz_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.Qz_label.Location = new System.Drawing.Point(270, 95);
|
||||
this.Qz_label.Name = "Qz_label";
|
||||
this.Qz_label.Size = new System.Drawing.Size(16, 17);
|
||||
this.Qz_label.TabIndex = 19;
|
||||
this.Qz_label.Text = "0";
|
||||
this.Qz_label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label11
|
||||
//
|
||||
this.label11.AutoSize = true;
|
||||
this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label11.Location = new System.Drawing.Point(225, 95);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(15, 17);
|
||||
this.label11.TabIndex = 18;
|
||||
this.label11.Text = "z";
|
||||
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// label12
|
||||
//
|
||||
this.label12.AutoSize = true;
|
||||
this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label12.Location = new System.Drawing.Point(218, 27);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(89, 17);
|
||||
this.label12.TabIndex = 20;
|
||||
this.label12.Text = "Quaternion";
|
||||
//
|
||||
// label13
|
||||
//
|
||||
this.label13.AutoSize = true;
|
||||
this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label13.Location = new System.Drawing.Point(394, 27);
|
||||
this.label13.Name = "label13";
|
||||
this.label13.Size = new System.Drawing.Size(46, 17);
|
||||
this.label13.TabIndex = 21;
|
||||
this.label13.Text = "Euler";
|
||||
//
|
||||
// Reset_quaternion
|
||||
//
|
||||
this.Reset_quaternion.Location = new System.Drawing.Point(221, 126);
|
||||
this.Reset_quaternion.Name = "Reset_quaternion";
|
||||
this.Reset_quaternion.Size = new System.Drawing.Size(75, 23);
|
||||
this.Reset_quaternion.TabIndex = 22;
|
||||
this.Reset_quaternion.Text = "Reset";
|
||||
this.Reset_quaternion.UseVisualStyleBackColor = true;
|
||||
this.Reset_quaternion.Click += new System.EventHandler(this.Reset_quaternion_Click);
|
||||
//
|
||||
// TestQuaternion
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.Reset_quaternion);
|
||||
this.Controls.Add(this.label13);
|
||||
this.Controls.Add(this.label12);
|
||||
this.Controls.Add(this.Qz_label);
|
||||
this.Controls.Add(this.label11);
|
||||
this.Controls.Add(this.Qy_label);
|
||||
this.Controls.Add(this.Qx_label);
|
||||
this.Controls.Add(this.Qw_label);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.label8);
|
||||
this.Controls.Add(this.label9);
|
||||
this.Controls.Add(this.Psi_label);
|
||||
this.Controls.Add(this.Theta_label);
|
||||
this.Controls.Add(this.Phi_label);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.PITCH_label);
|
||||
this.Controls.Add(this.PITCH_track);
|
||||
this.Controls.Add(this.ROLL_label);
|
||||
this.Controls.Add(this.ROLL_track);
|
||||
this.Controls.Add(this.YAW_label);
|
||||
this.Controls.Add(this.YAW_track);
|
||||
this.Name = "TestQuaternion";
|
||||
this.Size = new System.Drawing.Size(620, 460);
|
||||
((System.ComponentModel.ISupportInitialize)(this.YAW_track)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ROLL_track)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.PITCH_track)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TrackBar YAW_track;
|
||||
private System.Windows.Forms.Label YAW_label;
|
||||
private System.Windows.Forms.Label ROLL_label;
|
||||
private System.Windows.Forms.TrackBar ROLL_track;
|
||||
private System.Windows.Forms.Label PITCH_label;
|
||||
private System.Windows.Forms.TrackBar PITCH_track;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label Psi_label;
|
||||
private System.Windows.Forms.Label Theta_label;
|
||||
private System.Windows.Forms.Label Phi_label;
|
||||
private System.Windows.Forms.Label Qy_label;
|
||||
private System.Windows.Forms.Label Qx_label;
|
||||
private System.Windows.Forms.Label Qw_label;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.Label Qz_label;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.Label label12;
|
||||
private System.Windows.Forms.Label label13;
|
||||
private System.Windows.Forms.Button Reset_quaternion;
|
||||
}
|
||||
}
|
128
TelemetryIO/TestQuaternion.cs
Normal file
128
TelemetryIO/TestQuaternion.cs
Normal file
@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace TelemetryIO
|
||||
{
|
||||
public partial class TestQuaternion : UserControl
|
||||
{
|
||||
private float[] rates = new float[3];
|
||||
private Quaternion attitude = new Quaternion(0, 0, 0, 1);
|
||||
public TestQuaternion()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void updateWithAngularRates()
|
||||
{
|
||||
Quaternion wq = new Quaternion(rates[0], rates[1], rates[2], 0);
|
||||
//wq *= 0.5f;
|
||||
attitude = attitude * wq;
|
||||
attitude = attitude*(1 / attitude.Length());
|
||||
}
|
||||
|
||||
private void ROLL_track_Scroll(object sender, EventArgs e)
|
||||
{
|
||||
TrackBar tb = sender as TrackBar;
|
||||
rates[0] = (float)(tb.Value)/180f*(float)Math.PI/2;
|
||||
updateWithAngularRates();
|
||||
updateView();
|
||||
}
|
||||
|
||||
private void PITCH_track_Scroll(object sender, EventArgs e)
|
||||
{
|
||||
TrackBar tb = sender as TrackBar;
|
||||
rates[1] = (float)(tb.Value) / 180f * (float)Math.PI/2;
|
||||
updateWithAngularRates();
|
||||
updateView();
|
||||
}
|
||||
|
||||
private void YAW_track_Scroll(object sender, EventArgs e)
|
||||
{
|
||||
TrackBar tb = sender as TrackBar;
|
||||
rates[2] = (float)(tb.Value) / 180f * (float)Math.PI/2;
|
||||
updateWithAngularRates();
|
||||
updateView();
|
||||
}
|
||||
|
||||
private void updateView()
|
||||
{
|
||||
if (Qw_label.InvokeRequired)
|
||||
{
|
||||
Qw_label.Invoke(new Action(()=> Qw_label.Text = attitude.W.ToString("0.000")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Qw_label.Text = attitude.W.ToString("0.000");
|
||||
}
|
||||
|
||||
if (Qx_label.InvokeRequired)
|
||||
{
|
||||
Qx_label.Invoke(new Action(() => Qx_label.Text = attitude.X.ToString("0.000")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Qx_label.Text = attitude.X.ToString("0.000");
|
||||
}
|
||||
|
||||
if (Qy_label.InvokeRequired)
|
||||
{
|
||||
Qy_label.Invoke(new Action(() => Qy_label.Text = attitude.Y.ToString("0.000")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Qy_label.Text = attitude.Y.ToString("0.000");
|
||||
}
|
||||
|
||||
if (Qz_label.InvokeRequired)
|
||||
{
|
||||
Qz_label.Invoke(new Action(() => Qz_label.Text = attitude.Z.ToString("0.000")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Qz_label.Text = attitude.Z.ToString("0.000");
|
||||
}
|
||||
|
||||
if (ROLL_label.InvokeRequired)
|
||||
{
|
||||
ROLL_label.Invoke(new Action(() => ROLL_label.Text = rates[0].ToString("0.00")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ROLL_label.Text = rates[0].ToString("0.00");
|
||||
}
|
||||
|
||||
if (PITCH_label.InvokeRequired)
|
||||
{
|
||||
PITCH_label.Invoke(new Action(() => PITCH_label.Text = rates[1].ToString("0.00")));
|
||||
}
|
||||
else
|
||||
{
|
||||
PITCH_label.Text = rates[1].ToString("0.00");
|
||||
}
|
||||
|
||||
if (YAW_label.InvokeRequired)
|
||||
{
|
||||
YAW_label.Invoke(new Action(() => YAW_label.Text = rates[2].ToString("0.00")));
|
||||
}
|
||||
else
|
||||
{
|
||||
YAW_label.Text = rates[2].ToString("0.00");
|
||||
}
|
||||
}
|
||||
|
||||
private void Reset_quaternion_Click(object sender, EventArgs e)
|
||||
{
|
||||
attitude = new Quaternion(0, 0, 0, 1);
|
||||
updateView();
|
||||
}
|
||||
}
|
||||
}
|
120
TelemetryIO/TestQuaternion.resx
Normal file
120
TelemetryIO/TestQuaternion.resx
Normal 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>
|
Reference in New Issue
Block a user