This commit is contained in:
Ronaldson Bellande 2024-03-29 00:02:06 -04:00
parent 4f82c33a84
commit 48928dc827

View File

@ -1,18 +1,21 @@
import json
import requests
import os
import requests
def main():
# Read configuration from config.json
with open('config.json', 'r') as config_file:
config = json.load(config_file)
url = config['url']
endpoint_path = config['endpoint_path']
# Get the parameters from the launch file
x1 = float(os.getenv('x1'))
y1 = float(os.getenv('y1'))
x2 = float(os.getenv('x2')) # Read x2 from launch file
y2 = float(os.getenv('y2')) # Read y2 from launch file
x2 = float(os.getenv('x2'))
y2 = float(os.getenv('y2'))
limit = int(os.getenv('limit'))
# URL and endpoint path
url = "https://bellanderoboticssensorsresearchinnovationcenter-kot42qxp.b4a.run"
endpoint_path = "/api/Bellande_Step/bellande_step_2d"
# JSON payload
payload = {
"node0": {"x": x1, "y": y1},
@ -37,3 +40,6 @@ try:
print("Next Step:", data['next_step'])
except requests.exceptions.RequestException as e:
print("Error:", e)
if __name__ == '__main__':
main()