Robotics StackExchange | Archived questions

Define states in smach_ros with topics

Hi everyone,

I am working with smach_ros and I have done a .cpp that reads the keyboard and allows me to change the state. However, the function monitorState only allows me to return a bool value (True or False) and I need more options since there are some states that have five possible transitions.

Here I give an example of what I have and what I want.

def monitor_prueba(ud, msg): if Bool.data == 1: return False elif Bool.data == 2: return True

def monitor_prueba(ud, msg): if Bool.data == 1: return OTHERVALUE elif Bool.data == 2: return OTHERVALUE

Thank you.

Asked by Javier Fernandez Fernandez on 2017-03-02 13:54:53 UTC

Comments

Answers