Skip to content

Commit

Permalink
Merge pull request #7 from pge23-24/main
Browse files Browse the repository at this point in the history
patch vision
  • Loading branch information
Arthuino authored Feb 7, 2024
2 parents c42cf37 + 31aa80b commit 12c33a7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .config/ros2_config/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,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
Expand Down
2 changes: 1 addition & 1 deletion vision_ws/scripts/run_camera_yolo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
14 changes: 7 additions & 7 deletions vision_ws/src/py_pubsub/py_pubsub/camera_yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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 = (
Expand Down Expand Up @@ -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)"
)
Expand Down
4 changes: 2 additions & 2 deletions vision_ws/src/py_pubsub_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#/ Time of sensor data acqusition, coordinate frame ID.
std_msgs/Header header
#/ Array of clusters
ClassCoordinates[] detections
CameraDetectionStamped[] detections

0 comments on commit 12c33a7

Please sign in to comment.