discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Importing newly created C++ block


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] Importing newly created C++ block
Date: Wed, 27 Feb 2013 11:14:38 -0500

On Wed, Feb 27, 2013 at 10:42 AM, Brooke Hayden <address@hidden> wrote:
> Hi all,
>
> We created a new module called radar(gr-radar folder created) and a block
> called lfm_source_c. Eventually, this new block will create a chirp style
> signal. We are trying to use in a Python file. The Python code was working
> perfectly fine when we used the gr signal source to generate a square wave.
> The wave transmitted to a scope sink and to our USRP N210.
>
> We successfully installed the new module with "make install".
>
> We added an "import radar" statement at the beginning of the file which in
> and of itself didn't cause any errors. We got a whole list of errors when we
> tried to use the source in python.
> src = radar.lfm_source_c (wave_freq,
>                                pulse_width,
>                                pulse_rep_int,
>                                sample_rate,
>                                2.0,
>                                0)
>
>
> gr-radar is in our home path, but not the GNU Radio path (which I think is
> correct). Can anyone give us any insight into this problem? This is the
> first block we've created so don't have any experience with this. I will
> also include our error list below.
>
> Thanks for any help you can give! Below is the terminal output:
>
> Traceback (most recent call last):
>   File "chirp_test_gui.py", line 82, in <module>
>     main ()
>   File "chirp_test_gui.py", line 78, in main
>     app = stdgui2.stdapp(tx_sink, "Transmitted Signal", nstatus=1)
>   File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py",
> line 38, in __init__
>     wx.App.__init__ (self, redirect=False)
>   File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py",
> line 7981, in __init__
>     self._BootstrapApp()
>   File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py",
> line 7555, in _BootstrapApp
>     return _core_.PyApp__BootstrapApp(*args, **kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py",
> line 42, in OnInit
>     self._max_noutput_items)
>   File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py",
> line 64, in __init__
>     self.panel = stdpanel (self, self, top_block_maker, max_nouts)
>   File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py",
> line 86, in __init__
>     self.top_block = top_block_maker (frame, self, vbox, sys.argv)
>   File "chirp_test_gui.py", line 69, in __init__
>     sig0 =
> tx_test(options.freq,options.pulse_width,options.pulse_rep_int,options.samp_rate)
>   File "chirp_test_gui.py", line 26, in __init__
>     0)              # DC Offset
>   File "/usr/local/lib/python2.7/dist-packages/radar/radar_swig.py", line
> 319, in __init__
>     def __init__(self, *args, **kwargs): raise AttributeError("No
> constructor defined")
> AttributeError: No constructor defined


Brooke,

How did you create the block? Was it using gr_modtool or did you roll
it yourself from scratch? It looks like something in the SWIG
interface is probably wrong. Do you have a separate interface (.i)
file for this block or are you just including the header file in a
"radar_swig.i" file? (The latter is the preferred way.)

So make sure you have a make function and that the block is properly
included in a SWIG interface file.

Tom



reply via email to

[Prev in Thread] Current Thread [Next in Thread]