You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to Behavior Tree application. My question might be a basic one.
Excuse me for my poor English.
Background:
Currently I am working in a Message driven robotic application. It means, it is not a sequential programmed application. It has lots of messages(consider some 100 messages) defined and there would be handlers associated to each message. The message management in our application is being managed by the proprietary execution engine. So, it is responsible for that engine to trigger the respective handler, whenever a message is published. It is similar to our event driven application, where event handler will be triggered whenever that particular event is triggered.
This application is designed to be a Hierarchical state machine, which has around 35 state and Sub-state combinations and more than 300 state transition points among them. Implementation of above message handlers will be there in all applicable state. This enables to have different behavior, based on current state for each incoming messages.
For example, consider the case of a 'pick and place turtlebot' robot which has 3 valid states-IDLE, NAVIGATING, PICK_AND_PLACE, RETURNING_TO_HOME. Consider there is a message called "Pause" which has a handler registered with name-"HandlePause()". As per the current state machine based implementation, This HandlePause has different implementation based on current state. Consider in our case, its behavior are as follow.
IDLE->HandlePause: Ignore the message. No action needed
NAVIGATING->HandlePause: save the goal location and the task details and go to pause the current action
PICK_AND_PLACE->HandlePause: If the item is picked, place it in a safe location and pause the action. If item is not picked, pause the current action
RETURNING_TO_HOME->HandlePause: Save the home location and pause the current action.
Similar to above example, each message handlers will have multiple behavior based on current state.
I am thinking to switch to Behavior Tree from state machine. As my internal execution engine can take responsibility until the handler trigger part, I am thinking to have one individual Behavior Tree for each of the handler function and all robot properties will be stored in a common class which can be accessible by all handler trees. So, 100 handler function would have 100 trees and inside each tree there will be logic to execute the behavior and all trees are operated using tickOnce stategy. There is no requirement for periodical ticks.
My Queries:
Is it a right design to have individual behavior tree for each of these handlers? what will be it side effect? will be create any concurrency issues? Is it a resource intensive?
How the concept of 'states' needs to be looked from Behavior tree perspective? Should I to maintain the state details as a flag or in a enumeration variable?
As per my understanding, it is better to design each state as a separate class in Behavior Tree and respective handler implementation should go inside that. If I am doing this, I feel like I am still coming back to state machine implementation. I am not sure, how this implementation is different from regular state machine?
Any suggestion on some similar real world robotic application projects(Open Source) based on the Behavior Tree to refer could be a great help.
Thanks for your time. Thanks for helping with this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am new to Behavior Tree application. My question might be a basic one.
Excuse me for my poor English.
Background:
Currently I am working in a Message driven robotic application. It means, it is not a sequential programmed application. It has lots of messages(consider some 100 messages) defined and there would be handlers associated to each message. The message management in our application is being managed by the proprietary execution engine. So, it is responsible for that engine to trigger the respective handler, whenever a message is published. It is similar to our event driven application, where event handler will be triggered whenever that particular event is triggered.
This application is designed to be a Hierarchical state machine, which has around 35 state and Sub-state combinations and more than 300 state transition points among them. Implementation of above message handlers will be there in all applicable state. This enables to have different behavior, based on current state for each incoming messages.
For example, consider the case of a 'pick and place turtlebot' robot which has 3 valid states-IDLE, NAVIGATING, PICK_AND_PLACE, RETURNING_TO_HOME. Consider there is a message called "Pause" which has a handler registered with name-"HandlePause()". As per the current state machine based implementation, This HandlePause has different implementation based on current state. Consider in our case, its behavior are as follow.
IDLE->HandlePause: Ignore the message. No action needed
NAVIGATING->HandlePause: save the goal location and the task details and go to pause the current action
PICK_AND_PLACE->HandlePause: If the item is picked, place it in a safe location and pause the action. If item is not picked, pause the current action
RETURNING_TO_HOME->HandlePause: Save the home location and pause the current action.
Similar to above example, each message handlers will have multiple behavior based on current state.
I am thinking to switch to Behavior Tree from state machine. As my internal execution engine can take responsibility until the handler trigger part, I am thinking to have one individual Behavior Tree for each of the handler function and all robot properties will be stored in a common class which can be accessible by all handler trees. So, 100 handler function would have 100 trees and inside each tree there will be logic to execute the behavior and all trees are operated using tickOnce stategy. There is no requirement for periodical ticks.
My Queries:
Thanks for your time. Thanks for helping with this.
Beta Was this translation helpful? Give feedback.
All reactions