latest pushes
Some checks failed
Docker Image CI / build_ros1 (push) Has been cancelled
Docker Image CI / build_ros2 (push) Has been cancelled
GitHub Clone Count Update Everyday / build (push) Has been cancelled

This commit is contained in:
2024-12-12 16:43:52 -05:00
parent 150f842a1d
commit 48cbbbff19
135 changed files with 629 additions and 257 deletions

View File

@@ -0,0 +1,67 @@
# Copyright (C) 2024 Bellande Robotics Sensors Research Innovation Center, Ronaldson Bellande
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import os
import sys
import subprocess
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
def ros1_launch_description():
# Get command-line arguments
args = sys.argv[1:]
# Construct the ROS 1 launch command
roslaunch_command = ["roslaunch", "web_api_bellande_ai_system", "bellande_ai_system_base.launch"] + args
# Execute the launch command
subprocess.call(roslaunch_command)
def ros2_launch_description():
# Declare launch arguments
config_file_arg = DeclareLaunchArgument(
'config_file',
default_value='$(find web_api_bellande_ai_system)/config/configs.json',
description='Path to the AI system configuration file'
)
# Create a list to hold all nodes to be launched
nodes_to_launch = []
# ROS2 specific configurations
ros_launch_arguments = [config_file_arg]
nodes_to_launch.append(Node(
package='web_api_bellande_ai_system',
executable='bellande_ai_system_base.py',
name='bellande_ai_system_base_node',
output='screen',
parameters=[
{'config_file': LaunchConfiguration('config_file')},
],
))
# Return the LaunchDescription containing all nodes and arguments
return LaunchDescription(ros_launch_arguments + nodes_to_launch)
if __name__ == "__main__":
ros_version = os.getenv("ROS_VERSION")
if ros_version == "1":
ros1_launch_description()
elif ros_version == "2":
ros2_launch_description()
else:
print("Unsupported ROS version. Please set the ROS_VERSION environment variable to '1' for ROS 1 or '2' for ROS 2.")
sys.exit(1)

View File

@@ -0,0 +1,67 @@
# Copyright (C) 2024 Bellande Robotics Sensors Research Innovation Center, Ronaldson Bellande
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import os
import sys
import subprocess
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
def ros1_launch_description():
# Get command-line arguments
args = sys.argv[1:]
# Construct the ROS 1 launch command
roslaunch_command = ["roslaunch", "web_api_bellande_ai_system", "bellande_ai_system_command.launch"] + args
# Execute the launch command
subprocess.call(roslaunch_command)
def ros2_launch_description():
# Declare launch arguments
config_file_arg = DeclareLaunchArgument(
'config_file',
default_value='$(find web_api_bellande_ai_system)/config/configs.json',
description='Path to the AI system configuration file'
)
# Create a list to hold all nodes to be launched
nodes_to_launch = []
# ROS2 specific configurations
ros_launch_arguments = [config_file_arg]
nodes_to_launch.append(Node(
package='web_api_bellande_ai_system',
executable='bellande_ai_system_command.py',
name='bellande_ai_system_command_node',
output='screen',
parameters=[
{'config_file': LaunchConfiguration('config_file')},
],
))
# Return the LaunchDescription containing all nodes and arguments
return LaunchDescription(ros_launch_arguments + nodes_to_launch)
if __name__ == "__main__":
ros_version = os.getenv("ROS_VERSION")
if ros_version == "1":
ros1_launch_description()
elif ros_version == "2":
ros2_launch_description()
else:
print("Unsupported ROS version. Please set the ROS_VERSION environment variable to '1' for ROS 1 or '2' for ROS 2.")
sys.exit(1)

View File

@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<!--
Copyright (C) 2024 Bellande Robotics Sensors Research Innovation Center, Ronaldson Bellande
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<?xml version="1.0"?>
<launch>
<!-- Load configuration file -->
<arg name="config_file" default="$(find web_api_bellande_ai_system)/config/configs.json" />
<param name="ai_system_config" textfile="$(arg config_file)" />
<!-- Launch the AI System base node -->
<node name="bellande_ai_system_base_node" pkg="web_api_bellande_ai_system"
type="bellande_ai_system_base.py" output="screen">
<param name="config_file" value="$(arg config_file)" />
</node>
</launch>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<!--
Copyright (C) 2024 Bellande Robotics Sensors Research Innovation Center, Ronaldson Bellande
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<?xml version="1.0"?>
<launch>
<!-- Load configuration file -->
<arg name="config_file" default="$(find web_api_bellande_ai_system)/config/configs.json" />
<param name="ai_system_config" textfile="$(arg config_file)" />
<!-- Launch the AI System command node -->
<node name="bellande_ai_system_command_node" pkg="web_api_bellande_ai_system"
type="bellande_ai_system_command.py" output="screen">
<param name="config_file" value="$(arg config_file)" />
</node>
</launch>