kit-cel / gr-radar

GNU Radio Radar Toolbox
GNU General Public License v3.0
237 stars 83 forks source link

Simulator_fmcw.grc fails do to blacklisted variables and error in split block #62

Open MountainLogic opened 5 months ago

MountainLogic commented 5 months ago

When running the simulator on 3.10.7.0 (Python 3.10.12) under Ubuntu 22.04 I get the following errors in the variables

Param - ID(id): ID "min_output_buffer" is blacklisted.

ID "max_output_buffer" is blacklisted. ID "max_output_buffer" is blacklisted.


To fix this I renamed the variable to max_output_buffer to max_output_buff and also updated the ID in the Advanced section of several other blocks. The design now reports able to run. When executed I now get the following error:

`<<< Welcome to GNU Radio Companion 3.10.7.0 >>>

Block paths: /usr/share/gnuradio/grc/blocks /usr/local/share/gnuradio/grc/blocks

Loading: "/home/scott/wip/Gnu/simulator_fmcw_001.grc"

Done

Generating: '/home/scott/wip/Gnu/simulator_fmcw.py'

Warning: The block 'blocks_throttle_0' is deprecated.

Executing: /usr/bin/python3 -u /home/scott/wip/Gnu/simulator_fmcw.py

Qt GUI: Could not restore geometry: restoreGeometry(self, Union[QByteArray, bytes, bytearray]): argument 1 has unexpected type 'NoneType' static_target_simulator_cc :info: set_min_output_buffer on block 5 to 98304 Traceback (most recent call last): File "/home/scott/wip/Gnu/simulator_fmcw.py", line 323, in main() File "/home/scott/wip/Gnu/simulator_fmcw.py", line 301, in main tb = top_block_cls() File "/home/scott/wip/Gnu/simulator_fmcw.py", line 111, in init self.radar_split_cc_0_0_0 = radar.split_cc(2, (samp_cw/decim_fac,samp_up/decim_fac,samp_down/decim_fac), "packet_len") TypeError: init(): incompatible constructor arguments. The following argument types are supported:

  1. gnuradio.radar.radar_python.split_cc(packet_num: int, packet_parts: List[int], len_key: str = 'packet_len')

Invoked with: 2, (512.0, 512.0, 512.0), 'packet_len'

Done (return code 1) `

MountainLogic commented 2 months ago

The problem in the example code is that the packet packet_parts values are generated with a single slash "/" divide that results in a floating point result, e.g., "512.0". What is needed to fix this is to use a double slash "//" floored integer divide that in python produces an integer result, e.g., "512".

The fix for the example is to go into the three split blocks and in the "Packet Parts" variable and swap the single slashes with a double slash. When this is done the code runs fine. On a similar note, the disabled QT GUI Sinks need to have the FFT value changes to also use a double slash on FFT size.

There may also be an issue with the yaml for the split block as packet_parts shows being a real_vector in the gui and it should be an int_vector??

Minor note on usability of example: If you let this example run too long it may take some time for the "Print Results" to finish dumpling to the command line and return to GR-companion.