forked from DrTon/jMAVSim
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from stmoon/noise-control
sensor noise parameter control dialog
- Loading branch information
Showing
14 changed files
with
389 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="me.drton.jmavsim.SensorParamPanel"> | ||
<grid id="27dc6" binding="mainPanel" layout-manager="GridLayoutManager" row-count="8" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> | ||
<margin top="0" left="0" bottom="0" right="0"/> | ||
<constraints> | ||
<xy x="20" y="20" width="500" height="261"/> | ||
</constraints> | ||
<properties/> | ||
<border type="none"/> | ||
<children> | ||
<component id="eeb85" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Accel Noise StdDev"/> | ||
</properties> | ||
</component> | ||
<component id="b28e0" class="javax.swing.JSpinner" binding="accelSpinner"> | ||
<constraints> | ||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="d01db" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Gyro Noise StdDev"/> | ||
</properties> | ||
</component> | ||
<component id="1d206" class="javax.swing.JSpinner" binding="gyroSpinner"> | ||
<constraints> | ||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="db1b1" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Mag Noise StdDev"/> | ||
</properties> | ||
</component> | ||
<component id="75b59" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Pressure Noise StdDev"/> | ||
</properties> | ||
</component> | ||
<component id="a8c5e" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="GPS Noise StdDev"/> | ||
</properties> | ||
</component> | ||
<component id="3daf3" class="javax.swing.JSpinner" binding="magSpinner"> | ||
<constraints> | ||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="98010" class="javax.swing.JSpinner" binding="presSpinner"> | ||
<constraints> | ||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="a4cd8" class="javax.swing.JSpinner" binding="gpsSpinner"> | ||
<constraints> | ||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="3d1a1" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="6" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="--- VEHICLE ---"/> | ||
</properties> | ||
</component> | ||
<component id="dec3b" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="mass"/> | ||
</properties> | ||
</component> | ||
<component id="ec391" class="javax.swing.JSpinner" binding="massSpinner"> | ||
<constraints> | ||
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="df8a0" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="--- SENSORS ---"/> | ||
</properties> | ||
</component> | ||
</children> | ||
</grid> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package me.drton.jmavsim; | ||
|
||
import javax.swing.*; | ||
import javax.swing.event.ChangeEvent; | ||
import javax.swing.event.ChangeListener; | ||
|
||
/** | ||
* @file SensorParamPanel.java | ||
* Sensor Control Parameter Panel | ||
* | ||
* This panel is used for the sensor test and analysis | ||
* | ||
* @author SungTae Moon <[email protected]> | ||
*/ | ||
|
||
public class SensorParamPanel extends JPanel { | ||
private JSpinner accelSpinner; | ||
private JSpinner gyroSpinner; | ||
private JPanel mainPanel; | ||
private JSpinner magSpinner; | ||
private JSpinner presSpinner; | ||
private JSpinner gpsSpinner; | ||
private JSpinner massSpinner; | ||
|
||
protected Sensors sensors = null; | ||
|
||
public SensorParamPanel() { | ||
|
||
this.add(mainPanel); | ||
|
||
accelSpinner.setModel(new SpinnerNumberModel(0.0f, 0.0f, 1.0f, 0.01f)); | ||
gyroSpinner.setModel(new SpinnerNumberModel(0.0f, 0.0f, 1.0f, 0.01f)); | ||
gpsSpinner.setModel(new SpinnerNumberModel(0.0f, 0.0f, 100.0f, 1.0f)); | ||
magSpinner.setModel(new SpinnerNumberModel(0.0f, 0.0f, 1.0f, 0.001f)); | ||
presSpinner.setModel(new SpinnerNumberModel(0.0f, 0.0f, 1.0f, 0.01f)); | ||
massSpinner.setModel(new SpinnerNumberModel(0.0f, 0.0f, 5.0f, 0.1f)); | ||
|
||
accelSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)accelSpinner.getValue(); | ||
sensors.setParameter("noise_Acc", value.floatValue()); | ||
} | ||
}); | ||
|
||
gyroSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)gyroSpinner.getValue(); | ||
sensors.setParameter("noise_Gyo", value.floatValue()); | ||
} | ||
}); | ||
|
||
magSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)magSpinner.getValue(); | ||
sensors.setParameter("noise_Mag", value.floatValue()); | ||
} | ||
}); | ||
|
||
presSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)presSpinner.getValue(); | ||
sensors.setParameter("noise_Prs", value.floatValue()); | ||
} | ||
}); | ||
|
||
gpsSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)gpsSpinner.getValue(); | ||
sensors.setParameter("gpsNoiseStdDev", value.floatValue()); | ||
} | ||
}); | ||
|
||
massSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)massSpinner.getValue(); | ||
sensors.setParameter("mass", value.floatValue()); | ||
} | ||
}); | ||
|
||
} | ||
|
||
public JPanel panel() { | ||
return mainPanel; | ||
} | ||
|
||
public void setSensor(Sensors sensors) { | ||
this.sensors = sensors; | ||
|
||
// init value | ||
accelSpinner.setValue(new Double(sensors.param("noise_Acc"))); | ||
gyroSpinner.setValue(new Double(sensors.param("noise_Gyo"))); | ||
magSpinner.setValue(new Double(sensors.param("noise_Mag"))); | ||
presSpinner.setValue(new Double(sensors.param("noise_Prs"))); | ||
gpsSpinner.setValue(new Double(sensors.param("gpsNoiseStdDev"))); | ||
massSpinner.setValue(new Double(sensors.param("mass"))); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.