This commit is contained in:
@@ -1040,11 +1040,11 @@ public class RobotBernina extends Panel {
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void moveParkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moveParkActionPerformed
|
||||
evalCmd("robot.move_park()");
|
||||
evalCmd("move_park()");
|
||||
}//GEN-LAST:event_moveParkActionPerformed
|
||||
|
||||
private void moveHomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moveHomeActionPerformed
|
||||
evalCmd("robot.move_home()");
|
||||
evalCmd("move_home()");
|
||||
}//GEN-LAST:event_moveHomeActionPerformed
|
||||
|
||||
private void buttonAbortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAbortActionPerformed
|
||||
@@ -1145,11 +1145,11 @@ public class RobotBernina extends Panel {
|
||||
}//GEN-LAST:event_comboCamerasActionPerformed
|
||||
|
||||
private void buttonTweakXActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonTweakXActionPerformed
|
||||
evalCmd("robot.tweak_x(" + spinnerOffsetX.getValue() + ")");
|
||||
evalCmd("tweak_x(" + spinnerOffsetX.getValue() + ")");
|
||||
}//GEN-LAST:event_buttonTweakXActionPerformed
|
||||
|
||||
private void buttonTweakX1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonTweakX1ActionPerformed
|
||||
evalCmd("robot.tweak_y(" + spinnerOffsetY.getValue() + ")");
|
||||
evalCmd("tweak_y(" + spinnerOffsetY.getValue() + ")");
|
||||
}//GEN-LAST:event_buttonTweakX1ActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
|
||||
Executable → Regular
+6
-1
@@ -3,4 +3,9 @@
|
||||
###################################################################################################
|
||||
|
||||
run("devices/RobotBernina")
|
||||
run("devices/Axis")
|
||||
run("devices/Axis")
|
||||
run ("motion/tools")
|
||||
run ("motion/move_home")
|
||||
run ("motion/move_park")
|
||||
run ("motion/tweak")
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
def move_home():
|
||||
"""
|
||||
"""
|
||||
print "move_home"
|
||||
|
||||
#Initial checks
|
||||
robot.assert_no_task()
|
||||
robot.reset_motion()
|
||||
robot.wait_ready()
|
||||
#robot.assert_cleared()
|
||||
#robot.assert_in_known_point()
|
||||
|
||||
#Enabling
|
||||
enable_motion()
|
||||
|
||||
|
||||
if not robot.is_home():
|
||||
robot.move_home()
|
||||
@@ -0,0 +1,18 @@
|
||||
def move_park():
|
||||
"""
|
||||
"""
|
||||
print "move_park"
|
||||
|
||||
#Initial checks
|
||||
robot.assert_no_task()
|
||||
robot.reset_motion()
|
||||
robot.wait_ready()
|
||||
#robot.assert_cleared()
|
||||
#robot.assert_in_known_point()
|
||||
|
||||
#Enabling
|
||||
enable_motion()
|
||||
|
||||
|
||||
if not robot.is_park():
|
||||
robot.move_park()
|
||||
@@ -0,0 +1,32 @@
|
||||
POSITION_TOLERANCE = 50
|
||||
|
||||
|
||||
def is_manual_mode():
|
||||
"""
|
||||
return if operating in local mode. TODO: should be based on IO, not on robot flag.
|
||||
"""
|
||||
return robot.working_mode == "manual"
|
||||
|
||||
def enable_motion():
|
||||
"""
|
||||
Check safety and enable arm power if in remote mode
|
||||
"""
|
||||
release_safety()
|
||||
system_check(robot_move=True)
|
||||
auto = not is_manual_mode()
|
||||
if auto:
|
||||
if not robot.state.isNormal():
|
||||
raise Exception("Cannot enable power: robot state is " + str(robot.state))
|
||||
robot.enable()
|
||||
|
||||
|
||||
def wait_end_of_move():
|
||||
robot.update()
|
||||
while (not robot.settled) or (not robot.empty) or (not robot.isReady()) :
|
||||
time.sleep(0.01)
|
||||
|
||||
def release_safety():
|
||||
pass
|
||||
|
||||
def system_check(robot_move=True):
|
||||
pass
|
||||
@@ -0,0 +1,36 @@
|
||||
def tweak_x(offset):
|
||||
"""
|
||||
"""
|
||||
print "tweak_x", offset
|
||||
|
||||
#Initial checks
|
||||
robot.assert_no_task()
|
||||
robot.reset_motion()
|
||||
robot.wait_ready()
|
||||
#robot.assert_cleared()
|
||||
#robot.assert_in_known_point()
|
||||
|
||||
#Enabling
|
||||
enable_motion()
|
||||
|
||||
robot.tweak_x(offset)
|
||||
|
||||
|
||||
|
||||
def tweak_y(offset):
|
||||
"""
|
||||
"""
|
||||
print "tweak_y", offset
|
||||
|
||||
#Initial checks
|
||||
robot.assert_no_task()
|
||||
robot.reset_motion()
|
||||
robot.wait_ready()
|
||||
#robot.assert_cleared()
|
||||
#robot.assert_in_known_point()
|
||||
|
||||
#Enabling
|
||||
enable_motion()
|
||||
|
||||
|
||||
robot.tweak_y(offset)
|
||||
Reference in New Issue
Block a user