From fbb46c73ecbee76dcd5858c563e5155ad5cf080b Mon Sep 17 00:00:00 2001 From: Icyadam14 Date: Fri, 7 Feb 2025 12:02:44 -0500 Subject: [PATCH] Remove deprecated nodes --- deprecated_nodes/com_pub/CMakeLists.txt | 38 --------- deprecated_nodes/com_pub/COLCON_IGNORE | 0 deprecated_nodes/com_pub/com_pub/__init__.py | 0 deprecated_nodes/com_pub/package.xml | 32 ------- deprecated_nodes/com_pub/src/sender.py | 83 ------------------- deprecated_nodes/depth_comm/CMakeLists.txt | 36 -------- deprecated_nodes/depth_comm/COLCON_IGNORE | 0 .../depth_comm/depth_comm/__init__.py | 0 deprecated_nodes/depth_comm/package.xml | 27 ------ deprecated_nodes/depth_comm/src/depth.py | 20 ----- deprecated_nodes/surface_imu/CMakeLists.txt | 36 -------- deprecated_nodes/surface_imu/COLCON_IGNORE | 0 deprecated_nodes/surface_imu/package.xml | 27 ------ .../surface_imu/src/surface_imu.py | 31 ------- .../surface_imu/surface_imu/__init__.py | 0 deprecated_nodes/thrusters/CMakeLists.txt | 36 -------- deprecated_nodes/thrusters/COLCON_IGNORE | 0 deprecated_nodes/thrusters/package.xml | 27 ------ deprecated_nodes/thrusters/src/status.py | 30 ------- .../thrusters/thrusters/__init__.py | 0 20 files changed, 423 deletions(-) delete mode 100644 deprecated_nodes/com_pub/CMakeLists.txt delete mode 100644 deprecated_nodes/com_pub/COLCON_IGNORE delete mode 100644 deprecated_nodes/com_pub/com_pub/__init__.py delete mode 100644 deprecated_nodes/com_pub/package.xml delete mode 100644 deprecated_nodes/com_pub/src/sender.py delete mode 100644 deprecated_nodes/depth_comm/CMakeLists.txt delete mode 100644 deprecated_nodes/depth_comm/COLCON_IGNORE delete mode 100644 deprecated_nodes/depth_comm/depth_comm/__init__.py delete mode 100644 deprecated_nodes/depth_comm/package.xml delete mode 100644 deprecated_nodes/depth_comm/src/depth.py delete mode 100644 deprecated_nodes/surface_imu/CMakeLists.txt delete mode 100644 deprecated_nodes/surface_imu/COLCON_IGNORE delete mode 100644 deprecated_nodes/surface_imu/package.xml delete mode 100644 deprecated_nodes/surface_imu/src/surface_imu.py delete mode 100644 deprecated_nodes/surface_imu/surface_imu/__init__.py delete mode 100644 deprecated_nodes/thrusters/CMakeLists.txt delete mode 100644 deprecated_nodes/thrusters/COLCON_IGNORE delete mode 100644 deprecated_nodes/thrusters/package.xml delete mode 100644 deprecated_nodes/thrusters/src/status.py delete mode 100644 deprecated_nodes/thrusters/thrusters/__init__.py diff --git a/deprecated_nodes/com_pub/CMakeLists.txt b/deprecated_nodes/com_pub/CMakeLists.txt deleted file mode 100644 index 224ae32..0000000 --- a/deprecated_nodes/com_pub/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(com_pub) - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# find dependencies -find_package(ament_cmake REQUIRED) -find_package(ament_cmake_python REQUIRED) -find_package(rclpy REQUIRED) -find_package(builtin_interfaces REQUIRED) -find_package(rosidl_default_generators REQUIRED) - -ament_python_install_package(${PROJECT_NAME}) - -install(PROGRAMS - src/sender.py - DESTINATION lib/${PROJECT_NAME} -) -# uncomment the following section in order to fill in -# further dependencies manually. -# find_package( REQUIRED) - - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # comment the line when a copyright and license is added to all source files - set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # comment the line when this package is in a git repo and when - # a copyright and license is added to all source files - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() \ No newline at end of file diff --git a/deprecated_nodes/com_pub/COLCON_IGNORE b/deprecated_nodes/com_pub/COLCON_IGNORE deleted file mode 100644 index e69de29..0000000 diff --git a/deprecated_nodes/com_pub/com_pub/__init__.py b/deprecated_nodes/com_pub/com_pub/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/deprecated_nodes/com_pub/package.xml b/deprecated_nodes/com_pub/package.xml deleted file mode 100644 index 7964eda..0000000 --- a/deprecated_nodes/com_pub/package.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - com_pub - 0.0.0 - TODO: Package description - zach - TODO: License declaration - - ament_cmake - rosidl_default_generators - - ament_lint_auto - ament_lint_common - - - builtin_interfaces - rosidl_default_generators - - rosidl_interface_packages - - ament_cmake_python - - rclpy - - ament_lint_auto - ament_lint_common - - - ament_cmake - - diff --git a/deprecated_nodes/com_pub/src/sender.py b/deprecated_nodes/com_pub/src/sender.py deleted file mode 100644 index 61fce0e..0000000 --- a/deprecated_nodes/com_pub/src/sender.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python3 - -import rclpy -from std_msgs.msg import Float32, String -from shared_msgs.msg import ComMsg -import socket, signal, sys -import threading - -com_x = 0.0 -com_y = 0.0 -com_z = 0.0 - - -class SocketManager: - def __init__(self, port): - self.running = True - self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.sock.bind(("127.0.0.1", port)) - self.sock.listen(5) - self.sock.settimeout(1) - self.connected = False - - self.thread = threading.Thread(target=self.run) - self.thread.start() - - def shutdown(self): - self.running = False - self.sock.close() - self.thread.join() - - def run(self): - while not self.connected and self.running: - try: - conn, addr = self.sock.accept() - self.connected = True - except: - pass - while self.running: - try: - data = conn.recv(25) - except: - pass - if data: - global com_x, com_y, com_z, pub - - arr = [float(d) for d in data.decode().split(";")[0].split(",")] - - if len(arr) == 3: - com_x = arr[0] - com_y = arr[1] - com_z = arr[2] - - msg = ComMsg() - msg.com[0] = com_x - msg.com[1] = com_y - msg.com[2] = com_z - pub.publish(msg) - - -def shutdown(sig, frame): - global sock - - print("please") - sock.shutdown() - # rclpy.signal_shutdown('now') - rclpy.shutdown() - - -if __name__ == "__main__": - signal.signal(signal.SIGINT, shutdown) - signal.signal(signal.SIGTERM, shutdown) - - sock = SocketManager(int(sys.argv[1])) - - rclpy.init() - node = rclpy.create_node("com_sender") - - pub = node.create_publisher(ComMsg, "/rov/com_tweak", 10) - # rate = rclpy.Rate(10) - - print("ready") - - rclpy.spin(node) diff --git a/deprecated_nodes/depth_comm/CMakeLists.txt b/deprecated_nodes/depth_comm/CMakeLists.txt deleted file mode 100644 index c3a92a6..0000000 --- a/deprecated_nodes/depth_comm/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(depth_comm) - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# find dependencies -find_package(ament_cmake REQUIRED) -find_package(ament_cmake_python REQUIRED) -find_package(rclpy REQUIRED) - -# uncomment the following section in order to fill in -# further dependencies manually. -# find_package( REQUIRED) - -ament_python_install_package(${PROJECT_NAME}) - -install(PROGRAMS - src/depth.py - DESTINATION lib/${PROJECT_NAME} -) - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # comment the line when a copyright and license is added to all source files - set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # comment the line when this package is in a git repo and when - # a copyright and license is added to all source files - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() diff --git a/deprecated_nodes/depth_comm/COLCON_IGNORE b/deprecated_nodes/depth_comm/COLCON_IGNORE deleted file mode 100644 index e69de29..0000000 diff --git a/deprecated_nodes/depth_comm/depth_comm/__init__.py b/deprecated_nodes/depth_comm/depth_comm/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/deprecated_nodes/depth_comm/package.xml b/deprecated_nodes/depth_comm/package.xml deleted file mode 100644 index 363e8f8..0000000 --- a/deprecated_nodes/depth_comm/package.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - depth_comm - 0.0.0 - TODO: Package description - babelman - TODO: License declaration - - ament_cmake - ament_cmake_python - rosidl_default_generators - - rclpy - - builtin_interfaces - rosidl_default_generators - - rosidl_interface_packages - - ament_lint_auto - ament_lint_common - - - ament_cmake - - diff --git a/deprecated_nodes/depth_comm/src/depth.py b/deprecated_nodes/depth_comm/src/depth.py deleted file mode 100644 index be2db55..0000000 --- a/deprecated_nodes/depth_comm/src/depth.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 - -import rclpy -from std_msgs.msg import Float32 -import json - - -def callback(data): - jsonstuff = json.dumps(data.data) - # jsonstuff = json.dumps(None) - print(jsonstuff, flush=True, end=" ") - - -if __name__ == "__main__": - rclpy.init() - node = rclpy.create_node("surface_depth") - - sub = node.create_subscription(Float32, "/rov/depth", callback, 10) - - rclpy.spin(node) diff --git a/deprecated_nodes/surface_imu/CMakeLists.txt b/deprecated_nodes/surface_imu/CMakeLists.txt deleted file mode 100644 index 0f3cc7e..0000000 --- a/deprecated_nodes/surface_imu/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(surface_imu) - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# find dependencies -find_package(ament_cmake REQUIRED) -find_package(ament_cmake_python REQUIRED) -find_package(rclpy REQUIRED) - -# uncomment the following section in order to fill in -# further dependencies manually. -# find_package( REQUIRED) - -ament_python_install_package(${PROJECT_NAME}) - -install(PROGRAMS - src/surface_imu.py - DESTINATION lib/${PROJECT_NAME} -) - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # comment the line when a copyright and license is added to all source files - set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # comment the line when this package is in a git repo and when - # a copyright and license is added to all source files - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() diff --git a/deprecated_nodes/surface_imu/COLCON_IGNORE b/deprecated_nodes/surface_imu/COLCON_IGNORE deleted file mode 100644 index e69de29..0000000 diff --git a/deprecated_nodes/surface_imu/package.xml b/deprecated_nodes/surface_imu/package.xml deleted file mode 100644 index 5deb3a0..0000000 --- a/deprecated_nodes/surface_imu/package.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - surface_imu - 0.0.0 - TODO: Package description - babelman - TODO: License declaration - - ament_cmake - ament_cmake_python - rosidl_default_generators - - rclpy - - builtin_interfaces - rosidl_default_generators - - rosidl_interface_packages - - ament_lint_auto - ament_lint_common - - - ament_cmake - - diff --git a/deprecated_nodes/surface_imu/src/surface_imu.py b/deprecated_nodes/surface_imu/src/surface_imu.py deleted file mode 100644 index 9376ca0..0000000 --- a/deprecated_nodes/surface_imu/src/surface_imu.py +++ /dev/null @@ -1,31 +0,0 @@ -#! /usr/bin/python3 - -import rclpy -import rclpy.node as Node -import json -import sys - -# ROS -from shared_msgs.msg import ImuMsg -from std_msgs.msg import String -import numpy as np - -imu = [0, 0, 0] - - -def _imu(comm): - global imu - imu[0] = comm.gyro[0] - imu[1] = (abs(comm.gyro[1]) - 180) / 180 - imu[2] = comm.gyro[2] - for i in range(len(imu)): - imu[i] = imu[i].item() - print(json.dumps(imu)) - - -if __name__ == "__main__": - rclpy.init() - node = rclpy.create_node("surface_imu") - stat = node.create_subscription(ImuMsg, "/rov/imu", _imu, 10) - - rclpy.spin(node) diff --git a/deprecated_nodes/surface_imu/surface_imu/__init__.py b/deprecated_nodes/surface_imu/surface_imu/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/deprecated_nodes/thrusters/CMakeLists.txt b/deprecated_nodes/thrusters/CMakeLists.txt deleted file mode 100644 index fce8f22..0000000 --- a/deprecated_nodes/thrusters/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(thrusters) - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# find dependencies -find_package(ament_cmake REQUIRED) -find_package(ament_cmake_python REQUIRED) -find_package(rclpy REQUIRED) - -# uncomment the following section in order to fill in -# further dependencies manually. -# find_package( REQUIRED) - -ament_python_install_package(${PROJECT_NAME}) - -install(PROGRAMS - src/status.py - DESTINATION lib/${PROJECT_NAME} -) - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # comment the line when a copyright and license is added to all source files - set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # comment the line when this package is in a git repo and when - # a copyright and license is added to all source files - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() diff --git a/deprecated_nodes/thrusters/COLCON_IGNORE b/deprecated_nodes/thrusters/COLCON_IGNORE deleted file mode 100644 index e69de29..0000000 diff --git a/deprecated_nodes/thrusters/package.xml b/deprecated_nodes/thrusters/package.xml deleted file mode 100644 index 8725466..0000000 --- a/deprecated_nodes/thrusters/package.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - thrusters - 0.0.0 - TODO: Package description - babelman - TODO: License declaration - - ament_cmake - ament_cmake_python - rosidl_default_generators - - rclpy - - builtin_interfaces - rosidl_default_generators - - rosidl_interface_packages - - ament_lint_auto - ament_lint_common - - - ament_cmake - - diff --git a/deprecated_nodes/thrusters/src/status.py b/deprecated_nodes/thrusters/src/status.py deleted file mode 100644 index 50131b5..0000000 --- a/deprecated_nodes/thrusters/src/status.py +++ /dev/null @@ -1,30 +0,0 @@ -#! /usr/bin/python3 - -import json - -# ROS -import rclpy -from shared_msgs.msg import FinalThrustMsg - -thrust = [0, 0, 0, 0, 0, 0, 0, 0] - - -def _thruster(comm): - global thrust - thrust[0] = int(comm.thrusters[0]) - thrust[1] = int(comm.thrusters[1]) - thrust[2] = int(comm.thrusters[2]) - thrust[3] = int(comm.thrusters[3]) - thrust[4] = int(comm.thrusters[4]) - thrust[5] = int(comm.thrusters[5]) - thrust[6] = int(comm.thrusters[6]) - thrust[7] = int(comm.thrusters[7]) - print(json.dumps(thrust)) - - -if __name__ == "__main__": - rclpy.init() - node = rclpy.create_node("thrusters_surface") - stat = node.create_subscription(FinalThrustMsg, "/rov/final_thrust", _thruster, 10) - - rclpy.spin(node) diff --git a/deprecated_nodes/thrusters/thrusters/__init__.py b/deprecated_nodes/thrusters/thrusters/__init__.py deleted file mode 100644 index e69de29..0000000