Add StateMachine object in concurrent container
Greetings,
I am currently trying to write a state machine with smach for a robot, including a safety fuction, where the activity of the robot should be preempted, once a specific message is sent to a certain topic. I tried to modify the example using monitor state and concurrent container: http://wiki.ros.org/mysmach/Tutorials... . My idea was to replace the FOO_CALC state with the state machine of my robot, that is nested in the concurrent container. My code reads as the following: https://github.com/Mrkeyiiii/ROS_Lear...
After rosrun one would get the following message: TypeError: 'StateMachine' object is not callable. I wonder whether there is any work-around for this problem?
PS: It's my first time to ask a question in this platform and I am not sure whether I am doing it correctly. Please let me know if there is anything that I could improve. Many thanks in advance!
Edited: Added error code:
[ERROR] [1552331031.713732]: Error raised during SMACH container construction:
Traceback (most recent call last):
File "/home/qi/catkin_ws/src/example0/src/safety.py", line 134, in main
smach.Concurrence.add('FOO_CALC', sm_sub())
TypeError: 'StateMachine' object is not callable
Traceback (most recent call last):
File "/home/qi/catkin_ws/src/example0/src/safety.py", line 150, in <module>
main()
File "/home/qi/catkin_ws/src/example0/src/safety.py", line 134, in main
smach.Concurrence.add('FOO_CALC', sm_sub())
TypeError: 'StateMachine' object is not callable
Can you please update your question with a copy and paste of the full error and your code?
Hi, thanks for your reply, please check the updated question :D