simulation with smach
I am using smach to define missions which are executed by a robot. I am both using states specifically designed for the smach plan and SimpleActionStates to use predefined actionlib actions. Currently I am want to simulate my smach plan without actually having connection to the robot. The problem is that in the simulation mode some nodes and some action servers which are called as SimpleActionStates are not running. So the simulation works perfectly for the visualisation of the robot movements but when trying to use the SimpleActionState e.g. for opening the gripper it fails or rather gets trapped in waiting for the action server. Is it possible to automatically skip these SimpleActionStates under certain conditions? (Set them succeeded without even trying to call the action server or something like this.) These states are not needed for the simulation but they disrupt the simulation of the usual mission. My only idea so far to bypass this issue is to add an userdata input to every non SimpleActionState who sets the outcome to "simulation" if needed. Than for the critical parts the transition for the simulation outcome could be defined to skip all SimpleActionStates and continue with the next state which is useable for the simulation. However this doesn't seem like an elegant solution and I am wondering if there are any other options. Thank you in advance for all tipps and suggestions!!
Would creating some 'fake' actionservers not be possible?
We've done this in just about all our systems: whenever there is no need for the real hw to be present, create a mock implementation that returns the appropriate data.
That's not even new/inventive: just applying an existing pattern.
For my own action servers that's easily done. However, I am struggling to do this for action servers defined in other packages. When trying to define action servers locally with the same name I get the error "node name cannot contain a namespace".