diff --git a/Wireless_Communication/UWB/Beacons_tag_position/realtime_location_with_serial_gui.py b/Wireless_Communication/UWB/Beacons_tag_position/realtime_location_with_serial_gui.py index c45a4ff9d546486e72ab115ead51d19d19e97165..7d974054251bb2918c925883b53c67677a7d5e21 100644 --- a/Wireless_Communication/UWB/Beacons_tag_position/realtime_location_with_serial_gui.py +++ b/Wireless_Communication/UWB/Beacons_tag_position/realtime_location_with_serial_gui.py @@ -211,10 +211,10 @@ class AnchorTagGUI: # Define lower and upper bounds based on measured distances lower_bound = [ - -max_dist / 2, # x_B lower bound - min_dist / 2, # y_B lower bound (above y_C) - -max_dist / 2, # x_C lower bound - min_dist / 4, # y_C lower bound + -max_dist, # x_B lower bound + -max_dist, # y_B lower bound (above y_C) + -max_dist, # x_C lower bound + -max_dist, # y_C lower bound min_dist / 2 # y_A lower bound ] upper_bound = [ diff --git a/ros2/src/robobin/robobin/graphs/graph.json b/ros2/src/robobin/robobin/graphs/graph.json index c94b115dd00a0ef00c2417d6583f6fbbfe2bf308..eb76836ccc3f2758184673613738002453511917 100644 --- a/ros2/src/robobin/robobin/graphs/graph.json +++ b/ros2/src/robobin/robobin/graphs/graph.json @@ -4,17 +4,17 @@ { "name": "A1", "x": 0, - "y": 651.0481397780962 + "y": 648.6316708863168 }, { "name": "A2", - "x": 1479.7478814611454, - "y": 151.04148347199438 + "x": 1468.4133842739848, + "y": 194.60015778254368 }, { "name": "A3", - "x": 685.6726454571167, - "y": 51.538313358969546 + "x": 613.1114093691383, + "y": -662.092685166558 }, { "name": "A4", @@ -23,63 +23,27 @@ }, { "name": "Node5", - "x": 331.69908639944265, - "y": 219.6884517103497 + "x": 422.68116099210135, + "y": 240.66665054606628 }, { "name": "Node6", - "x": 804.6899830688058, - "y": 253.54023292422087 + "x": 225.39109837500405, + "y": 103.58921334272708 }, { "name": "Node7", - "x": 731.3223179628816, - "y": 648.2744809152002 + "x": 833.3324669960278, + "y": 580.806573828447 }, { "name": "Node8", - "x": 1337.665266230345, - "y": 594.604557319591 - }, - { - "name": "Node9", - "x": 1296.8310843564375, - "y": 237.97240044765596 - }, - { - "name": "Node10", - "x": 1001.8600424277655, - "y": 240.102853853133 + "x": 351.6722842246809, + "y": 595.6297821466235 } ], "connections": [ [ - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - false, - false, false, false, false, @@ -97,8 +61,6 @@ false, false, false, - false, - false, false ], [ @@ -107,8 +69,6 @@ false, false, false, - true, - false, false, false, false @@ -118,9 +78,7 @@ false, false, false, - true, false, - true, false, false, false @@ -133,8 +91,6 @@ false, true, false, - true, - false, false ], [ @@ -142,8 +98,6 @@ false, false, false, - false, - false, true, false, true, @@ -155,8 +109,6 @@ false, false, false, - false, - false, true, false, true @@ -168,8 +120,6 @@ false, false, false, - false, - false, true, false ] diff --git a/ros2/src/robobin/robobin/helpers/graph_maker.py b/ros2/src/robobin/robobin/helpers/graph_maker.py index 202fc34fbdb12d8307c22f7da6bdfc946c351040..0d3647583646bdc91f34e091e840f33d0a7d1d6f 100644 --- a/ros2/src/robobin/robobin/helpers/graph_maker.py +++ b/ros2/src/robobin/robobin/helpers/graph_maker.py @@ -4,7 +4,7 @@ import os from realtime_location_cli_only import AnchorTagCLI class GraphMaker: - def __init__(self, port="COM11", testing=False): + def __init__(self, port="COM5", testing=False): self.app = AnchorTagCLI(port=port, testing=testing) self.graph = { "name": "Lab 1 Extended", @@ -15,7 +15,8 @@ class GraphMaker: def call_bpm_and_store_anchors(self): self.app.call_bpm() - for name, (x, y) in self.app.anchors.items(): + for name, (x, y, z) in self.app.anchors.items(): + # print(name, x, y) self.graph["nodes"].append({ "name": name, "x": x, @@ -73,7 +74,8 @@ class GraphMaker: print(f"Node {new_node_index+1} added at ({tag1_x:.2f}, {tag1_y:.2f}).") def save_graph(self): - directory = "/Users/paulwinpenny/Documents/GitHub/robobin/Wireless_Communication/UWB/Beacons_tag_position/output" + # directory = "/Users/paulwinpenny/Documents/GitHub/robobin/Wireless_Communication/UWB/Beacons_tag_position/output" + directory = "C:/Users/joell/OneDrive/Documents/GitHub" os.makedirs(directory, exist_ok=True) # Create the directory if it doesn't exist file_path = os.path.join(directory, "graph.json") with open(file_path, "w") as f: @@ -108,5 +110,5 @@ class GraphMaker: print("Invalid command. Try 'bpm', 'start', 'save', 'finish', or 'quit'.") if __name__ == "__main__": - graph_maker = GraphMaker(port="/dev/tty.usbmodem14101", testing=False) + graph_maker = GraphMaker(port="COM5", testing=False) graph_maker.run()