Exemplo n.º 1
0
    def on_mining_move_probe_clicked__slot(self):
        message = MiningControlMessage()
        message.tilt_set_absolute = PROBE_POSITION_TILT
        message.lift_set_absolute = PROBE_POSITION_LIFT
        message.cal_factor = -1

        self.mining_control_publisher.publish(message)
Exemplo n.º 2
0
    def send_mining_home_on_back_press(self):
        message = MiningControlMessage()
        back_state = self.controller.controller_states["back_button"]

        if self.last_back_button_state == 0 and back_state == 1:
            message.motor_go_home = True
            self.mining_control_publisher.publish(message)
            self.last_back_button_state = 1
        elif self.last_back_button_state == 1 and back_state == 0:
            self.last_back_button_state = 0
Exemplo n.º 3
0
    def send_mining_commands(self):
        left_y_axis = self.controller.controller_states["left_y_axis"] if abs(
            self.controller.controller_states["left_y_axis"]
        ) > LEFT_Y_AXIS_DEADZONE else 0
        right_y_axis = self.controller.controller_states["right_y_axis"] if abs(
            self.controller.controller_states["right_y_axis"]
        ) > RIGHT_Y_AXIS_DEADZONE else 0

        message = MiningControlMessage()

        if left_y_axis:
            message.linear_set_position_absolute = (
                (left_y_axis / THUMB_STICK_MAX) * MINING_LINEAR_SCALAR)
            self.mining_control_publisher.publish(message)

        if right_y_axis:
            message.motor_set_position_absolute = (
                (right_y_axis / THUMB_STICK_MAX) * MINING_MOTOR_SCALAR)
            self.mining_control_publisher.publish(message)
Exemplo n.º 4
0
    def send_mining_commands(self):

        left_y_axis = self.controller.controller_states["left_y_axis"] if abs(
            self.controller.controller_states["left_y_axis"]) > LEFT_Y_AXIS_DEADZONE else 0
        right_y_axis = self.controller.controller_states["right_y_axis"] if abs(self.controller.controller_states[
                                                                                    "right_y_axis"]) > RIGHT_Y_AXIS_DEADZONE else 0

        if left_y_axis or right_y_axis:
            message = MiningControlMessage()

            message.lift_set_absolute = 1024
            message.tilt_set_absolute = 1024

            message.lift_set_relative = (-(left_y_axis / THUMB_STICK_MAX) * MINING_LIFT_SCALAR)
            message.tilt_set_relative = ((right_y_axis / THUMB_STICK_MAX) * MINING_TILT_SCALAR)
            message.cal_factor = -1

            self.mining_control_publisher.publish(message)
Exemplo n.º 5
0
 def on_science_container_close_clicked__slot(self):
     message = MiningControlMessage()
     message.servo2_target = CONTAINER_CLOSED
     message.servo1_target = SCOOP_DROP_POSITION
     self.mining_control_publisher.publish(message)
Exemplo n.º 6
0
 def on_science_probe_clicked__slot(self):
     message = MiningControlMessage()
     message.probe_take_reading = True
     self.mining_control_publisher.publish(message)
Exemplo n.º 7
0
 def on_science_scoop_down_clicked__slot(self):
     message = MiningControlMessage()
     message.servo1_target = SCOOP_DROP_POSITION
     self.mining_control_publisher.publish(message)
Exemplo n.º 8
0
 def on_mining_toggle_overtravel_clicked__slot(self):
     message = MiningControlMessage()
     message.overtravel = True
     self.mining_control_publisher.publish(message)
Exemplo n.º 9
0
 def on_mining_home_linear_clicked__slot(self):
     message = MiningControlMessage()
     message.motor_go_home = True
     self.mining_control_publisher.publish(message)
Exemplo n.º 10
0
 def on_mining_close_clicked__slot(self):
     message = MiningControlMessage()
     message.servo1_target = MINING_COLLECTION_CUP_CLOSED
     self.mining_control_publisher.publish(message)
Exemplo n.º 11
0
 def fourbar_position_slider__slot(self):
     message = MiningControlMessage()
     message.linear_p = self.fourbar_position_slider.value()
     self.mining_control_publisher.publish(message)