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 0000000..ef81512 Binary files /dev/null and b/ros_web_api_bellande_step/launch/__pycache__/bellande_step_api_2d_launch.cpython-38.pyc differ 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']