Sample pick and place servers
Serve sample pick and place actions with a shared one-goal limit. Perception settings are loaded from the beamline configuration when needed.
beambot.action_servers.sample_pick_place_server · Source
Tools and end effectors · Guide · Symbol index
How it is used
This module serves the dedicated pick/place action types. The orchestrator uses these endpoints for nonvision sample tasks; the endpoints also retain their own vision modes. The generic VisionTaskAction path is implemented separately in vision_task_server.py.
create_stages() builds both pick and place stages. _execute() handles pick results through the base class, while _execute_place() completes place goals directly; both endpoints share one busy reservation.
Start here
Callable |
Purpose |
|---|---|
Run SampleActionServer through the shared multithreaded ROS server runner. |
|
Load camera settings and construct place stages alongside the pick stages returned to the base server. |
|
Run pick stages and copy success, unchecked vacuum_ok and any computed approach pose into the result. |
|
Run place stages, populate the approach pose when available, finalize success/abort directly and release the shared reservation in finally. |
Functions
main()
Run SampleActionServer through the shared multithreaded ROS server runner.
Entry point · Source
main(args=None)
Parameter |
Meaning |
|---|---|
|
Optional ROS initialization arguments; None uses normal rclpy argument handling. |
Returns: None when the server exits.
Errors: KeyboardInterrupt during spin is handled by run_server; initialization/construction and other executor errors propagate.
Side effects: Initializes ROS, constructs the action node, spins until shutdown and destroys the node/context.
SampleActionServer
Two action endpoints sharing one busy reservation in the default callback group. It owns separate pick and place stage objects and copies their computed approach poses into action results.
Inherits from: BaseActionServer.
SampleActionServer.create_stages()
Load camera settings and construct place stages alongside the pick stages returned to the base server.
Extension hook · Source
create_stages(self)
Returns: PickSampleStages instance; stores PlaceSampleStages on _place_stages.
Errors: Beamline load and stage initialization errors propagate.
Side effects: Reads cached configuration, initializes both stage objects and logs camera settings; cameras remain lazy in those stages.
SampleActionServer._execute()
Run pick stages and copy success, unchecked vacuum_ok and any computed approach pose into the result.
Extension hook · Source
_execute(self, goal_handle)
Parameter |
Meaning |
|---|---|
|
Accepted PickSampleAction handle. |
Returns: PickSampleAction.Result with metre XYZ and XYZW quaternion when an approach is available.
Errors: Stage exceptions propagate to the base execution wrapper; stage error strings produce failed results.
Side effects: Performs pick motion/perception; base wrapper finalizes ROS goal status.
SampleActionServer._execute_place()
Run place stages, populate the approach pose when available, finalize success/abort directly and release the shared reservation in finally.
Callback · Source
_execute_place(self, goal_handle)
Parameter |
Meaning |
|---|---|
|
Accepted PlaceSampleAction handle. |
Returns: PlaceSampleAction.Result with success/error and optional metre XYZ/XYZW quaternion.
Errors: Stage exceptions propagate: this direct callback has finally cleanup but no exception-to-result handler.
Side effects: Performs place motion/perception, sets goal status on normal completion and clears _executing even on exception.
Referenced in source (1)
SampleActionServer.__init__— beambot.action_servers.sample_pick_place_server
SampleActionServer.__init__()
Register pick through BaseActionServer, then add a place endpoint using the same admission callback and busy flag.
Lifecycle · Source
__init__(self)
Errors: Configuration/stage/action initialization errors propagate.
Side effects: Creates beambot_pick_sample and beambot_place_sample action servers and both stage objects.