Fejemis Vision ROS2: Difference between revisions

From Rsewiki
(Created page with " == fejemis_vision package == The fejemis_vision package is the computer vision subsystem used in the Fejemis robot platform. It is responsible for: * Human detection * Cable detection * Depth-based segmentation * Pose estimation * Object tracking The package is located in: ''src/fejemis/fejemis_vision'' launch/: Contains ROS 2 launch files used to start the vision system. * ''main-launch.py'' - launch full detection * ''cable_test.launch.py'', ''net_test.launch.p...")
 
No edit summary
Line 1: Line 1:
Back to [[Fejemis 2026]]


== fejemis_vision package ==
== fejemis_vision package ==


The fejemis_vision package is the computer vision subsystem used in the Fejemis robot platform. It is responsible for:
The fejemis_vision package is the computer vision subsystem used in the Fejemis robot platform. It is responsible for environmental perception and object detection using RGB and depth camera data.
 
Main functionalities include:


* Human detection
* Human detection
* Cable detection
* Cable detection
* Net detection
* Depth-based segmentation
* Depth-based segmentation
* Pose estimation
* Pose estimation
Line 12: Line 16:
The package is located in: ''src/fejemis/fejemis_vision''
The package is located in: ''src/fejemis/fejemis_vision''


launch/:
=== Directory Structure ===
Contains ROS 2 launch files used to start the vision system.  
 
====launch/====
Contains ROS 2 launch files used to start the vision system and individual detection pipelines.
 
Main launch files:
* ''main-launch.py'' - Launches the complete perception system
 
Testing launch files:
* cable_test.launch.py - Launches the cable detection pipeline
* net_test.launch.py - Launches the net detection pipeline
* people_test.launch.py - Launches the people detection pipeline


* ''main-launch.py'' - launch full detection
These launch files initialize the required ROS 2 nodes, camera subscriptions, and RViz visualization.
* ''cable_test.launch.py'', ''net_test.launch.py'', ''people_test.launch.py'' - launches individual detection


pyth/:
==== pyth/ ====
* main.py - Main ROS 2 vision node
Contains the main Python source code for the vision and detection system.
* cable_detection.py - Cable and linear object detection
 
* net_test.py - Used for testing and validating the net detection pipeline
Main scripts:
* main.py - Main ROS 2 vision node coordinating the perception system
 
Detection scripts:
* cable_detection.py - Detects cables and linear structures in the environment
* net_detection.py - Detects net or mesh-like structures using computer vision methods
* people_detection_pose_segmentation.py - Human detection using pose estimation and segmentation
* people_detection_pose_segmentation.py - Human detection using pose estimation and segmentation
* people_detection_depth_segmentation.py - Human detection using depth-based segmentation
* people_detection_depth_segmentation.py - Human detection using depth-based segmentation
* people_detection_deep_sort.py - Multi-person tracking using DeepSORT
* people_detection_simple_segmentation.py - Simpler segmentation-based human detection approach


Tracking:
* people_detection_deep_sort.py - Multi-person tracking using the DeepSORT tracking algorithm


Each detector has a test script to run for testing.These test uses test images to do offline testing of the detection models fromdifferent test images folder.
Testing scripts:
* cable_test.py
* net_test.py
* people_test_basic.py


config/:
These scripts are used for testing and validating the detection pipelines independently.
* Configuration files allow tuning the perception system without modifying source code.


deep_learning/:
==== Test Image Directories ====
* The deep_learning/ directory contains the neural network models and configuration files used by the vision system for object and human detection.
The package contains several directories with offline test images used during development and debugging:


Setup:
* cable_test_images/
* net_test_images/
* people_test_images/
* other_imgs/


* OpenCV should be installed using "pip install opencv-python"
These images are used to evaluate the detection models without requiring a live camera stream.
* The various python packages used can be installed using the requiremtents.txt file by running "pip install requiremtents.txt"
* To run the scripts using roslaunch make sure to set scripts to be executable permissionns:


==== deep_learning/ ====
Contains neural network models and configuration files used by the detection system.
Files include:
* yolov4-tiny.cfg - YOLOv4-tiny network configuration
* yolov4-tiny.weights - Pretrained YOLOv4-tiny weights
* classes.txt - Object class labels used by the detector
* mars-small128.pb - Feature extraction model used by DeepSORT tracking
The package uses YOLOv4-tiny to achieve lightweight real-time object detection suitable for embedded systems such as Raspberry Pi devices.
==== config/ ====
Contains configuration files used to tune the perception system.
Typical configuration includes:
* Detection thresholds
* Camera parameters
* Segmentation parameters
* ROS topic settings
These configuration files allow tuning the system without modifying the source code.
== Setup ==
=== Install Dependencies ===
Install OpenCV:
pip install opencv-python
Install the required Python packages:
pip install -r requirements.txt
=== Make Python Scripts Executable ===
Before launching the ROS 2 nodes, ensure the Python scripts have executable permissions:
  chmod +x main.py
  chmod +x main.py
  chmod +x net_test.py
  chmod +x net_test.py
Line 46: Line 104:
  chmod +x cable_test.py  
  chmod +x cable_test.py  


* To run the main script:
=== Launch files ===
 
To launch the full perception pipeline:
  ros2 launch fejemis_vision main.launch.py
  ros2 launch fejemis_vision main.launch.py


* To run any of the test scripts:
To run individual test pipelines:
 
  ros2 launch fejemis_vision cable_test.launch.py
  ros2 launch fejemis_vision cable_test.launch.py
  ros2 launch fejemis_vision people_test.launch.py
  ros2 launch fejemis_vision people_test.launch.py
  ros2 launch fejemis_vision net.launch.py
  ros2 launch fejemis_vision net.launch.py


== Progress and Current State ==
A major part of the work involved converting the original package from ROS 1 to ROS 2 compatibility.
Due to limited project time, only partial testing and validation were completed. Additional development and tuning are still required.


== Progress ==  
=== Current Results ===


The main work done was to convert this package from ROS1 to compatible with ROS 2. Limited testing was done due to limited time, and more modifying needs to be done.
* All detection pipelines were successfully tested offline using stored test images
* Live camera stream testing produced mixed results
* People detection and net detection showed the most stable and reliable performance
* RViz marker visualization worked correctly for several detection pipelines
* Cable detection was significantly more unstable and noisy. The cables were sometimes correctly detected and false detections and random line generation frequently occurred


* Each detections worked on offline testing meaning testing with existing images.
=== Areas for Future Improvement ===


* The result testing each detector from camera stream was mixed. People detection and net detection had the most working detection and displaying the markers in rviz. Cable detectors seems random where it some time detected cables and ofte drawed cables on random places and some time
* Detection parameters and thresholds were not fully tuned. Additional tuning may significantly reduce detection noise, especially for cable detection
* Only people_detection_pose_segmentation.py was verified to work reliably during live testing. The remaining human detection methods were not fully investigated due to time limitations
* Additional filtering and depth processing could improve robustness
* Performance optimization may still be required for Raspberry Pi deployment


This can look into:
=== RViz Visualization ===


* The detection parameters was not fully tested and twearked, which can be done to improve the noise expecially for cable detectors.
The original ROS 1 implementation used the jsk-visualization package for RViz markers.


* From people detection only the people_detection_pose_segmentation.py observed to work. There other was not invastigated due to limited time and can be further invastigate.
At the time of this project, jsk-visualization was not fully compatible with ROS 2. Therefore, the system was modified to use built-in ROS 2 MarkerArray visualization messages instead.


* In the original ROS jsk-visualization was used for markering in Rviz. However at the time of this project this package was not compatible in ROS2. Instead inbuilt marker array was used to draw the object in Rviz.  
This allowed detected objects and positions to still be visualized in RViz.


== Original ROS 1 Repository ==


To access the old ROS 1 repository: https://github.com/MP-EL/fejemis_vision
The original ROS 1 implementation can be found here: [https://github.com/MP-EL/fejemis_vision MP-EL/fejemis_vision]

Revision as of 20:24, 28 May 2026

Back to Fejemis 2026

fejemis_vision package

The fejemis_vision package is the computer vision subsystem used in the Fejemis robot platform. It is responsible for environmental perception and object detection using RGB and depth camera data.

Main functionalities include:

  • Human detection
  • Cable detection
  • Net detection
  • Depth-based segmentation
  • Pose estimation
  • Object tracking

The package is located in: src/fejemis/fejemis_vision

Directory Structure

launch/

Contains ROS 2 launch files used to start the vision system and individual detection pipelines.

Main launch files:

  • main-launch.py - Launches the complete perception system

Testing launch files:

  • cable_test.launch.py - Launches the cable detection pipeline
  • net_test.launch.py - Launches the net detection pipeline
  • people_test.launch.py - Launches the people detection pipeline

These launch files initialize the required ROS 2 nodes, camera subscriptions, and RViz visualization.

pyth/

Contains the main Python source code for the vision and detection system.

Main scripts:

  • main.py - Main ROS 2 vision node coordinating the perception system

Detection scripts:

  • cable_detection.py - Detects cables and linear structures in the environment
  • net_detection.py - Detects net or mesh-like structures using computer vision methods
  • people_detection_pose_segmentation.py - Human detection using pose estimation and segmentation
  • people_detection_depth_segmentation.py - Human detection using depth-based segmentation
  • people_detection_simple_segmentation.py - Simpler segmentation-based human detection approach

Tracking:

  • people_detection_deep_sort.py - Multi-person tracking using the DeepSORT tracking algorithm

Testing scripts:

  • cable_test.py
  • net_test.py
  • people_test_basic.py

These scripts are used for testing and validating the detection pipelines independently.

Test Image Directories

The package contains several directories with offline test images used during development and debugging:

  • cable_test_images/
  • net_test_images/
  • people_test_images/
  • other_imgs/

These images are used to evaluate the detection models without requiring a live camera stream.

deep_learning/

Contains neural network models and configuration files used by the detection system.

Files include:

  • yolov4-tiny.cfg - YOLOv4-tiny network configuration
  • yolov4-tiny.weights - Pretrained YOLOv4-tiny weights
  • classes.txt - Object class labels used by the detector
  • mars-small128.pb - Feature extraction model used by DeepSORT tracking

The package uses YOLOv4-tiny to achieve lightweight real-time object detection suitable for embedded systems such as Raspberry Pi devices.

config/

Contains configuration files used to tune the perception system.

Typical configuration includes:

  • Detection thresholds
  • Camera parameters
  • Segmentation parameters
  • ROS topic settings

These configuration files allow tuning the system without modifying the source code.

Setup

Install Dependencies

Install OpenCV:

pip install opencv-python

Install the required Python packages:

pip install -r requirements.txt

Make Python Scripts Executable

Before launching the ROS 2 nodes, ensure the Python scripts have executable permissions:

chmod +x main.py
chmod +x net_test.py
chmod +x people_test_basic.py
chmod +x cable_test.py 

Launch files

To launch the full perception pipeline:

ros2 launch fejemis_vision main.launch.py

To run individual test pipelines:

ros2 launch fejemis_vision cable_test.launch.py
ros2 launch fejemis_vision people_test.launch.py
ros2 launch fejemis_vision net.launch.py

Progress and Current State

A major part of the work involved converting the original package from ROS 1 to ROS 2 compatibility.

Due to limited project time, only partial testing and validation were completed. Additional development and tuning are still required.

Current Results

  • All detection pipelines were successfully tested offline using stored test images
  • Live camera stream testing produced mixed results
  • People detection and net detection showed the most stable and reliable performance
  • RViz marker visualization worked correctly for several detection pipelines
  • Cable detection was significantly more unstable and noisy. The cables were sometimes correctly detected and false detections and random line generation frequently occurred

Areas for Future Improvement

  • Detection parameters and thresholds were not fully tuned. Additional tuning may significantly reduce detection noise, especially for cable detection
  • Only people_detection_pose_segmentation.py was verified to work reliably during live testing. The remaining human detection methods were not fully investigated due to time limitations
  • Additional filtering and depth processing could improve robustness
  • Performance optimization may still be required for Raspberry Pi deployment

RViz Visualization

The original ROS 1 implementation used the jsk-visualization package for RViz markers.

At the time of this project, jsk-visualization was not fully compatible with ROS 2. Therefore, the system was modified to use built-in ROS 2 MarkerArray visualization messages instead.

This allowed detected objects and positions to still be visualized in RViz.

Original ROS 1 Repository

The original ROS 1 implementation can be found here: MP-EL/fejemis_vision