Ejemplo n.º 1
0
def gripper_is_closed():
    gripper_status = Gripper.Gripper()
    res = Commands.read_io_signals(IO.IO(GRIPPER_ACKNOWLEDGE_SIGNAL,
                                         1)).get_response()
    logging.info('Gripper ack decimal: ' + res)
    gripper_status.set_closed_status(res)
    return gripper_status.is_gripper_closed()
Ejemplo n.º 2
0
def read_gripper_hit():
    gripper_status = Gripper.Gripper()
    gripper_status.set_closed_status(
        Commands.read_io_signals(IO.IO(GRIPPER_HIT_SIGNAL, 4)))
    return gripper_status
Ejemplo n.º 3
0
def write_gripper_open():
    io_out = IO.IO(GRIPPER_OPEN_CLOSE_SIGNAL_INPUT,
                   4)  # each signal line has 8 bits, write them all
    io_out.set_first_eight_io_contracts('00000000')  # Todo, value not decided
    return Commands.write_io_signals(io_out)
Ejemplo n.º 4
0
def read_gripper_closed_command_register():
    gripper_status = Gripper.Gripper()
    gripper_status.set_closed_status(
        Commands.read_io_signals(IO.IO(GRIPPER_OPEN_CLOSE_SIGNAL, 4)))
    return gripper_status
Ejemplo n.º 5
0
 def test_write_io_signals(self):
     io = IO.IO(4)
     res = Commands.write_io_signals(io)
     self.assertEqual(res.get_response(), '0')