MCPcopy Create free account
hub / github.com/SHAILAB-IPEC/OpenFly-Platform / handle_planner

Function handle_planner

scripts/sim/gs_bridge.py:140–166  ·  view source on GitHub ↗
(config_params, env_name)

Source from the content-addressed store, hash-verified

138 return data
139
140def 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
168def load_config(config_file="config.yaml"):
169 with open(config_file, 'r') as f:

Callers

nothing calls this directly

Calls 5

accept_connectionMethod · 0.95
receive_poseMethod · 0.95
set_camera_poseMethod · 0.95
GSBridgeClass · 0.70
TCPServerClass · 0.70

Tested by

no test coverage detected