### Launch Exploration Tool with Hatch Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/getting_started/setting_up_and_running_et.rst Use Hatch to start the Exploration Tool Application. Hatch automates virtual environments and editable installs. ```bash hatch run app:launcher ``` -------------------------------- ### Install libgpiod2 Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/getting_started/evk_setup/raspberry_a121_xe121.rst Installs the libgpiod2 package required for Raspberry Pi setup. This command should be run in a terminal window. ```bash sudo apt install libgpiod2 ``` -------------------------------- ### Example Application Configuration Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/example_apps/a121/cargo.rst Base configuration for the example application, combining presence and utilization level settings. ```python class ExAppConfig: """Configuration for the example application. :param presence: Configuration for presence detection. :param utilization_level: Configuration for utilization level measurement. """ def __init__( self, presence: CargoPresenceConfig = CargoPresenceConfig(), utilization_level: UtilizationLevelConfig = UtilizationLevelConfig(), ): self.presence = presence self.utilization_level = utilization_level ``` -------------------------------- ### Install uv on Windows Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/README.md Installs the uv package manager on Windows using winget. ```bash > winget install --id=astral-sh.uv -e ``` -------------------------------- ### Linux Setup for Acconeer Exploration Tool Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/README.md Run the setup script to interactively configure your machine and download necessary dependencies for the Exploration Tool on Linux. ```bash python -m acconeer.exptool.setup ``` -------------------------------- ### Launch Acconeer Exploration Tool Application Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/README.md Start the Acconeer Exploration Tool graphical application to explore radar sensor data and application examples. ```bash python -m acconeer.exptool.app ``` -------------------------------- ### Sparse IQ Example Script Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/exploration_tool/example_scripts/sparse_iq/examples-a121-algo-sparse_iq-sparse_iq.rst This script demonstrates how to configure and collect sparse IQ data using the A121 sensor. It requires the acconeer library to be installed. ```python import acconeer.ex અને import numpy as np EXAMPLE_CONFIG = { "sensor_a121": { "subsweep_integration": { "sparse": { "enable": True, "step": 10, "num_points": 100 } } } } def main(): args = acconeer.ex અને.ExampleArgs( "sparse_iq", "sparse_iq", optional_args=["num_frames", "out_file"], ) ex = acconeer.ex અને.Example( args=args, config_file="config.json", sensor_id=args.sensor_id, load_config=True, load_metadata=True, ) ex.setup( EXAMPLE_CONFIG, enable_metadata=True, enable_record=args.out_file, ) ex.run(args.num_frames) ex.stop() if args.out_file: ex.save_records(args.out_file) print("done") if __name__ == "__main__": main() ``` -------------------------------- ### Run Basic Example Script via SPI over USB Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/README.md Execute the basic.py example script using SPI over USB for XM112+XB112 modules. ```bash python examples/a111/basic.py -spi ``` -------------------------------- ### Run Basic Example Script via UART (Auto-detect) Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/README.md Execute the basic.py example script using UART over USB, with automatic detection of the serial port for any module. ```bash python examples/a111/basic.py -u ``` -------------------------------- ### Install Exploration Tool from Source Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/getting_started/setting_up_and_running_et.rst Use this command to install the latest version of acconeer-exptool from its source code, including optional application dependencies. ```bash python -m pip install --upgrade .[app] ``` -------------------------------- ### Run Basic Example Script via UART (Specific Port) Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/README.md Execute the basic.py example script using UART over USB, specifying a particular serial port for any module. ```bash python examples/a111/basic.py -u ``` -------------------------------- ### Install uv on Linux Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/README.md Installs the uv package manager on Linux using a curl script. ```bash > curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Install Build Dependencies on Ubuntu Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/a111/evk_setup/xm112.rst Installs necessary packages for building software on Ubuntu 20.04. ```bash sudo apt update sudo apt install -y make build-essential ``` -------------------------------- ### Install acconeer-exptool with App Support Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/README.md Install the acconeer-exptool package with application support from PyPI. This command upgrades the package to the latest version. ```bash python -m pip install --upgrade acconeer-exptool[app] ``` -------------------------------- ### Example Toy Algorithm Module Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/a111/algo/adding_your_own_algorithm_module/guide.rst This is a basic example of a toy algorithm module that can be used with the Exploration Tool App. It demonstrates plotting Envelope frames and allows for plot color and data scaling adjustments. ```python import numpy as np from acconeer.exptool.a111.algo.processing import Processor, PGUpdater from acconeer.exptool.a111.algo.processing.utils import SensorConfig, get_sensor_config from acconeer.exptool.a111.algo.casting import Casting from acconeer.exptool.a111.algo.casting.utils import CastingConfig from acconeer.exptool.a111.algo.casting.utils import CastingPGUpdater from acconeer.exptool.a111.algo.casting.utils import CastingProcessor class ModuleInfo: def __init__(self): self.name = "My Algorithm Module" self.version = "0.1" self.description = "A toy algorithm module for testing." self.processor = MyNewProcessor self.pg_updater = MyNewPGUpdater self.multi_sensor = True class MyNewProcessor(CastingProcessor): def __init__(self, sensor_config: SensorConfig, config: CastingConfig): super().__init__(sensor_config, config) self.plot_color = "blue" self.data_scale = 1.0 def process_frame(self, frame: np.ndarray, frame_info: dict) -> np.ndarray: # Example: Scale data and return it scaled_frame = frame * self.data_scale return scaled_frame class MyNewPGUpdater(CastingPGUpdater): def __init__(self, sensor_config: SensorConfig, config: CastingConfig): super().__init__(sensor_config, config) self.plot_color = "blue" self.data_scale = 1.0 def update_plot(self, frame: np.ndarray, frame_info: dict, plot_name: str): # Example: Update plot color and scale self.plot_color = "red" self.data_scale = 2.0 super().update_plot(frame, frame_info, plot_name) my_module_info = ModuleInfo() ``` -------------------------------- ### Run Basic Example Script with Raspberry Pi IP Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/README.md Execute the basic.py example script, specifying the IP address of your Raspberry Pi for XC111+XR111 or XC112+XR112 modules. ```bash python examples/a111/basic.py -s ``` -------------------------------- ### Install nrfutil Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/a111/evk_setup/xm122.rst Install the nrfutil Python library, which is recommended for flashing the XM122 module. ```bash python -m pip install nrfutil ``` -------------------------------- ### Editable Install of Exploration Tool Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/getting_started/setting_up_and_running_et.rst Install acconeer-exptool in an editable mode, which is recommended when modifying the source code. This avoids the need to reinstall after every code change. ```bash python -m pip install -e .[app] ``` -------------------------------- ### Install required packages on Ubuntu 22.04 Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/getting_started/setting_up_and_running_et.rst Install the necessary system packages for running the Exploration Tool on Ubuntu 22.04. These include libxcb-xinerama0-dev, libusb-1.0-0, and libxcb-cursor0. ```bash sudo apt update sudo apt install -y libxcb-xinerama0-dev libusb-1.0-0 libxcb-cursor0 ``` -------------------------------- ### A121 Basic Python API Example Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/exploration_tool/example_scripts/python_api/examples-a121-basic.rst This snippet shows a basic example of using the A121 sensor with the Python API. It covers sensor initialization, configuration, and data acquisition. Ensure the necessary libraries are installed and the sensor is connected. ```python import acconeer.ex απο import numpy as np def main(): # Create a client connection to the sensor client = acconeer.ex απο.Client() # Get the sensor sensor = client.setup_sensor(sensor_id=0) # Configure the sensor for a single frame with default parameters sensor.set_configuration(acconeer.ex απο.SensorConfiguration( range_interval=(0.02, 0.2), step_interval=(0.001, 0.001), profile=acconeer.ex απο.Profile.PROFILE_2 )) # Start the sensor sensor.start() # Get a single frame of data data = sensor.get_next() # Process the data (e.g., print the first 10 values) print(data.data[:10]) # Stop the sensor sensor.stop() if __name__ == '__main__': main() ``` -------------------------------- ### A121 Algo Cargo Example App Script Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/exploration_tool/example_scripts/cargo/examples-a121-algo-cargo-example_app.rst This script demonstrates the usage of the A121 algorithm with Cargo. It includes setup, data processing, and output functionalities. ```python import argparse import json import logging import sys from acconeer.excit import list_devices, Device from acconeer.excit.algo.a121.algo import Algo from acconeer.excit.algo.a121.algo.common import AlgoError logging.basicConfig(level=logging.INFO) def main(): parser = argparse.ArgumentParser( description="Example app for A121 algo" ) parser.add_argument( "--device", default="/dev/ttyACM0", help="Device to connect to. Default: /dev/ttyACM0", ) parser.add_argument( "--config", default=None, help="Path to configuration file. Default: None", ) parser.add_argument( "--output", default=None, help="Path to output file. Default: None", ) args = parser.parse_args() try: device = Device(args.device) except Exception as e: logging.error(f"Could not connect to device: {e}") sys.exit(1) try: if args.config: with open(args.config, "r") as f: config = json.load(f) else: config = {} algo = Algo(device, config) # Example of how to get data from the algo # This is a simplified example, in a real application you would # likely want to process data in chunks or use a streaming API. data = algo.get_data() if args.output: with open(args.output, "w") as f: json.dump(data, f) else: print(json.dumps(data, indent=2)) except AlgoError as e: logging.error(f"Algo error: {e}") sys.exit(1) except Exception as e: logging.error(f"An unexpected error occurred: {e}") sys.exit(1) if __name__ == "__main__": main() ``` -------------------------------- ### A121 Vibration Example App Script Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/exploration_tool/example_scripts/vibration/examples-a121-algo-vibration-example_app.rst This script demonstrates a full application flow for vibration analysis using the A121 sensor. It includes setup, data acquisition, and processing. ```Python import numpy as np from acconeer.exciters import Exciter from acconeer.exciters.configs import ExciterConfig from acconeer.exciters.plugins.algo.vibration import Vibration from acconeer.exciters.plugins.algo.vibration.configs import VibrationConfig from acconeer.exciters.plugins.algo.vibration.utils import get_sensor_data def main(): # Configuration exciter_config = ExciterConfig() exciter_config.sensor_id = 0 exciter_config.frequency_mhz = 6000 exciter_config.processing_timeout = 1000 exciter_config.max_subsweeps = 16 exciter_config.max_subsweep_length = 128 vibration_config = VibrationConfig() vibration_config.sample_rate = 1000 vibration_config.window_size = 1000 vibration_config.threshold = 0.5 # Initialize Exciter and Vibration Algorithm exciter = Exciter(exciter_config) vibration = Vibration(vibration_config) # Get sensor data sensor_data = get_sensor_data(exciter, vibration) # Process sensor data result = vibration.process(sensor_data) # Print results print(f"Vibration detected: {result['vibration_detected']}") print(f"Vibration level: {result['vibration_level']:.2f}") if __name__ == "__main__": main() ``` -------------------------------- ### A121 Tank Level Algorithm Example Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/exploration_tool/example_scripts/tank_level/examples-a121-algo-tank_level-tank_level.rst This script demonstrates how to use the A121 sensor with the tank level algorithm. It requires the necessary sensor setup and data processing logic. ```python import acconeer.ex તેના as ea import numpy as np def main(): args = ea.ExampleArgumentParser().parse_args() with ea.Client(args.log_level) as client: info = client.get_info() print(f"Using A121 sensor with SN: {info['serial_number']}") sensor_config = ea.SensorConfig() sensor_config.sub_sweep.set_all(True) sensor_config.set_sweep_rate(1000) # Tank level algorithm configuration tank_level_config = ea.algo.TankLevel.Config() tank_level_config.sensor_config = sensor_config tank_config = ea.algo.TankLevel(sensor_config=tank_level_config) # Example of how to get data from the sensor and process it # This part would typically involve a loop to continuously acquire data # For demonstration, we'll simulate a single data acquisition # Example: Configure and start a single acquisition # Note: Actual data acquisition would be within a loop or a streaming context # This is a placeholder to show the algorithm's usage # Example of processing a single frame of data (replace with actual data) # For a real scenario, you would get data from client.get_next().data # Example simulated data: # simulated_data = np.random.rand(100) * 100 # Replace with actual sensor data # processed_data = tank_config.process_data(simulated_data) # print(f"Processed tank level data: {processed_data}") print("Example script finished.") if __name__ == '__main__': main() ``` -------------------------------- ### Run Exploration Tool App with Plugin specifying full module Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/exploration_tool/adding_your_own_plugin.rst Launches the Exploration Tool App, loading a custom plugin by specifying its full module path. ```bash python -m acconeer.exptool.app.new --plugin-module examples.app.new.plugins.my_plugin ``` -------------------------------- ### A121 Record Data Barebones Python Script Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/exploration_tool/example_scripts/python_api/examples-a121-record_data-barebones.rst This script provides a fundamental example of how to record data using the A121 sensor. Ensure the necessary libraries are installed and the sensor is connected. ```python import acconeer.ex蔣.a121 import numpy as np # Configuration # Sensor setup sensor = acconeer.ex蔣.a121.Sensor() # Record data # Cleanup sensor.destroy() ``` -------------------------------- ### ExampleAppConfig Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/example_apps/a121/surface_velocity.rst Configuration parameters for the surface velocity example application. ```APIDOC ## acconeer.exptool.a121.algo.surface_velocity._example_app.ExampleAppConfig ### Description Configuration parameters for the surface velocity example application. ### Parameters This class has no explicit parameters documented in the source. ``` -------------------------------- ### A121 Record Data with CLI Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/exploration_tool/example_scripts/python_api/examples-a121-record_data-with_cli.rst This Python script demonstrates how to record data from the A121 sensor using command-line arguments. It requires the 'acconeer' library to be installed. Ensure you have the necessary sensor setup before running. ```python import argparse import sys from acconeer.ex απορρήτων import client, configs def main(): parser = argparse.ArgumentParser(description='Record data from A121 sensor.') parser.add_argument('output_file', type=str, help='Path to the output file for recorded data.') parser.add_argument('--record-time', type=float, default=10.0, help='Duration in seconds to record data.') parser.add_argument('--rate', type=float, default=1000.0, help='Data rate in Hz.') parser.add_argument('--range-interval', type=float, nargs=2, default=[100, 1000], help='Range interval in mm [start, end].') parser.add_argument('--gain', type=int, default=20, help='Gain value.') parser.add_argument('--power-save', action='store_true', help='Enable power save mode.') args = parser.parse_args() # Create a client client_ = client.Client() # Configure the sensor config = configs.Setup112() # Use Setup112 for A121 config.range_interval = args.range_interval config.gain = args.gain config.power_save = args.power_save # Create a recorder recorder = client_.record_data(args.output_file, config=config, record_time=args.record_time, rate=args.rate) # Start recording print(f'Recording data to {args.output_file} for {args.record_time} seconds...') recorder.start() recorder.wait_for_record_end() print('Recording finished.') if __name__ == '__main__': main() ``` -------------------------------- ### A121 Phase Tracking Algorithm Script Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/exploration_tool/example_scripts/phase_tracking/examples-a121-algo-phase_tracking-phase_tracking.rst This Python script demonstrates the phase tracking algorithm for the A121 sensor. It includes sensor setup, algorithm configuration, and data processing. View the full example on GitHub. ```python import numpy as np from acconeer.ex તેના_tools.a121.algo.phase_tracking import PhaseTracking from acconeer.ex તેના_tools.utils.math import unwrap_phase def main(): # TODO: Add sensor setup and configuration here # Example placeholder for sensor data # Replace with actual sensor data acquisition num_frames = 100 num_subsweeps = 16 num_points = 128 # Simulate some phase data with noise and drift true_phase = np.linspace(0, 10 * np.pi, num_frames) noise = np.random.normal(0, 0.1, (num_frames, num_subsweeps, num_points)) simulated_phase = true_phase[:, np.newaxis, np.newaxis] + noise # Unwrap phase data (example) unwrapped_phase = unwrap_phase(simulated_phase) # Initialize PhaseTracking algorithm # TODO: Configure parameters based on sensor setup and application needs phase_tracker = PhaseTracking( num_subsweeps=num_subsweeps, num_points=num_points, sampling_frequency=1000, # Example sampling frequency filter_bandwidth=100, # Example filter bandwidth max_phase_deviation=np.pi # Example max phase deviation ) # Process the unwrapped phase data # The output will contain estimated phase, frequency, and other metrics # TODO: Adapt this loop to process actual sensor frames for frame_idx in range(num_frames): # In a real scenario, you would get data from the sensor here # For simulation, we use the pre-generated unwrapped_phase current_frame_phase = unwrapped_phase[frame_idx, :, :] # Update the phase tracker with the current frame's data # The tracker will internally manage state and provide estimates phase_tracker.update(current_frame_phase) # Get the latest estimates from the tracker # These estimates can be used for further analysis or control estimated_phase = phase_tracker.estimated_phase estimated_frequency = phase_tracker.estimated_frequency # Print or log the estimates (optional) # print(f"Frame {frame_idx}: Est. Phase = {estimated_phase:.4f}, Est. Freq = {estimated_frequency:.4f}") # After processing all frames, you can access final estimates or statistics final_estimated_phase = phase_tracker.estimated_phase final_estimated_frequency = phase_tracker.estimated_frequency print("\nPhase Tracking complete.") print(f"Final Estimated Phase: {final_estimated_phase:.4f}") print(f"Final Estimated Frequency: {final_estimated_frequency:.4f}") if __name__ == "__main__": main() ``` -------------------------------- ### Run Exploration Tool Application with uvx on Windows Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/getting_started/setting_up_and_running_et.rst Execute the Exploration Tool application using 'uvx' after installing 'uv'. ```bash uvx acconeer-exptool[app] ``` -------------------------------- ### Install libgpiod2 dependency Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/a111/evk_setup/raspberry_a111.rst Install the `libgpiod2` package, which is a requirement for SDK versions 2.8.0 and newer. This command updates the package list and then installs the specified package. ```bash sudo apt update sudo apt install libgpiod2 ``` -------------------------------- ### Start New Exploration Tool Application Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/getting_started/setting_up_and_running_et.rst Launch the new version of the Exploration Tool directly using this command. ```python python -m acconeer.exptool.app.new ``` -------------------------------- ### Run Exploration Tool App with Plugin by changing directory Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/exploration_tool/adding_your_own_plugin.rst Launches the Exploration Tool App, loading a custom plugin after changing the current directory to the plugin's module location. ```bash cd examples/app/new/plugins python -m acconeer.exptool.app.new --plugin-module my_plugin ``` -------------------------------- ### Install 32-bit binary support on 64-bit Raspberry Pi OS Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/a111/evk_setup/raspberry_a111.rst Enable support for 32-bit binaries on a 64-bit Raspberry Pi OS installation. This involves adding the `armhf` architecture and installing the necessary 32-bit libraries. ```bash sudo dpkg --add-architecture armhf sudo apt update sudo apt install libc6:armhf libgpiod2:armhf ``` -------------------------------- ### My Plugin Example Script Source: https://github.com/acconeer/acconeer-python-exploration/blob/master/docs/exploration_tool/example_scripts/app/examples-app-new-plugins-my_plugin.rst This Python script defines a sample plugin for the Acconeer exploration tool. It includes necessary imports and a basic plugin structure. ```python import numpy as np from acconeer.excd.plugins.plugin import Plugin from acconeer.excd.plugins.plugin import PluginEncoder class MyPlugin(Plugin): def __init__(self, name, config=None): super().__init__(name, config) def process_data(self, data): return np.mean(data) class MyPluginEncoder(PluginEncoder): def __init__(self): super().__init__() def encode(self, obj): if isinstance(obj, MyPlugin): return { "name": obj.name, "config": obj.config, } return super().encode(obj) ```