From aa1dc65377b4a2c142e783685cee157ae622ab16 Mon Sep 17 00:00:00 2001 From: Ishaan Datta Date: Sat, 30 Nov 2024 19:23:52 -0800 Subject: [PATCH] change display path, delete old launch files --- ros2_ws/src/python_workspace/launch/README.md | 1 - .../src/python_workspace/launch/debugging.py | 54 -------------- ros2_ws/src/python_workspace/launch/launch.py | 73 ------------------- .../python_workspace/scripts/display.py | 2 +- 4 files changed, 1 insertion(+), 129 deletions(-) delete mode 100644 ros2_ws/src/python_workspace/launch/README.md delete mode 100644 ros2_ws/src/python_workspace/launch/debugging.py delete mode 100644 ros2_ws/src/python_workspace/launch/launch.py diff --git a/ros2_ws/src/python_workspace/launch/README.md b/ros2_ws/src/python_workspace/launch/README.md deleted file mode 100644 index cbf2098..0000000 --- a/ros2_ws/src/python_workspace/launch/README.md +++ /dev/null @@ -1 +0,0 @@ -ros2 launch launch.py use_display_node:=True \ No newline at end of file diff --git a/ros2_ws/src/python_workspace/launch/debugging.py b/ros2_ws/src/python_workspace/launch/debugging.py deleted file mode 100644 index a248a58..0000000 --- a/ros2_ws/src/python_workspace/launch/debugging.py +++ /dev/null @@ -1,54 +0,0 @@ -from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument -from launch_ros.actions import Node -from launch.substitutions import LaunchConfiguration - -def generate_launch_description(): - return LaunchDescription([ - DeclareLaunchArgument('static_image_path', default_value='/home/user/ROS/assets/maize/IMG_1822_14.JPG',description='The path to the static image for CameraNode'), - DeclareLaunchArgument('loop', default_value='-1', description='0 = do not loop, >0 = # of loops, -1 = loop forever'), - DeclareLaunchArgument('frame_rate', default_value='30', description='Frame rate for CameraNode publishing'), - DeclareLaunchArgument('precision', default_value='fp32', description='Precision for the inference data input'), - DeclareLaunchArgument('weights_path', default_value='/home/user/ROS/models/maize/Maize.onnx', description='Path to the model weights file (must be absolute!)'), - DeclareLaunchArgument('camera_side', default_value='left', description='Side of the Zed Camera for inference'), - DeclareLaunchArgument('use_display_node', default_value='False', description='Toggle for using the display'), - - # Picture Node - Node( - package='python_workspace', - executable='picture_node', - name='picture_node', - parameters=[ - {'static_image_path': LaunchConfiguration('static_image_path')}, - {'loop': LaunchConfiguration('loop')}, - {'frame_rate': LaunchConfiguration('frame_rate')}, - ], - output='screen' - ), - - # Inference Node - Node( - package='python_workspace', - executable='inference_node', - name='inference_node', - parameters=[ - {'weights_path': LaunchConfiguration('weights_path')}, - {'precision': LaunchConfiguration('precision')}, - {'camera_side': LaunchConfiguration('camera_side')} - ], - output='screen' - ), - - # Extermination Node - Node( - package='python_workspace', - executable='extermination_node', - name='extermination_node', - parameters=[ - {'use_display_node': LaunchConfiguration('use_display_node')}, - {'camera_side': LaunchConfiguration('camera_side')} - ], - output='screen' - ), - - ]) \ No newline at end of file diff --git a/ros2_ws/src/python_workspace/launch/launch.py b/ros2_ws/src/python_workspace/launch/launch.py deleted file mode 100644 index 1cc5c94..0000000 --- a/ros2_ws/src/python_workspace/launch/launch.py +++ /dev/null @@ -1,73 +0,0 @@ -from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument -from launch.substitutions import LaunchConfiguration -from launch_ros.actions import Node - -def generate_launch_description(): - # Declare launch arguments to allow for parameter substitution - return LaunchDescription([ - # Camera Node arguments - DeclareLaunchArgument('camera_side', default_value='left', description='Choose left or right camera'), - DeclareLaunchArgument('shift_constant', default_value='0', description='Shift value for ROI'), - DeclareLaunchArgument('roi_dimensions', default_value='[0, 0, 100, 100]', description='ROI dimensions as [x1, y1, x2, y2]'), - - # Proxy Node argument - DeclareLaunchArgument('usb_port', default_value='/dev/ttyACM0', description='USB port for the serial connection'), - - # Inference Node arguments - DeclareLaunchArgument('weights_path', default_value='/home/user/ROS/models/maize/Maize.onnx', description='Path to the weights file'), - DeclareLaunchArgument('precision', default_value='fp32', description='Precision for the inference model (e.g., fp32, fp16)'), - - # Extermination Node arguments - DeclareLaunchArgument('use_display_node', default_value='True', description='Enable display node for visualization'), - DeclareLaunchArgument('camera_side_exterm', default_value='left', description='Camera side for extermination node (left or right)'), - - # Camera Node - Node( - package='python_workspace', - executable='camera_node', - name='camera_node', - parameters=[ - {'camera_side': LaunchConfiguration('camera_side')}, - {'shift_constant': LaunchConfiguration('shift_constant')}, - {'roi_dimensions': LaunchConfiguration('roi_dimensions')} - ], - output='screen' - ), - - # Proxy Node - Node( - package='python_workspace', - executable='proxy_node', - name='proxy_node', - parameters=[ - {'usb_port': LaunchConfiguration('usb_port')} - ], - output='screen' - ), - - # Inference Node - Node( - package='python_workspace', - executable='inference_node', - name='inference_node', - parameters=[ - {'weights_path': LaunchConfiguration('weights_path')}, - {'precision': LaunchConfiguration('precision')}, - {'camera_side': LaunchConfiguration('camera_side')} - ], - output='screen' - ), - - # Extermination Node - Node( - package='python_workspace', - executable='extermination_node', - name='extermination_node', - parameters=[ - {'use_display_node': LaunchConfiguration('use_display_node')}, - {'camera_side': LaunchConfiguration('camera_side_exterm')} - ], - output='screen' - ) - ]) \ No newline at end of file diff --git a/ros2_ws/src/python_workspace/python_workspace/scripts/display.py b/ros2_ws/src/python_workspace/python_workspace/scripts/display.py index 9c56239..5bd41a3 100644 --- a/ros2_ws/src/python_workspace/python_workspace/scripts/display.py +++ b/ros2_ws/src/python_workspace/python_workspace/scripts/display.py @@ -43,7 +43,7 @@ def main(): cls=cls, bboxes=bboxes, confs=confs, - fname="output.jpg", + fname="/home/user/Downloads/output.jpg", names=names, save=False )