Skip to content

carologistics/flexitino

Repository files navigation

FlexBE States and Behaviors for caro_skills

Generic template for a behaviors repository to be used for new projects

Modify this README as needed for your specific project details.

Below we provide basic details, but you are free to delete or modify this README as you wish.


This raw repository has several folders and files with the generic name caro_skills.

This repository is used by the FlexBE widget create_repo script to create an example project that you can build off of to add your own states and behaviors.

Using ros2 run flexbe_widget create_repo <my_new_project_name> will clone this repository, and change the relevant caro_skills text to my_new_project_name as needed.

It sets up the package.xml files with proper FlexBE export tags. It is maintained at version 0.0.1 as the starting point for your work.

We have provided a license file to conform to ROS guidelines; however, you are free to replace the LICENSE file, and apply whatever license you choose to states and behaviors that you create.

This repository contains an example behavior and examples for writing your own state implementations.

Example States in caro_skills_flexbe_states

Packages providing FlexBE states are identified by an export tag in the package.xml:

  <export>
      <flexbe_states />
      <build_type>ament_cmake</build_type>
  </export>
  • example_state.py

    • Example state implementation with extra console logging to show the state life cycle.
  • example_action_state.py

Note: These example states are defined with extra console logging that is useful when learning FlexBE, but you will typically not include so much of the Logger.info commands as in these examples.

Note: You are free to copy and modify these files to create your own files and publish under your own license terms. As per the existing licenses, no warranty is implied.

Example Behaviors in caro_skills_flexbe_behaviors

Packages providing FlexBE behaviors are identified by an export tag in the package.xml:

  <export>
      <flexbe_behaviors />
      <build_type>ament_cmake</build_type>
  </export>
  • example_behavior_sm.py

    • Most basic example state machine
  • example_action_behavior_sm.py

    • Uses the ExampleActionState with the standard action tutorials

      Understanding ROS2 Actions

      Introducing Turtlesim

      To execute the associated behavior in FlexBE, you need to first run the turtlesim node that provdes the action server

      ros2 run turtlesim turtlesim_node

      To display the available actions:

      ros2 action list

      The action is defined by:

      /turtle1/rotate_absolute: turtlesim/action/RotateAbsolute

Behaviors typically edited and generated by the FlexBE UI.
These generated files are stored in the root workspace install folder. Presuming a WORKSPACE_ROOT environment variable exists, we provide a simple copy_behavior script to copy a saved behavior — both the Python implementation and manifest .xml file — to the project source folder for long term storage. Use ros2 run caro_skills_flexbe_behavior copy_behavior to see the usage guide. The script should be run from this repository's base folder.

For a Quick-start and more comprehensive introduction to FlexBE, see the FlexBE Turtlesim Demonstrations.

Our instructions:

start WebUI:

ros2 launch flexbe_webui flexbe_ocs.launch.py headless:=True

ros2 run flexbe_webui webui_client

ros2 launch flexbe_onboard behavior_onboard.launch.py

start behavior without WebUI:

requires flexbe_behavior_engine to be on carologistic's fork on branch mtschesche/action_server_jazzy

ros2 launch flexbe_onboard behavior_onboard.launch.py

ros2 run flexbe_widget be_action_server

example:

ros2 action send_goal /flexbe/execute_behavior flexbe_msgs/action/BehaviorExecution "{behavior_name: 'MoveTo', input_keys: ['frame_id','target_x','target_y','target_yaw'], input_values: ['map','3.0','4.5','1.0']}"

Releases

No releases published

Packages

No packages published