mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-30 16:59:32 +00:00
Server: Add clever_dir parameter
This commit is contained in:
@@ -5,6 +5,9 @@ config_version = float(default='1.0')
|
||||
port = integer(default=25000)
|
||||
buffer_size = integer(default=1024)
|
||||
|
||||
[CLIENT]
|
||||
clever_dir = string(default=/home/pi/catkin_ws/src/clever/clover)
|
||||
|
||||
[TABLE]
|
||||
# True -> clients are removed on disconnection
|
||||
# False -> disconnected clients indicated
|
||||
|
||||
@@ -438,7 +438,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
def request_any_file(self, client_path=None, copters=None):
|
||||
if client_path is None:
|
||||
_client_path, ok = QInputDialog.getText(self, "Enter path of file to request from client", "Source:",
|
||||
QLineEdit.Normal, "/home/pi/")
|
||||
QLineEdit.Normal, "")
|
||||
if not ok:
|
||||
return
|
||||
client_path = _client_path
|
||||
@@ -467,7 +467,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
return
|
||||
|
||||
c_path, ok = QInputDialog.getText(self, "Enter path (and name) to send on client", "Destination:",
|
||||
QLineEdit.Normal, "/home/pi/") # TODO config?
|
||||
QLineEdit.Normal, "") # TODO config?
|
||||
if not ok:
|
||||
return
|
||||
|
||||
@@ -483,7 +483,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
@pyqtSlot()
|
||||
def send_calibrations(self):
|
||||
self.send_directory_files("Select directory with calibrations", ('.yaml', ), match_id=True,
|
||||
client_path="/home/pi/catkin_ws/src/clever/clever/camera_info/",
|
||||
client_path=os.path.join(self.server.config.client_clever_dir,"camera_info/"),
|
||||
client_filename="calibration.yaml") # TODO callback to reload clever?
|
||||
|
||||
# from os.path import expanduser # TODO on client
|
||||
@@ -495,13 +495,13 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
copter.client.send_message("service_restart", kwargs={"name": "clever"})
|
||||
|
||||
self.send_files("Select aruco map configuration file", "Aruco map files (*.txt)", onefile=True,
|
||||
client_path="/home/pi/catkin_ws/src/clever/aruco_pose/map/",
|
||||
client_path=os.path.abspath(os.path.join(self.server.config.client_clever_dir,"../aruco_pose/map/")),
|
||||
client_filename="animation_map.txt", callback=callback)
|
||||
|
||||
@pyqtSlot()
|
||||
def send_launch(self):
|
||||
self.send_directory_files("Select directory with launch files", ('.launch', '.yaml'), match_id=False,
|
||||
client_path='/home/pi/catkin_ws/src/clever/clever/launch/') # TODO clever restart callback?
|
||||
client_path=os.path.join(self.server.config.client_clever_dir,"launch/")) # TODO clever restart callback?
|
||||
|
||||
@pyqtSlot()
|
||||
def send_fcu_parameters(self):
|
||||
@@ -652,7 +652,7 @@ if __name__ == "__main__":
|
||||
logging.StreamHandler(),
|
||||
msgbox_handler
|
||||
])
|
||||
|
||||
|
||||
sys.excepthook = except_hook # for debugging (exceptions traceback)
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
Reference in New Issue
Block a user