Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to execute multiple instances of the same FlexBE behavior #45

Open
josephcoombe opened this issue Dec 6, 2017 · 3 comments
Open

Comments

@josephcoombe
Copy link

I made a FlexBE behavior to control an arm.
I can run this behavior with no problems using roslaunch like so:

<node name="right_arm" pkg="flexbe_widget" type="be_launcher" output="screen"  
           args="-b centipede_two_dof_leg
                      side:='right'
                      shoulder_topic:='a' elbow_topic:='b' wrist_topic:='c'  
                      pos_cmd_topic:='c' " 
/>  

However, I'd like to start two instances of this behavior (one for each arm) like so:

<node name="right_arm" pkg="flexbe_widget" type="be_launcher" output="screen"  
           args="-b centipede_two_dof_leg
                      side:='right'
                      shoulder_topic:='a' elbow_topic:='b' wrist_topic:='c'  
                      pos_cmd_topic:='c' " 
/>  
<node name="left_arm" pkg="flexbe_widget" type="be_launcher" output="screen"  
           args="-b centipede_two_dof_leg
                      side:='left'
                      shoulder_topic:='d' elbow_topic:='e' wrist_topic:='f'  
                      pos_cmd_topic:='g' " 
/>  

This does not work and I get the following errors in my roslaunch flexbe_onboard behavior_onboard.launch terminal:

[ERROR] [1512581009.381507]: InvalidStateError: Attempting to close a container that is not currently open.
[ERROR] [1512581009.434119]: Behavior construction failed!
Attempting to close a container that is not currently open.
[ERROR] [1512581009.484774]: Dropped behavior start request because preparation failed.

Is this intended behavior? If yes, what would be the best way to accomplish the same effect using FlexBE

Thank you!

@pschillinger
Copy link
Member

pschillinger commented Dec 7, 2017 via email

@ksm0709
Copy link
Contributor

ksm0709 commented Nov 8, 2018

@josephcoombe I found the solution, separate namespace with <group ns=""> tag.

<group ns="example">
    <include file="$(find flexbe_widget)/launch/behavior_ocs.launch">
		<arg name="ns" value="example" />
		<arg name="port" value="9090" />
    </include>
    <include file="$(find flexbe_onboard)/launch/behavior_onboard.launch" />
    <node name="flexbe_launcher" pkg="flexbe_widget" type="be_launcher" args="-b Example_Behavior"/>      
</group>

<group ns="nav">
    <include file="$(find flexbe_widget)/launch/behavior_ocs.launch">
		<arg name="ns" value="nav" />
		<arg name="port" value="9091" />
    </include>
    <include file="$(find flexbe_onboard)/launch/behavior_onboard.launch" />
    <node name="flexbe_launcher" pkg="flexbe_widget" type="be_launcher" args="-b navigation_state_machine"/>
</group>

@manox
Copy link

manox commented Mar 1, 2019

Is this also possible with two FlexBE app instances (running on one PC) monitoring two behaviors on two robots?
The two Robots are different ROS_MASTERS and I also tried different namespaces, but if I launch the second FlexBE app on the PC, both FlexBE app instances freeze.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants