Skip to content

Commit

Permalink
Somethings wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguelmelon committed Jun 29, 2024
1 parent da4e198 commit d082649
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion people_tracking_v2/scripts/decision_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self):

# Publisher for decision results and marked images
self.decision_pub = rospy.Publisher('/decision/result', DecisionResult, queue_size=10)
self.marked_image_pub = rospy.Publisher('/marked_image', Image, queue_size=10)
#self.marked_image_pub = rospy.Publisher('/marked_image', Image, queue_size=10)

# Initialize variables for saving data
self.save_data = save_data
Expand Down
5 changes: 2 additions & 3 deletions people_tracking_v2/scripts/yolo_seg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import sys
import os
import rospkg
import time
from datetime import datetime

# Add the path to the `kalman_filter.py` module
Expand All @@ -20,8 +19,8 @@

laptop = sys.argv[1]
name_subscriber_RGB = 'Webcam/image_raw' if laptop == "True" else '/hero/head_rgbd_sensor/rgb/image_raw'
depth_camera = False if sys.argv[2] == "False" else True
save_data = False if sys.argv[3] == "False" else True
depth_camera = False #if sys.argv[2] == "False" else True
save_data = False #if sys.argv[3] == "False" else True

class YoloSegNode:
def __init__(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<launch>

<arg name="laptop" default="True" />
<arg name="depth_camera" default="True" />
<arg name="depth_camera" default="False" />
<arg name="save_data" default="False"/>

<node
Expand Down
9 changes: 4 additions & 5 deletions people_tracking_v2/testing/depth_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import os
import numpy as np

def publish_depth_images_from_folder(folder_path, topic_name, video_duration):
def publish_depth_images_from_folder(folder_path, topic_name):
pub = rospy.Publisher(topic_name, Image, queue_size=10)
bridge = CvBridge()

# List all files in the folder and sort them
image_files = sorted([f for f in os.listdir(folder_path) if f.endswith(('.png', '.jpg', '.jpeg'))])
total_frames = len(image_files)

rate = rospy.Rate(15.4) # Set the desired rate
rate = rospy.Rate(18.7) # Set the desired rate

for image_file in image_files:
if rospy.is_shutdown():
Expand Down Expand Up @@ -42,10 +42,9 @@ def publish_depth_images_from_folder(folder_path, topic_name, video_duration):

if __name__ == '__main__':
rospy.init_node('depth_publisher_node', anonymous=True)
folder_path = '/home/miguel/Documents/BEP-Testing/Test Case 1/Frames Sat Jun 29 Test Case 1/depth'
folder_path = '/home/miguel/Documents/BEP-Testing/Old/Aboud/Frames Fri Jun 28 Test case 4/depth' #/home/miguel/Documents/BEP-Testing/Test Case 1/Frames Sat Jun 29 Test Case 1/depth
topic_name = '/hero/head_rgbd_sensor/depth_registered/image_raw'
video_duration = 122 # Duration of the video in seconds, modify as needed
try:
publish_depth_images_from_folder(folder_path, topic_name, video_duration)
publish_depth_images_from_folder(folder_path, topic_name)
except rospy.ROSInterruptException:
pass
4 changes: 2 additions & 2 deletions people_tracking_v2/testing/launchers/test_videos.launch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<launch>

<arg name="laptop" default="False" />
<arg name="depth_camera" default="True" />
<arg name="save_data" default="True"/>
<arg name="depth_camera" default="False" />
<arg name="save_data" default="False"/>

<node
pkg="people_tracking_v2"
Expand Down
4 changes: 2 additions & 2 deletions people_tracking_v2/testing/rgb_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def publish_images_from_folder(folder_path):
rospy.logerr(f"No image files found in {folder_path}")
return

rate = rospy.Rate(15.4) # Set the desired rate
rate = rospy.Rate(18.7) # Set the desired rate

for image_file in image_files:
if rospy.is_shutdown():
Expand All @@ -38,7 +38,7 @@ def publish_images_from_folder(folder_path):

if __name__ == '__main__':
rospy.init_node('rgb_image_folder_publisher_node', anonymous=True)
folder_path = '/home/miguel/Documents/BEP-Testing/Test Case 1/Frames Sat Jun 29 Test Case 1/rgb'
folder_path = '/home/miguel/Documents/BEP-Testing/Old/Aboud/Frames Fri Jun 28 Test case 4/rgb' #/home/miguel/Documents/BEP-Testing/Test Case 1/Frames Sat Jun 29 Test Case 1/rgb
try:
publish_images_from_folder(folder_path)
except rospy.ROSInterruptException:
Expand Down

0 comments on commit d082649

Please sign in to comment.