(config_params, env_name)
| 138 | return data |
| 139 | |
| 140 | def handle_planner(config_params, env_name): |
| 141 | gs_bridge = GSBridge(env_name) |
| 142 | tcp_server = TCPServer(port=config_params['aim_port']) |
| 143 | file_path = "uav_vln_data/test" |
| 144 | image_id = 0 |
| 145 | while True: |
| 146 | print("ready connet") |
| 147 | conn = tcp_server.accept_connection() |
| 148 | print("Connection established!") |
| 149 | while True: |
| 150 | data = tcp_server.receive_pose(conn) |
| 151 | if not data: |
| 152 | break |
| 153 | if "path:" in data: |
| 154 | file_path = data.split("path:")[1] |
| 155 | image_id = 0 |
| 156 | print("file_path:", file_path) |
| 157 | continue |
| 158 | pose = list(map(float, data.split(','))) |
| 159 | if len(pose) != 6: |
| 160 | print("Invalid pose data!") |
| 161 | continue |
| 162 | print(f"Received pose: {pose}") |
| 163 | gs_bridge.set_camera_pose(*pose, file_path) |
| 164 | time.sleep(0.1) |
| 165 | image_id += 1 |
| 166 | print("Image saved!") |
| 167 | |
| 168 | def load_config(config_file="config.yaml"): |
| 169 | with open(config_file, 'r') as f: |
nothing calls this directly
no test coverage detected