예제 #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)
예제 #2
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)