Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A description of the functions in the module is given:

...

FunctionDescription
emotionalcallback
Callback for the subscriber to topic

...

/

...

cyborgcontroller/emotional_

...

state. Updates the modules emotional state variable when a message is received.
callback_command_location

...

Callback for subscriber to topic /cyborg_behavior/command_location. Updates the modules commandlocation_ variable when a message is received.
server_behavior_callback

...

Callback for the /cyborg_behavior action server. When an action goal is received, the callback checks if the requested preset exists, first by appending the name of the behavioral state to the name, and then without if no preset for that particular emotional state is found. If no preset at all is found, the callback sets the server state as aborted and returns. If the name of the requested preset is found, the enter and execute_behavior functions are executed in sequence.
enter

...

Executed by server_behavior_callback. Retrieves parameters for the behavioral presets and updates the corresponding variables in the module. If the preset involves navigation, an action client for the navigation modules action server is instantiated.
execute_behavior

...

Executed by server_behavior_callback. Activates the different output modules, for the navigation module it sends navigation goal, while for the audio and visual module, commands are published on their respective topics. The function checks the behavior_finished variable to see if the behavior is finished, the state of the navigation server when it is used, and for preemption request from the module using the behavior action server. If navigation or the behavior server is preempted, a preemption command is sent to audio modules utilized in the current preset. When the behavior is finished, send_emotion is used to provide emotional feedback to the Cyborg controller.
callback_dynamic_behavior

...

Callback for the topic /cyborg_behavior/dynamic_behavior, only active when the parameter for dynamic behavior is set. Parses message and activates the corresponding output modules.
callback_navigation_done

...

Callback for the navigation module. Sets the behavior finished variable when called.
change_behavior

...

Called by callback_dynamic_behavior when a behavior command is intercepted. Retrieves behavioral parameters for the audio and visual module and executes.
callback_playback

...

Callback for topic /cyborg_audio/feedback_playback, handles feedback for audio playback and sets the behavior_finished variable accordingly.
callback_text_to_speech

...

Callback for topic /cyborg_audio/feedback_text_to_speech, handles feedback for text to speech and sets the behaviorfinished_ variable accordingly.
send_emotion

...

Publishes emotional feedback when executed.

How to add new bahviour

New behavioral presets are configured by appending the desired preset to the behavior.launch file in the behavior module. Presets are added to the Cyborg state machine in the same way as other action server states, shown in the following code:

...