Note: This tutorial assumes that you have completed the previous tutorials: Creating nodes with BRIDE.
(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Creating ROS coordinators BRIDE

Description: In this small tutorial you will learn how to create ROS coordinators with BRIDE.

Tutorial Level: BEGINNER

Next Tutorial: Creating ROS systems with BRIDE

Create new project and coordinator model

Create a new ROS Project named behaviour. If you're not sure how to create a ros project you can look it up in the previous tutorial. Set your project's name to behaviour and finish the creation wizard. Create a new coordinator model in the model folder and by right clicking on it and selecting New -> Other and then ROS Coordinator Diagram from the BRIDE section (note the difference to ROS Package Diagram). Name the your diagramms behaviour.ros_coordinator_diagram and behaviour.ros_coordinator respectively. You should now see an empty ros_coordinator_diagram editor.

Creating the coordinator for the tutorial

Using the palette on the right hand side create a StateMachine and name it tutorial_behaviour. The area of the state machine may be very limited, so expand it to be about the size of the state machine in the screenshot below. Next add an ActionState and name it TriggerPublisher. Now create both an InitialState and a FinalState. In order to connect the initial state and the final state with the action state, you have to click on the correspoding state (possibly multiple times) until you see the two little arrows next to the bounding box.

Connector for states

Select the outgoing arrow and drag it onto the action state. You should now see a link connecting the initial state and the action state labeled SUCCEEDED (see screenshot below). Proceed the same way with the final state but this time be sure to grab the incoming arrow instead of the outgoing arrow. Finally your interface should resemble this screenshot:

coordinator diagram in BRIDE

The properties of the coordinator package (selectable by clicking the free space around the state machine) should be as shown below:

CoordinatorPackageProperties

Update properties of the ActionState to match the properties below. Note that changing the value of Action Type may take a second.

CoordinatorActionProperties

Generate Coordinator Code

You can now generate the code for the coordinator by selecting BRIDE -> ROS -> Generate Coordinator for ROS system. By refreshing the Package in the workspace view on the left you should see the generated files. As the coordinator is implemented in python compiling the coordinator is not necessary.

To see the coordinator in use you continue with the system creation tutorial.

Wiki: bride/Tutorials/Creating-ros-coordinators-with-bride (last edited 2014-07-15 08:41:06 by janFischer)