yasmin_demos.action_client_demo module
- class yasmin_demos.action_client_demo.FibonacciState(*args: Any, **kwargs: Any)
Bases:
ActionState
Class representing the state of the Fibonacci action.
Inherits from ActionState and implements methods to handle the Fibonacci action in a finite state machine.
- Attributes:
None
- create_goal_handler(blackboard: yasmin.Blackboard) example_interfaces.action.Fibonacci.Goal
Creates the goal for the Fibonacci action.
This method retrieves the input value from the blackboard and populates the Fibonacci goal.
- Parameters:
blackboard (Blackboard): The blackboard containing the state information.
- Returns:
Fibonacci.Goal: The populated goal object for the Fibonacci action.
- Raises:
KeyError: If the expected key is not present in the blackboard.
- print_feedback(blackboard: yasmin.Blackboard, feedback: example_interfaces.action.Fibonacci.Feedback) None
Prints feedback from the Fibonacci action.
This method logs the partial sequence received during the action.
- Parameters:
blackboard (Blackboard): The blackboard (not used in this method). feedback (Fibonacci.Feedback): The feedback object from the Fibonacci action.
- Returns:
None
- Raises:
None
- response_handler(blackboard: yasmin.Blackboard, response: example_interfaces.action.Fibonacci.Result) str
Handles the response from the Fibonacci action.
This method processes the result of the Fibonacci action and stores it in the blackboard.
- Parameters:
blackboard (Blackboard): The blackboard to store the result. response (Fibonacci.Result): The result object from the Fibonacci action.
- Returns:
str: Outcome of the operation, typically SUCCEED.
- Raises:
None
- yasmin_demos.action_client_demo.main()
Main function to execute the ROS 2 action client demo.
This function initializes the ROS 2 client, sets up the finite state machine, adds the states, and starts the action processing.
- Parameters:
None
- Returns:
None
- Raises:
KeyboardInterrupt: If the user interrupts the execution.
- yasmin_demos.action_client_demo.print_result(blackboard: yasmin.Blackboard) str
Prints the result of the Fibonacci action.
This function logs the final result stored in the blackboard.
- Parameters:
blackboard (Blackboard): The blackboard containing the result.
- Returns:
str: Outcome of the operation, typically SUCCEED.
- Raises:
None