Work in progress: this documentation is still being written and reviewed. Check details against the source code.

EPICS value service

Expose an EPICS PV read as a ROS Trigger service. Each request performs caget on demand and returns a string representation rather than a typed measurement; main has no explicit cleanup.

bluesky_ros.pv_service Β· Source

Clients and integrations Β· Guide Β· Symbol index

How it is used

Start this adapter with the EPICS PV name as its positional argument. main() creates PVService; ROS invokes on_request() whenever a client calls the relative get_pv Trigger service. Each request performs a fresh synchronous PV read.

The response places the value in the message string. A non-None value means success; clients must parse the string themselves if they need a typed measurement.

Start here

Callable

Purpose

main

Require a positional PV name, initialize ROS and spin a new PVService indefinitely.

PVService.on_request

Read the PV synchronously, mark success for any non-None value and place str(value) in the response.

Functions

main()

Require a positional PV name, initialize ROS and spin a new PVService indefinitely.

Entry point Β· Source

main()

Returns: No ordinary return until spin exits; missing argument exits with usage text.

Errors: No interrupt/exception cleanup handler.

Side effects: Starts ROS and a service; does not explicitly destroy node/shut down ROS on exit.

PVService

Serve on-demand EPICS reads through a ROS Trigger service, retaining the configured PV name between requests.

Inherits from: Node.

PVService.on_request()

Read the PV synchronously, mark success for any non-None value and place str(value) in the response.

Callback Β· Source

on_request(self, request, response)

Parameter

Meaning

request

Trigger request; unused.

response

Mutable Trigger response supplied by rclpy.

Returns: The same response with success and message set; None reads become success=False/message=”None”.

Errors: EPICS exceptions propagate; no custom timeout or numeric validation.

Side effects: Performs an EPICS network read and mutates the response.

Referenced in source (1)

PVService.__init__()

Create pv_service, retain the EPICS PV name and register relative get_pv Trigger service.

Lifecycle Β· Source

__init__(self, pvname)

Parameter

Meaning

pvname

EPICS process-variable name passed later to epics.caget.

Errors: ROS service creation errors propagate.

Side effects: Registers a ROS service and logs its PV mapping; does not read the PV yet.

Referenced in source (1)
  • main β€” bluesky_ros.pv_service