From a84ecce9b0e893e39d5809522ca8cd93139edb35 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 23 May 2024 09:18:44 +0200 Subject: [PATCH] update --- __pycache__/webcam.launch.cpython-310.pyc | Bin 1938 -> 0 bytes scripts/ps4_controller_script.sh | 7 ++ scripts/setup.sh | 16 ++++ webcam.launch.py | 88 ---------------------- 4 files changed, 23 insertions(+), 88 deletions(-) delete mode 100644 __pycache__/webcam.launch.cpython-310.pyc create mode 100755 scripts/ps4_controller_script.sh create mode 100755 scripts/setup.sh delete mode 100644 webcam.launch.py diff --git a/__pycache__/webcam.launch.cpython-310.pyc b/__pycache__/webcam.launch.cpython-310.pyc deleted file mode 100644 index 393605c515d23d0b3f90d71e7056d4e4a99a9951..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1938 zcmb_dTW{k;6t*4PNo?oV%kHwJ)UbdQ3AI%SD;^L6wG>r?Zl%3Q8+K*6o=Ix0Z<-m0 z*781;*CKuZe}KO zpWqAjI6tE-WVtX3gky`#hDjfu19)g(RTKtEK^kfx{krj5AOo2Ym_RC^7HT6)A`Os@ z9MqAh0jP_5s4tNYXn@wxxkG9a;614zrqj%7bL~W)b z7rl!%nT9s5RFJBahLkNSZ7I7_RyIO5(0k~?wK~&a&0VRxFXi@?ir)X(0(Ni(TJ*uS z@!Dc~sg!D|m5ov_jnXWeWvgtL)(qYah5Yb@JM$3X)I)e42Dq^IV6rEv{bKM;sN72B zWxgX`2+h|#P?quNwj=X6~VxMvS`P1jm3g=XCZq4=5oMk!la1x{_ zOlI7^%;)3L$h*uhM@8?E)VeoXD~$aa_Gnn(!usyvc>g1J{OSJ7!a5ebD|p@u{1_A8 zn-Unk5b^bzNTDGEKk}k5c~$fdq?IeJ+~Y%TXFe>T-V~aRE5+6+gy*u)Gk#80>2ZQrG)J+N>^;Z!JrDM z*m{Fn1Tr*u6SDjYO3W>MfrFg+XHX?w`qN(K+FBNBXb@fa-w?tOqAi3t6Nfe=W2MPG zpUilFwN)jveycSl*Jj0DOzw&pi>0m4;uPf( V{v3WC3hjb$6i0Q`KHM;B{{cxDM~DCb diff --git a/scripts/ps4_controller_script.sh b/scripts/ps4_controller_script.sh new file mode 100755 index 0000000..1767022 --- /dev/null +++ b/scripts/ps4_controller_script.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Change directory to where docker-compose.yml is located +cd /home/bjorn/git/cps_loki + +# Restart the teleop service using docker-compose +docker compose restart teleop diff --git a/scripts/setup.sh b/scripts/setup.sh new file mode 100755 index 0000000..cb6eb1a --- /dev/null +++ b/scripts/setup.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# copy script to a system directory +sudo cp ps4_controller_script.sh /etc/udev/rules.d + +# Set execute permissions for the script +sudo chmod +x /etc/udev/rules.d/ps4_controller_script.sh + +# Create or append the udev rule +echo 'ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="Wireless Controller", RUN+="/etc/udev/rules.d/ps4_controller_script.sh"' | sudo tee /etc/udev/rules.d/99-ps4-controller.rules + +# Reload udev rules +sudo udevadm control --reload-rules + +# Provide user feedback +echo "Setup completed. PS4 controller udev rule installed." \ No newline at end of file diff --git a/webcam.launch.py b/webcam.launch.py deleted file mode 100644 index 10e14c4..0000000 --- a/webcam.launch.py +++ /dev/null @@ -1,88 +0,0 @@ -from launch import LaunchDescription -from launch_ros.actions import Node -from launch.actions import DeclareLaunchArgument -from launch.substitutions import LaunchConfiguration, ThisLaunchFileDir -from launch.conditions import IfCondition, UnlessCondition -from launch.substitutions import TextSubstitution - -def generate_launch_description(): - # Declare launch arguments - video_device_arg = DeclareLaunchArgument( - 'video_device', default_value='/dev/video0', - description='Video device path') - - pixel_format_arg = DeclareLaunchArgument( - 'pixel_format', default_value='YUYV', - description='Pixel format') - - output_encoding_arg = DeclareLaunchArgument( - 'output_encoding', default_value='yuv422_yuy2', - description='Output encoding') - - image_size_arg = DeclareLaunchArgument( - 'image_size', default_value='[640, 480]', - description='Image size') - - camera_frame_id_arg = DeclareLaunchArgument( - 'camera_frame_id', default_value='camera_optical_link', - description='Camera frame ID') - - params_file_arg = DeclareLaunchArgument( - 'params_file', default_value='', - description='Path to the parameters file') - - device_namespace_arg = DeclareLaunchArgument( - 'device_namespace', default_value='camera', - description='Device namespace') - - ffmpeg_encoding_arg = DeclareLaunchArgument( - 'ffmpeg_encoding', default_value='libx264', - description='FFMPEG encoding') - - ffmpeg_preset_arg = DeclareLaunchArgument( - 'ffmpeg_preset', default_value='ultrafast', - description='FFMPEG preset') - - ffmpeg_tune_arg = DeclareLaunchArgument( - 'ffmpeg_tune', default_value='zerolatency', - description='FFMPEG tune') - - # v4l2_camera node configuration - v4l2_camera_node = Node( - package='v4l2_camera', - executable='v4l2_camera_node', - name='camera', - namespace=LaunchConfiguration('device_namespace'), - parameters=[ - { - 'video_device': LaunchConfiguration('video_device'), - 'pixel_format': LaunchConfiguration('pixel_format'), - 'output_encoding': LaunchConfiguration('output_encoding'), - 'image_size': LaunchConfiguration('image_size'), - 'camera_frame_id': LaunchConfiguration('camera_frame_id'), - 'camera_name': LaunchConfiguration('device_namespace'), - 'camera_link_frame_id': [LaunchConfiguration('device_namespace'), TextSubstitution(text='_link')], - 'ffmpeg_image_transport.encoding': LaunchConfiguration('ffmpeg_encoding'), - 'ffmpeg_image_transport.preset': LaunchConfiguration('ffmpeg_preset'), - 'ffmpeg_image_transport.tune': LaunchConfiguration('ffmpeg_tune'), - }, - LaunchConfiguration('params_file') - ], - # Add any necessary remappings here - ) - - # Assemble the launch description - return LaunchDescription([ - video_device_arg, - pixel_format_arg, - output_encoding_arg, - image_size_arg, - camera_frame_id_arg, - params_file_arg, - device_namespace_arg, - ffmpeg_encoding_arg, - ffmpeg_preset_arg, - ffmpeg_tune_arg, - v4l2_camera_node - ]) -