Skip to content

Sonobotics/EvoROS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2 Parameter Demo - Workflow Components

This project contains a ROS2-based ultrasonic data acquisition and processing system with real-time visualization and parameter control capabilities.

The following README is for Evo devices which may use a different set of parameters. The logics should be identical though.

Overview

The system consists of three main ROS2 nodes that work together:

  1. Publisher Node (publisher.py) - Interfaces with Evo hardware to acquire ultrasonic A-scan data
  2. Processor Node (processor.py) - Processes raw A-scan data and displays real-time visualizations
  3. Controller Node (controller.py) - Provides a GUI for monitoring and controlling system parameters

Architecture

┌─────────────────┐      Ascan Message      ┌─────────────────┐
│                 │ ──────────────────────> │                 │
│    Publisher    │                         │    Processor    │
│  (Hardware I/O) │                         │ (Visualization) │
└─────────────────┘                         └─────────────────┘
         ↑                                           ↑
         │                                           │
         │          ROS2 Parameters                  │
         └───────────────────┬───────────────────────┘
                             │
                    ┌────────────────┐
                    │   Controller   │
                    │     (GUI)      │
                    └────────────────┘

Components

Publisher Node (ascan_publisher)

Purpose: Interfaces with Evo ultrasonic hardware to acquire A-scan waveform data from up to 2 channels.

The publisher does not include code on temperature gathering. You should implement your own temperature aquisition code, and there is a segment in the code where you can do this.

Parameters:

  • numAverages (int, 1-1000): Number of waveform averages for noise reduction
  • numChannels (int, 1-2): Number of active channels
  • numCycles (int, 1-3): Number of excitation cycles (read-only)
  • numSamples (int): Number of samples to record (read-only)
  • signalFrequency (int): EMAT signal frequency in Hz

Published Topics:

  • /ascan (interfaces/msg/Ascan): Contains active channels, encoded waveform data, and temperature

Processor Node (ascan_processor)

Purpose: Processes raw A-scan data and provides real-time visualization with automatic peak detection.

Key Features:

  • Real-time matplotlib-based visualization for active channels
  • Automatic subplot arrangement based on number of active channels
  • Peak detection and thickness calculation
  • Multiple processing modes (first peak, multi-echo, zero crossing)
  • Temperature-corrected measurements

Parameters (per channel, ch1-ch2):

  • ch{N}_sampling_freq (int): Sampling frequency in Hz
  • ch{N}_lowbound_time (int): Lower bound time in microseconds
  • ch{N}_minimum_thickness (float): Minimum detectable thickness in mm
  • ch{N}_wave_velocity (float): Wave velocity in m/s
  • ch{N}_num_cycles (float): Number of cycles for processing
  • ch{N}_signal_frequency (int): Signal frequency in Hz
  • ch{N}_threshold_snr (float): SNR threshold in dB
  • ch{N}_noise_width (int): Noise calculation window width
  • ch{N}_calibration_index (int): Calibration reference index
  • ch{N}_firstPeak (bool): Enable first peak detection mode
  • ch{N}_multiEcho (bool): Enable multi-echo mode
  • ch{N}_zeroCrossing (bool): Enable zero crossing detection
  • ch{N}_temperatureCorrected (bool): Enable temperature correction

Subscribed Topics:

  • /ascan (interfaces/msg/Ascan): Receives waveform data from publisher

Controller Node (parameter_manager_gui)

Purpose: Provides a PyQt5-based GUI for real-time parameter monitoring and control.

Key Features:

  • Automatic discovery of ROS2 nodes and their parameters
  • Tabbed interface with separate tabs for each active channel
  • Parameter filtering based on configuration file
  • Support for various parameter types (sliders, spinboxes, checkboxes)
  • Real-time parameter updates with visual feedback
  • Configurable display names and parameter bounds

Configuration (config.json):

  • multipleTabs: Enable/disable tabbed interface
  • whitelist: Enable parameter whitelisting
  • hideReadOnlyParameters: Hide read-only parameters
  • whitelistNodes: List of nodes to display
  • whitelistParameters: Parameters to show per node
  • parameterDisplayNames: Custom display names for parameters
  • parameter_bounds: Min/max bounds for numeric parameters

Channel Numbering

The system uses 1-based channel numbering (1-2) for user-facing interfaces:

  • Channel parameters are named ch1_* through ch2_*
  • Display shows "Channel 1" through "Channel 2"
  • The channelsOnReceive parameter uses array indices 0-1 internally but presents channels as 1-2 to users

Message Format

Ascan Message

int32[] active_channels   # List of active channel numbers (1-2)
string[] ascan_data       # Base64-encoded waveform data for each active channel
float32 temperature       # Current temperature reading
int32 signal_frequency    # EMAT pulser frequency

Dependencies

  • ROS2 Humble or later (tested on Jazzy) (Desktop Variant is required for processor and controller)
  • Evo ultrasonic system (for publisher)

Installation

  1. Under the project root folder, run
cd drivers
sudo ./sonobotics_runtime_<version&architecture>.deb
sudo ./sonobotics_waveforms_<version&architecture>.deb
tar -xvf pololu-jrk-g2-1.4.0-linux-x86.tar.xz
cd pololu-jrk-g2-1.4.0-linux-x86
sudo ./install.sh
  1. Once drivers have been installed, run
colcon build

to build all the packages.

Usage

Starting the System

  1. Launch the publisher node (requires Evo hardware):
ros2 run ros_parameter_demo publisher
  1. Launch the processor node for visualization:
ros2 run ros_parameter_demo processor
  1. Launch the controller GUI:
ros2 run ros_parameter_demo controller

Configuring Channels

To enable specific receive channels, modify the numChannels parameter in the publisher file.

Processing Modes

Each channel can operate in different processing modes:

  • First Peak: Detects the first significant peak in the waveform
  • Multi-Echo: Processes multiple reflections
  • Zero Crossing: Uses zero-crossing detection for improved accuracy
  • Temperature Corrected: Applies temperature compensation to measurements

Note: First Peak and Multi-Echo modes are mutually exclusive.

If you set both in the controller, the processor falls back to which none of the four parameters are set.

Configuration Files

  • config.json: Controller GUI configuration
  • Channel parameters can be saved/loaded via ROS2 parameter services

Troubleshooting

  1. No visualization appears: Ensure at least one channel is enabled in numChannels
  2. Controller doesn't show parameters: Controller won't show anything until the publishing node is on. Check that nodes are running and config.json whitelist is correct.
  3. Hardware errors: Verify Evo device is connected and permissions are set correctly.

About

This project contains a ROS2-based ultrasonic data acquisition and processing system with real-time visualization and parameter control capabilities.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors