From 980f10232b8fb6f63f11c0069a60615b8ecadd0c Mon Sep 17 00:00:00 2001 From: RonaldsonBellande Date: Wed, 10 Apr 2024 02:34:46 -0400 Subject: [PATCH] testing --- ros_web_api_bellande_step/CMakeLists.txt | 3 -- ...bellande_step_api_2d_launch.cpython-38.pyc | Bin 0 -> 983 bytes ros_web_api_bellande_step/script/build.sh | 29 ++++++++++++++++++ .../src/bellande_step_api_2d.py | 3 +- 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 ros_web_api_bellande_step/launch/__pycache__/bellande_step_api_2d_launch.cpython-38.pyc diff --git a/ros_web_api_bellande_step/CMakeLists.txt b/ros_web_api_bellande_step/CMakeLists.txt index 3dc542f..dc8e20c 100644 --- a/ros_web_api_bellande_step/CMakeLists.txt +++ b/ros_web_api_bellande_step/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.8) project(ros_web_api_bellande_step) -## Compile as C++11, supported in ROS Kinetic and newer -add_compile_options(-std=c++11) - # Find ROS if($ENV{ROS_VERSION} EQUAL 1) find_package(catkin REQUIRED COMPONENTS diff --git a/ros_web_api_bellande_step/launch/__pycache__/bellande_step_api_2d_launch.cpython-38.pyc b/ros_web_api_bellande_step/launch/__pycache__/bellande_step_api_2d_launch.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ef815129811d5fb996506d5e714a5c0680ca4cb4 GIT binary patch literal 983 zcmZuvy>Hbp5VsvW$!q)C(o(7liTy1V?^P_QRG@Z5T@Z_x$S-z7g!7@;DX&#Jm9+~q z1Bi)#$tx58LJ@+?$CFyAwtTW8#&;+|jZ$+KQA5N5stF*Lf zk%N(*7E%H3oTylfO7%W(s-(_TZsB6Pw;UJwS(?<9Xy3(c#N`TrY{NN*W4?m0kgX)r zyCGLCrvt~pA+OF(fCmHjfQNF_*=d5VSc4kekj86h!mj*=eZ!W>6}c+cG#42>ENWZU){VsQ zd(4DY6guvFQI;x~l?O@%Vm9bKj=CZ{(?*+|iEI(+Zcg|P zlsz4k)}xyU^AlA&5c~Gog9Y|ap#kn`qH+b}qLvXL_;T)i2w;vtAhL#s?NLh5u>Vod z$E4o`5P^38+>$@xX0;0uPA4Ph_n+;G=3BiILH7G1ZpYPhec|gva!X^|IsSMsntE<* hYU|#=YhfF`tM!g}0yY;OW`(S^I>Mlt5X4Xe`47W;2(JJD literal 0 HcmV?d00001 diff --git a/ros_web_api_bellande_step/script/build.sh b/ros_web_api_bellande_step/script/build.sh index e69de29..78e4cf0 100644 --- a/ros_web_api_bellande_step/script/build.sh +++ b/ros_web_api_bellande_step/script/build.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Create and navigate to build directory +mkdir -p build && cd build + +# Build package +if [ $ROS_VERSION -eq 1 ]; then + cmake -DROS_VERSION=1 .. + make -j$(nproc) +else + cmake -DROS_VERSION=2 .. + make -j$(nproc) +fi + +# Source package setup file +source devel/setup.bash + +# Run rosdep +rosdep install --from-paths ../src --ignore-src -y + +# Return to package root directory +cd .. + +# Run ROS launch file +if [ $ROS_VERSION -eq 1 ]; then + roslaunch ros_web_api_bellande_step bellande_step_api_2d_launch.launch.py x1:=0 y1:=0 x2:=5 y2:=5 limit:=3 +else + ros2 launch ros_web_api_bellande_step bellande_step_api_2d_launch.launch.py x1:=0 y1:=0 x2:=5 y2:=5 limit:=3 +fi diff --git a/ros_web_api_bellande_step/src/bellande_step_api_2d.py b/ros_web_api_bellande_step/src/bellande_step_api_2d.py index d837d4a..a133866 100644 --- a/ros_web_api_bellande_step/src/bellande_step_api_2d.py +++ b/ros_web_api_bellande_step/src/bellande_step_api_2d.py @@ -1,10 +1,11 @@ import json import os import requests +import sys def main(): # Read configuration from config.json - with open('config.json', 'r') as config_file: + with open(os.path.join(sys.path[0], 'config.json'), 'r') as config_file: config = json.load(config_file) url = config['url'] endpoint_path = config['endpoint_path']