mirror of
https://github.com/OSURoboticsClub/Rover_2017_2018.git
synced 2025-11-08 18:21:15 +00:00
Merge branch 'master' of https://github.com/OSURoboticsClub/Rover_2017_2018
This commit is contained in:
@@ -29,8 +29,8 @@ class RoverMapCoordinator(QtCore.QThread):
|
||||
self.shared_objects = shared_objects
|
||||
self.left_screen = self.shared_objects["screens"]["left_screen"]
|
||||
self.mapping_label = self.left_screen.mapping_label
|
||||
self.navigation_label = self.left_screen.tableWidget
|
||||
self.landmark_label = self.left_screen.tableWidget_2
|
||||
self.navigation_label = self.left_screen.navigation_waypoints_table_widget
|
||||
self.landmark_label = self.left_screen.landmark_waypoints_table_widget
|
||||
|
||||
self.setings = QtCore.QSettings()
|
||||
|
||||
|
||||
@@ -1,12 +1,74 @@
|
||||
from PyQt5 import QtCore, QtWidgets, QtGui
|
||||
|
||||
import logging
|
||||
|
||||
import rospy
|
||||
|
||||
|
||||
class WaypointsCoordinator(QtCore.QThread):
|
||||
new_manual_waypoint_entry = QtCore.pyqtSignal(str, str, str, int)
|
||||
update_waypoint_entry = QtCore.pyqtSignal(str, str, int)
|
||||
|
||||
def __init__(self, shared_objects):
|
||||
super(WaypointsCoordinator, self).init()
|
||||
self.run_thread_flag = True
|
||||
|
||||
self.shared_objects = shared_objects
|
||||
self.left_screen = self.shared_objects["screens"]["left_screen"]
|
||||
|
||||
self.navigation_label = (self.left_screen.
|
||||
navigation_waypoints_table_widget)
|
||||
self.landmark_label = self.left_screen.landmark_waypoints_table_widget
|
||||
|
||||
self.name_edit_label = (self.left_screen.
|
||||
manual_waypoint_landmark_name_line_edit)
|
||||
self.latitude_label = (self.left_screen.
|
||||
manual_waypoint_decimal_lattitude_spin_box)
|
||||
self.longitude_label = (self.left_screen.
|
||||
manual_waypoint_decimal_longitude_spin_box)
|
||||
|
||||
self.settings = QtCore.QSettings()
|
||||
|
||||
self.logger = logging.getLogger("groundstation")
|
||||
|
||||
def run(self):
|
||||
while self.run_thread_flag:
|
||||
self.msleep(3)
|
||||
|
||||
def connect_signals_and_slots(self):
|
||||
self.
|
||||
self.new_manual_waypoint_entry.connect(self.update_manual_entry)
|
||||
|
||||
# setting up signals to save for Navigation Table
|
||||
# self.
|
||||
|
||||
self.navigation_label.cellClicked.connect(self._on_nav_clicked)
|
||||
self.landmark_label.cellClicked.connect(self._on_land_clicked)
|
||||
|
||||
def setup_signals(self, start_signal,
|
||||
signals_and_slots_signal, kill_signal):
|
||||
start_signal.connect(self.start)
|
||||
signals_and_slots_signal.connect(self.connect_signals_and_slots)
|
||||
kill_signal.connect(self.on_kill_threads_requested_slot)
|
||||
|
||||
def on_kill_threads_requested__slot(self):
|
||||
self.run_thread_flag = False
|
||||
|
||||
def update_manual_entry(self, name, lat, lng, table):
|
||||
self.name_edit_label.readOnly(table % 2)
|
||||
self.name_edit_label.setText(name)
|
||||
self.latitude_label.setText(lat)
|
||||
self.longitude_label.set(lng)
|
||||
|
||||
def _on_nav_clicked(self, row, col):
|
||||
self.update_waypoint_entry.emit(
|
||||
self.navigation_label.item(row, 0),
|
||||
self.navigation_label.item(row, 1),
|
||||
self.navigation_label.item(row, 2),
|
||||
0
|
||||
)
|
||||
|
||||
def _on_land_clicked(self, row, col):
|
||||
self.update_waypoint_entry.emit(
|
||||
self.landmark_label.item(row, 0),
|
||||
self.landmark_label.item(row, 1),
|
||||
self.landmark_label.item(row, 2),
|
||||
1
|
||||
)
|
||||
|
||||
@@ -17,6 +17,7 @@ import Framework.VideoSystems.RoverVideoCoordinator as RoverVideoCoordinator
|
||||
import Framework.MapSystems.RoverMapCoordinator as RoverMapCoordinator
|
||||
import Framework.JoystickControlSystems.JoystickControlSender as JoystickControlSender
|
||||
import Framework.NavigationSystems.SpeedAndHeadingIndication as SpeedAndHeading
|
||||
import Framework.NavigationSystems.WaypointsCoordinator as WaypointsCoordinator
|
||||
import Framework.ArmSystems.ArmIndication as ArmIndication
|
||||
import Framework.StatusSystems.StatusCore as StatusCore
|
||||
import Framework.SettingsSystems.UbiquitiRadioSettings as UbiquitiRadioSettings
|
||||
@@ -107,6 +108,7 @@ class GroundStation(QtCore.QObject):
|
||||
self.__add_thread("Arm Indication", ArmIndication.ArmIndication(self.shared_objects))
|
||||
self.__add_thread("Rover Status", StatusCore.SensorCore(self.shared_objects))
|
||||
self.__add_thread("Ubiquiti Radio Settings", UbiquitiRadioSettings.UbiquitiRadioSettings(self.shared_objects))
|
||||
self.__add_thread("Waypoints Coordinator", WaypointsCoordinator.WaypointsCoordinator(self.shared_objects))
|
||||
|
||||
self.connect_signals_and_slots_signal.emit()
|
||||
self.__connect_signals_to_slots()
|
||||
|
||||
Reference in New Issue
Block a user