diff --git a/Ev3/main.py b/Ev3/main.py
index db8d1b8..f644ba6 100644
--- a/Ev3/main.py
+++ b/Ev3/main.py
@@ -65,7 +65,7 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
if recieved == 's':
stop()
elif recieved == 'm':
- move(500)
+ move(200)
elif recieved == 'i':
data = {
"battery_voltage":power.measured_volts,
@@ -80,12 +80,16 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
cam.run_timed(time_sp=100, speed_sp=-750)
elif recieved == 'f':
stop()
- motor1.run_timed(time_sp=500, speed_sp=500)
- motor2.run_timed(time_sp=500, speed_sp=500)
+ motor1.run_forever(speed_sp=400)
+ motor2.run_forever(speed_sp=400)
elif recieved == 'b':
stop()
- motor1.run_timed(time_sp=500, speed_sp=-500)
- motor2.run_timed(time_sp=500, speed_sp=-500)
+ motor1.run_forever(speed_sp=-400)
+ motor2.run_forever(speed_sp=-400)
+ elif recieved == 'l':
+ motor1.run_forever(speed_sp=400)
+ elif recieved == 'r':
+ motor2.run_forever(speed_sp=400)
except BrokenPipeError:
print("[INFO]: Client disconnected")
@@ -93,4 +97,4 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
break
except KeyboardInterrupt:
stop()
- s.close()
+ s.close()
\ No newline at end of file
diff --git a/master_app/src/main/java/me/yigitcolakoglu/master_app/cameraForm.form b/master_app/src/main/java/me/yigitcolakoglu/master_app/cameraForm.form
index b9b588c..fcb8a96 100644
--- a/master_app/src/main/java/me/yigitcolakoglu/master_app/cameraForm.form
+++ b/master_app/src/main/java/me/yigitcolakoglu/master_app/cameraForm.form
@@ -364,9 +364,9 @@
-
+
-
+
@@ -404,12 +404,12 @@
-
+
-
+
diff --git a/master_app/src/main/java/me/yigitcolakoglu/master_app/cameraForm.java b/master_app/src/main/java/me/yigitcolakoglu/master_app/cameraForm.java
index 7232bba..b8a53f6 100644
--- a/master_app/src/main/java/me/yigitcolakoglu/master_app/cameraForm.java
+++ b/master_app/src/main/java/me/yigitcolakoglu/master_app/cameraForm.java
@@ -383,9 +383,9 @@ public class cameraForm extends javax.swing.JFrame implements ChangeListener{
.addGap(453, 453, 453))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addComponent(left_button)
- .addGap(64, 64, 64)
+ .addGap(70, 70, 70)
.addComponent(right_button)
- .addGap(398, 398, 398))))
+ .addGap(393, 393, 393))))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -415,11 +415,11 @@ public class cameraForm extends javax.swing.JFrame implements ChangeListener{
.addComponent(ai_checkbox)
.addGap(121, 121, 121)
.addComponent(forward_button)
- .addGap(10, 10, 10)
+ .addGap(4, 4, 4)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(right_button)
.addComponent(left_button))
- .addGap(7, 7, 7)
+ .addGap(13, 13, 13)
.addComponent(back_button)))
.addContainerGap(30, Short.MAX_VALUE))
);
@@ -668,77 +668,69 @@ public class cameraForm extends javax.swing.JFrame implements ChangeListener{
}//GEN-LAST:event_cam_sliderStateChanged
private void forward_buttonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_forward_buttonMousePressed
- moverThread = new Thread(() -> {
- try {
- while (true) {
- out.writeUTF("f");
- Thread.sleep(500);
- }
- } catch(Exception ex){
- System.out.println(ex.toString());
- }
- });
- moverThread.start();
+ try {
+ out.writeUTF("f");
+ } catch(Exception ex){
+ System.out.println(ex.toString());
+ }
}//GEN-LAST:event_forward_buttonMousePressed
private void forward_buttonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_forward_buttonMouseReleased
- moverThread.stop();
+ try {
+ out.writeUTF("s");
+ } catch(Exception ex){
+ System.out.println(ex.toString());
+ }
}//GEN-LAST:event_forward_buttonMouseReleased
- private void right_buttonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_right_buttonMousePressed
- moverThread = new Thread(() -> {
- try {
- while (true) {
- out.writeUTF("r");
- Thread.sleep(500);
- }
- } catch(Exception ex){
- System.out.println(ex.toString());
- }
- });
- moverThread.start();
- }//GEN-LAST:event_right_buttonMousePressed
-
- private void right_buttonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_right_buttonMouseReleased
- moverThread.stop();
- }//GEN-LAST:event_right_buttonMouseReleased
-
private void back_buttonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_back_buttonMousePressed
- moverThread = new Thread(() -> {
- try {
- while (true) {
- out.writeUTF("b");
- Thread.sleep(500);
- }
- } catch(Exception ex){
- System.out.println(ex.toString());
- }
- });
- moverThread.start();
+ try {
+ out.writeUTF("b");
+ } catch(Exception ex){
+ System.out.println(ex.toString());
+ }
}//GEN-LAST:event_back_buttonMousePressed
private void back_buttonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_back_buttonMouseReleased
- moverThread.stop();
+ try {
+ out.writeUTF("s");
+ } catch(Exception ex){
+ System.out.println(ex.toString());
+ }
}//GEN-LAST:event_back_buttonMouseReleased
private void left_buttonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_left_buttonMousePressed
- moverThread = new Thread(() -> {
- try {
- while (true) {
- out.writeUTF("l");
- Thread.sleep(500);
- }
- } catch(Exception ex){
- System.out.println(ex.toString());
- }
- });
- moverThread.start();
+ try {
+ out.writeUTF("r");
+ } catch(Exception ex){
+ System.out.println(ex.toString());
+ }
}//GEN-LAST:event_left_buttonMousePressed
private void left_buttonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_left_buttonMouseReleased
- moverThread.stop();
+ try {
+ out.writeUTF("s");
+ } catch(Exception ex){
+ System.out.println(ex.toString());
+ }
}//GEN-LAST:event_left_buttonMouseReleased
+ private void right_buttonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_right_buttonMousePressed
+ try {
+ out.writeUTF("l");
+ } catch(Exception ex){
+ System.out.println(ex.toString());
+ }
+ }//GEN-LAST:event_right_buttonMousePressed
+
+ private void right_buttonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_right_buttonMouseReleased
+ try {
+ out.writeUTF("s");
+ } catch(Exception ex){
+ System.out.println(ex.toString());
+ }
+ }//GEN-LAST:event_right_buttonMouseReleased
+
/**
* @param args the command line arguments
*/
@@ -880,7 +872,7 @@ public class cameraForm extends javax.swing.JFrame implements ChangeListener{
graph.setStroke(new BasicStroke(10));
graph.setFont(new Font("Arial Black", Font.BOLD, 20));
for (int i = 0; i < detection_scores.length(); i++) {
- if (detection_scores.getDouble(i) < 0.4) {
+ if (detection_scores.getDouble(i) < 0.3) {
continue;
}
@@ -1025,13 +1017,13 @@ public class cameraForm extends javax.swing.JFrame implements ChangeListener{
if(running!=null){
try{
server.close();
- client.close();
- running.stop();
- }catch(IOException ex){
- System.out.println("IO Exception occured");
- }catch(Exception ex){
- System.out.println(ex.toString());
- }
+ client.close();
+ running.stop();
+ }catch(IOException ex){
+ System.out.println("IO Exception occured");
+ }catch(Exception ex){
+ System.out.println(ex.toString());
+ }
}
switch (jTabbedPane1.getSelectedIndex()) {
case 0: