How does FlexBe conccurrent container work (in terms of state lifecycle)?
I haven't been able to find the answer to what I am facing in the tutorials. Let me explain briefly what I am trying to do. I have 2 states : StartSewing and ExecTraj in a concurrent container
In StartSewing, I have the following piece of 'blocking code' in the execute() function :
def execute(self, userdata):
self.success = sewing_machine_control_client(userdata.low_speed, userdata.high_speed, userdata.presser_foot, userdata.trim_thread)
return 'continue'
This (sewing_machine_control_client) is a wrapper function around a call to a rosservice.
In ExecTraj, I have the following piece of code :
def execute(self, userdata):
self.robot.load_cartesian_trajectory(os.environ['HOME'] + "/training_ws/src/robot_arm_control-master/config/saved_trajectories/" + userdata.traj_filename, wait_for_exec=True)
return 'continue'
And again, this is a wrapper function and is also a blocking code, it eventually leads to this recognizable piece of code to Moveit users :
self.move_group.execute(loaded_plan, wait=wait_for_exec)
My colleague who has worked with SMACH tells me that concurrent containers are supposed to run all states inside them simultaneously. But that doesn't seem to happen here. From my observation so far, one of the states' execute() is called first and then the other state's execute() is called.
Anyone else facing the same issue? Instead of multithreading, is it more of context-switching that is taking place here?
Thank you for the question. Added more points so you can share pictures.
Please don’t consider this an answer just a comment. Flexbe offers concurrency http://wiki.ros.org/flexbe/Tutorials/...
You may also look into SMACC written in C++
I have gone over that tutorial. It doesnt seem to have the answer.