guruofquality / grextras Goto Github PK
View Code? Open in Web Editor NEWAdvanced GNU Radio Blocks
Home Page: https://github.com/guruofquality/grextras/wiki
Advanced GNU Radio Blocks
Home Page: https://github.com/guruofquality/grextras/wiki
When autoconsume is disabled even the basic example given in the wiki throws an exception. I've narrowed it down as much as possible, the following block:
from gnuradio import gr
from gnuradio.extras import block_gateway
import numpy
class my_basic_pass_block(gr.block):
def init(self):
gr.block.init(self, name="my_basic_pass_block", in_sig=[numpy.float32], out_sig=[numpy.float32])
self.set_auto_consume(False)
def forecast(self, noutput_items, ninput_items_required):
ninput_items_required[0] = noutput_items
def work(self, input_items, output_items):
in0 = input_items[0]
out = output_items[0]
out[:] = in0
self.consume(0, len(in0))
return len(out)
Crashes with this message:
handler caught exception: operands could not be broadcast together with shapes (8192) (16383)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gnuradio/extras/block_gateway.py", line 53, in eval
try: self._callback()
File "/usr/local/lib/python2.7/dist-packages/gnuradio/extras/block_gateway.py", line 124, in __gr_block_handle
) for i in self.__out_indexes],
File "/home/user/mygnuradioblocks/my_basic_pass_block.py", line 18, in work
out[:] = in0
ValueError: operands could not be broadcast together with shapes (8192) (16383)
thread[thread-per-block[1]: <gr_block my_basic_pass_block (9)>]: caught unrecognized exception
But when commenting out the self.consume and self.set_auto_consume lines it works as expected.
The python functions inserted into gras::Block in block.i dont make it over into the share_ptr for some reason -- and we just manually copied them.
same idea as PMT manager:
(except this wont be a hack)
Yea yea, python is already JIT-tastic. This is really a convenience block to take a python source and to just be a GRC block. This saves the user time making xml blocks.
for users to experiment w/ feedback
with JIT so user can just add the code source at runtime
Currently we execute the clang binary to get llvm bitcode. It should be possible to use the clang api to directly compile code and get an llvm Module. Some work here: https://github.com/guruofquality/grextras/tree/use_clang_api
However, ubuntu 12.10 has a clangdev missing important libraries. 13.04 has the working dev package. So users dont have to manually install clang-dev from source... we dont want to force the api usage option.
So when I get around to upgrading my ubuntu -- do an ifdef to support both executing and API.
This block would take several time-tagged async inputs and use the tags to produce sample aligned outputs. This could align multiple usrp source blocks, and keep alignment in the face of packet overflows/dropouts. This block would be zero copy, implemented as a passive workflow block.
On the wiki, for the "Stream selector" block, the image is a broken link.
since we are using the c++ opencl api -- not sure
This breaks the python interface for the add/mult_const_v constructors.
Or it would be nice to use std::vectorstd::complex for all of them...
In any case, using std::complex isnt really heard of much.
-josh
tjt7a@bt:~/src/grextras/build$ ctest
Test project /home/tjt7a/src/grextras/build
Start 1: qa_add_and_friends
1/9 Test #1: qa_add_and_friends ..............._Failed 0.23 sec
Start 2: qa_block_gateway
2/9 Test #2: qa_block_gateway ................. Passed 0.24 sec
Start 3: qa_delay
3/9 Test #3: qa_delay ......................... Passed 0.19 sec
Start 4: qa_noise_source
4/9 Test #4: qa_noise_source .................._Failed 0.20 sec
Start 5: qa_signal_source
5/9 Test #5: qa_signal_source ................. Passed 0.20 sec
Start 6: qa_pmt
6/9 Test #6: qa_pmt ..........................._Failed 0.20 sec
Start 7: qa_msg_passing
7/9 Test #7: qa_msg_passing ..................._Failed 0.83 sec
Start 8: qa_pmt_to_python
8/9 Test #8: qa_pmt_to_python ................. Passed 0.20 sec
Start 9: qa_pmt_rpc
9/9 Test #9: qa_pmt_rpc ....................... Passed 2.21 sec
56% tests passed, 4 tests failed out of 9
Total Test time (real) = 4.51 sec
The following tests FAILED:
1 - qa_add_and_friends (Failed)
4 - qa_noise_source (Failed)
6 - qa_pmt (Failed)
7 - qa_msg_passing (Failed)
Errors while running CTest
tjt7a@bt:~/src/grextras/build$ ctest -VV -R qa_msg
UpdateCTestConfiguration from :/home/tjt7a/src/grextras/build/DartConfiguration.tcl
UpdateCTestConfiguration from :/home/tjt7a/src/grextras/build/DartConfiguration.tcl
Test project /home/tjt7a/src/grextras/build
Constructing a list of tests
Done constructing a list of tests
Checking test dependency graph...
test 7
Start 7: qa_msg_passing
7: Test command: /bin/sh /home/tjt7a/src/grextras/build/python/qa_msg_passing_test.sh
7: Test timeout computed to be: 9.99988e+06
7: linux; GNU C++ version 4.4.3; Boost_104000; UHD_003.005.001-release
7:
7: EEE
7: ======================================================================
7: ERROR: test_disconnect (main.test_msg_passing)
7: ----------------------------------------------------------------------
7: Traceback (most recent call last):
7: File "/home/tjt7a/src/grextras/python/qa_msg_passing.py", line 133, in test_disconnect
7: self.assertItemsEqual(sink.msgs(), msgs)
7: AttributeError: 'test_msg_passing' object has no attribute 'assertItemsEqual'
7:
7: ======================================================================
7: ERROR: test_hier (main.test_msg_passing)
7: ----------------------------------------------------------------------
7: Traceback (most recent call last):
7: File "/home/tjt7a/src/grextras/python/qa_msg_passing.py", line 103, in test_hier
7: self.assertItemsEqual(sink.msgs(), msgs)
7: AttributeError: 'test_msg_passing' object has no attribute 'assertItemsEqual'
7:
7: ======================================================================
7: ERROR: test_top (main.test_msg_passing)
7: ----------------------------------------------------------------------
7: Traceback (most recent call last):
7: File "/home/tjt7a/src/grextras/python/qa_msg_passing.py", line 84, in test_top
7: self.assertItemsEqual(sink.msgs(), msgs)
7: AttributeError: 'test_msg_passing' object has no attribute 'assertItemsEqual'
7:
7: ----------------------------------------------------------------------
7: Ran 3 tests in 0.314s
7:
7: FAILED (errors=3)
1/1 Test #7: qa_msg_passing ...................***Failed 0.84 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) = 0.84 sec
The following tests FAILED:
7 - qa_msg_passing (Failed)
Errors while running CTest
One of the things missing when we did precog was a programmatic way to access properties on the USRP. We sort of hacked around it with the PMT server calling into python functions in the top block -- its was a real kludge around and the code was a mess.
The properties interface in GRAS should make this seamless:
https://github.com/guruofquality/gras/wiki/Properties
What we need to do:
Given that, any block in the flow graph can access the USRP properties in a very clean and programmatic way; in c++ or python. Look how simple it can be:
https://github.com/guruofquality/gras/wiki/Codeguide#wiki-property-access
The C++ API was fun but it has build problems across versions, specifically with opnecl 1.2. The C API should be way less hassle.
the idea is to reduce breakage when updating and to minimize the changes needed in gr mainline
look for both types of devices, pick first one found
Hello gruel is no longer available since gnuradio 3.7 this causes cmake to fail on:
coudl not find module GRUEL
see also: online reference to problem
gr-extras doesn't work with gnu-radio 3.7: gruel and core are replaced by runtime as mentionned on this page (it may be helpful):
http://gnuradio.org/redmine/projects/gnuradio/wiki/Move_3-6_to_3-7
thanks
Take an input stream with tags, msgs, items and serialize it. This produces an output stream of type PacketMsg. The packet msg can be sent over TCP or even stored in a file.
Then vice-versa.
Would be nice to have initialization args or kwargs. Probably a PMCList and Dict. Also add this to the GRC XML wrapper.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.