我在python中连接了几个gnuradio自定义块。执行后,程序立即终止:
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
代码复制如下。我似乎无法弄清楚这里发生了什么。如果有两个不同的类自定义块,则存在相同的问题。
from gnuradio import gr, blocks, analog
import numpy as np
class Block1(gr.sync_block):
def __init__(self):
gr.sync_block.__init__(self, name="block 1", in_sig=[np.float32], out_sig=[np.float32])
def work(self, input_items, output_items):
output_items[0][:] = input_items[0]
return len(output_items[0])
class MyTopBlock(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
src = analog.sig_source_f(100000, analog.GR_COS_WAVE, 100, 1)
throttle = blocks.throttle(gr.sizeof_gr_float, 32000, True)
b1 = Block1()
b2 = Block1()
self.connect(src, throttle, b1, b2, blocks.null_sink(gr.sizeof_float))
tb = MyTopBlock()
tb.run()