Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Drone Based GCS #76

Closed
wants to merge 55 commits into from
Closed

Drone Based GCS #76

wants to merge 55 commits into from

Conversation

ntlhui
Copy link
Contributor

@ntlhui ntlhui commented Jul 28, 2023

Working drone-based GCS support

RctGcs/rctGCS.py Outdated Show resolved Hide resolved
RctGcs/config.py Outdated Show resolved Hide resolved
RctGcs/ui/display.py Outdated Show resolved Hide resolved
@hgrehm
Copy link
Contributor

hgrehm commented Jul 28, 2023

Having difficulties testing this with the simulator. Here's the traceback from my most recent attempt, which failed as I tried to connect the GCS to the sim:

2023-56-28 14:07:51.541: ERROR:rctComms.mavComms: Exception during callback
Traceback (most recent call last):
  File "C:\Users\hgreh\miniconda3\envs\rctGCS\lib\site-packages\RCTComms\comms.py", line 1222, in execute_cb
    cb_(**kwargs)
  File "C:\Users\hgreh\workspace\radio_collar_tracker_gcs\RctGcs\droneSimulator.py", line 562, in __do_get_options
    packet = RCTComms.comms.rctOptionsPacket(scope, **self.PP_options)
TypeError: keywords must be strings
{<Options.DSP_PING_WIDTH: 'DSP_ping_width'>: 27.0, <Options.DSP_PING_SNR: 'DSP_ping_snr'>: 0.1, <Options.DSP_PING_MAX: }

Curious if you're seeing this too? I can troubleshoot on my end if it might be an issue with versions or something else local to my machine. I don't see why an Enum shouldn't be allowed as a key since it's immutable...

@ntlhui
Copy link
Contributor Author

ntlhui commented Jul 28, 2023

Fixed in 8eb8907

All options are now of type Dict[Options, Any]. You cannot keyword expand into kwargs if the keys are not str. All option packets now accept a full dict instead of kwargs.

@ntlhui ntlhui requested a review from hgrehm July 28, 2023 22:19
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ConfigDialog and ConfigDialogPage still use connection_port and connection_addr

Comment on lines 253 to 263
def add_target(self):
'''
Internal function to facilitate users adding target frequencies
'''
try:
cntr_freq = int(self.option_vars['SDR_center_freq'].text())
samp_freq = int(self.option_vars['SDR_sampling_freq'].text())
sdr_gain = float(self.option_vars['SDR_gain'].text())
cntr_freq = int(self.option_vars[Options.SDR_CENTER_FREQ].text())
samp_freq = int(self.option_vars[Options.SDR_SAMPLING_FREQ].text())
sdr_gain = float(self.option_vars[Options.SDR_GAIN].text())
except ValueError:
UserPopups.show_warning("Please enter center and sampling frequences and SDR gain settings.")
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused method

Comment on lines +180 to 195
def validate_frequency(self, value: int) -> bool:
'''
Helper function to ensure frequencies are within an appropriate
range
Args:
var: An integer value that is the frequency to be validated
'''
cntr_freq = self.__root._mav_model.getOption('SDR_center_freq')
samp_freq = self.__root._mav_model.getOption('SDR_sampling_freq')
if abs(var - cntr_freq) > samp_freq:
try:
model = MAVModel.get_model()
except NoActiveModel:
return
cntr_freq = model.getOption(Options.SDR_CENTER_FREQ)
samp_freq = model.getOption(Options.SDR_SAMPLING_FREQ)
if abs(value - cntr_freq) > samp_freq:
return False
return True
Copy link
Contributor

@hgrehm hgrehm Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused method--should these checks be performed upon add_entry (in widgets.py)?
Edit: __update_button_callback in controls.py would be a more appropriate place. Not sure what I was thinking with add_entry...

@ntlhui ntlhui closed this Dec 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants