Running this, I get the error:
AttributeError: ‘module’ object has no attribute ‘stream_cmd_t’
What is this struct called after it has been swigged into Python, and
how
do I access it?
As a follow up, does anyone have any general guidelines to follow when
writing code from the C++ UHD API into Python?
I’ve checked the gr-uhd source tree examples, but they didn’t provide
the
insight needed to access the full C++ API.
Stream command is not swigged because the control of streaming is part
of gnuradio’s scheduler. So start() and stop() get automatically called
by the scheduler. For convenience this is a set_command_time() to
control stream_cmd.time_spec.
Basically, gnuradio is handling the streaming for you. Think block-based
streaming model.
So to tune two USRP N210s connected by a MIMO cable, I should set the
command time to be some time spec, and then re-tune both channels to the
same frequency, thus giving them the same phase offset?
i.e. My code is looking more like:
self.cmd_time = self.uhd_usrp_source_0.uhd.time_spec_t(.1)
self.uhd_usrp_source_0.set_command_time(self.cmd_time)
self.uhd_usrp_source_0.set_center_freq(freq, 0)
self.uhd_usrp_source_0.set_center_freq(freq, 1)
self.uhd_usrp_source_0.clear_command_time()
So to tune two USRP N210s connected by a MIMO cable, I should set the
command time to be some time spec, and then re-tune both channels to the
same frequency, thus giving them the same phase offset?
i.e. My code is looking more like:
make sure you you tell the board to get its reference of clock and time
source from the mimo cable
There’s already a “get_time_now” method swigged in the
gr_uhd_usrp_{source,sink} block, along with a “get_time_last_pps” method
if you need to synchronize to an absolute time.
Stream command is not swigged because the control of streaming is part
of gnuradio’s scheduler. So start() and stop() get automatically called
by the scheduler. For convenience this is a set_command_time() to
control stream_cmd.time_spec.
Basically, gnuradio is handling the streaming for you. Think block-based
streaming model.
uhd::time_spec_t cmd_time = usrp->get_time_now() + uhd::time_spec_t(0.1);
usrp->set_command_time(cmd_time);
usrp->set_rx_freq(1.03e9, 0/ch0/);
usrp->set_rx_freq(1.03e9, 1/ch1/);
usrp->set_clear_time();
This part is swigged.
When I run the python file, I have an error, it says: " File
“sync_mimo_nophase_grc.py”, line 73, in init
self.cmd_time = self.uhd_usrp_source_0.uhd_time_spect_t(.1)
AttributeError: ‘usrp_source_sptr’ object has no attribute
‘uhd_time_spect_t’"
When I run the python file, I have an error, it says: " File
“sync_mimo_nophase_grc.py”, line 73, in init
self.cmd_time = self.uhd_usrp_source_0.uhd_time_spect_t(.1)
AttributeError: ‘usrp_source_sptr’ object has no attribute
‘uhd_time_spect_t’"