From db157560f11fd94d90e84938f5e18031f64e8f93 Mon Sep 17 00:00:00 2001 From: Arthuino Date: Wed, 7 Feb 2024 16:15:13 +0100 Subject: [PATCH 1/2] add vim to ros2 docker --- .config/ros2_config/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/ros2_config/Dockerfile b/.config/ros2_config/Dockerfile index a5bf1da..8669863 100644 --- a/.config/ros2_config/Dockerfile +++ b/.config/ros2_config/Dockerfile @@ -126,6 +126,9 @@ RUN apt-get update && apt-get install -y \ ### +++ Workspace config +++ ### ################################ +# install vim +RUN apt-get update && apt-get install -y vim + # Add shortcuts and aliases RUN echo "cd /workspace" >> /root/.bashrc COPY .config/ros2_config/aliases.bash /root/.bash_aliases From e34c08d1cd5555e752c2965bd8d1952df4391263 Mon Sep 17 00:00:00 2001 From: Arthuino Date: Wed, 7 Feb 2024 17:00:29 +0100 Subject: [PATCH 2/2] rename message and topic for vision --- vision_ws/scripts/run_camera_yolo.sh | 2 +- vision_ws/src/py_pubsub/py_pubsub/camera_yolo.py | 14 +++++++------- vision_ws/src/py_pubsub_msgs/CMakeLists.txt | 4 ++-- ...sCoordinates.msg => CameraDetectionStamped.msg} | 0 ...esArray.msg => CameraDetectionStampedArray.msg} | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) rename vision_ws/src/py_pubsub_msgs/msg/{ClassCoordinates.msg => CameraDetectionStamped.msg} (100%) rename vision_ws/src/py_pubsub_msgs/msg/{ClassCoordinatesArray.msg => CameraDetectionStampedArray.msg} (82%) diff --git a/vision_ws/scripts/run_camera_yolo.sh b/vision_ws/scripts/run_camera_yolo.sh index ddd7850..1beee93 100644 --- a/vision_ws/scripts/run_camera_yolo.sh +++ b/vision_ws/scripts/run_camera_yolo.sh @@ -7,7 +7,7 @@ source install/setup.bash cam_id=${1:-1} echo "Cam : $cam_id" -yolo_version=${2:-v5} +yolo_version=${2:-v8} echo "Yolo : $yolo_version" tracker_enabled=${3:-False} diff --git a/vision_ws/src/py_pubsub/py_pubsub/camera_yolo.py b/vision_ws/src/py_pubsub/py_pubsub/camera_yolo.py index d87727f..e9fc733 100644 --- a/vision_ws/src/py_pubsub/py_pubsub/camera_yolo.py +++ b/vision_ws/src/py_pubsub/py_pubsub/camera_yolo.py @@ -10,8 +10,8 @@ import time from deep_sort_realtime.deepsort_tracker import DeepSort -from py_pubsub_msgs.msg import ClassCoordinates -from py_pubsub_msgs.msg import ClassCoordinatesArray +from py_pubsub_msgs.msg import CameraDetectionStamped +from py_pubsub_msgs.msg import CameraDetectionStampedArray from py_pubsub.distance_calculator import DistanceCalculator CAMERA_ANGLE = 190 @@ -75,9 +75,9 @@ def __init__(self, camera_id, yolo_version, tracker_enabled): Image, self.topic_name_image, 10 ) - self.topic_name_information = f"information_{camera_id}" + self.topic_name_information = f"camera_detection_{camera_id}" self.publisher_information = self.create_publisher( - ClassCoordinatesArray, self.topic_name_information, 10 + CameraDetectionStampedArray, self.topic_name_information, 10 ) self.subscription = self.create_subscription( @@ -205,11 +205,11 @@ def listener_callback(self, image): self.publisher_annotated_image.publish(encoded_annotated_image) distance_calculator = DistanceCalculator() - info_array = ClassCoordinatesArray() + info_array = CameraDetectionStampedArray() info_array.header.stamp = self.get_clock().now().to_msg() for result in new_results: # Informations part - informations = ClassCoordinates() + informations = CameraDetectionStamped() informations.header = info_array.header covariance_matrix, distance_centroid, theta_moy, class_name = ( @@ -244,7 +244,7 @@ def main(args=None): # Add your custom argument parser.add_argument("--cam", type=str, default="1", help="Camera identifier") - parser.add_argument("--yolo", type=str, default="v5", help="Yolo version") + parser.add_argument("--yolo", type=str, default="v8", help="Yolo version") parser.add_argument( "--tracker", type=str, default="false", help="Enable tracker (false | true)" ) diff --git a/vision_ws/src/py_pubsub_msgs/CMakeLists.txt b/vision_ws/src/py_pubsub_msgs/CMakeLists.txt index 1615bfb..401e713 100644 --- a/vision_ws/src/py_pubsub_msgs/CMakeLists.txt +++ b/vision_ws/src/py_pubsub_msgs/CMakeLists.txt @@ -24,8 +24,8 @@ find_package(geometry_msgs REQUIRED) # Add custom message files set(msg_files - "msg/ClassCoordinates.msg" - "msg/ClassCoordinatesArray.msg" + "msg/CameraDetectionStamped.msg" + "msg/CameraDetectionStampedArray.msg" ) # Generate message code diff --git a/vision_ws/src/py_pubsub_msgs/msg/ClassCoordinates.msg b/vision_ws/src/py_pubsub_msgs/msg/CameraDetectionStamped.msg similarity index 100% rename from vision_ws/src/py_pubsub_msgs/msg/ClassCoordinates.msg rename to vision_ws/src/py_pubsub_msgs/msg/CameraDetectionStamped.msg diff --git a/vision_ws/src/py_pubsub_msgs/msg/ClassCoordinatesArray.msg b/vision_ws/src/py_pubsub_msgs/msg/CameraDetectionStampedArray.msg similarity index 82% rename from vision_ws/src/py_pubsub_msgs/msg/ClassCoordinatesArray.msg rename to vision_ws/src/py_pubsub_msgs/msg/CameraDetectionStampedArray.msg index 7719128..01c0fb6 100644 --- a/vision_ws/src/py_pubsub_msgs/msg/ClassCoordinatesArray.msg +++ b/vision_ws/src/py_pubsub_msgs/msg/CameraDetectionStampedArray.msg @@ -3,4 +3,4 @@ #/ Time of sensor data acqusition, coordinate frame ID. std_msgs/Header header #/ Array of clusters -ClassCoordinates[] detections \ No newline at end of file +CameraDetectionStamped[] detections \ No newline at end of file