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 |
|---|---|
Require a positional PV name, initialize ROS and spin a new PVService indefinitely. |
|
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 |
|---|---|
|
Trigger request; unused. |
|
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__β bluesky_ros.pv_service
PVService.__init__()ο
Create pv_service, retain the EPICS PV name and register relative get_pv Trigger service.
Lifecycle Β· Source
__init__(self, pvname)
Parameter |
Meaning |
|---|---|
|
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