mbodied.types.language package

Submodules

mbodied.types.language.control module

This module defines varuous language controls.

  1. CommandControl: Basic commands such as ‘start’, ‘stop’, ‘restart’, etc.

  2. MobileControl: Commands for mobile movement like ‘move forward’, ‘move backward’, etc.

  3. HeadControl: Commands for head movements such as ‘look up’, ‘look down’, etc.

  4. HandControl: Commands for hand movements like ‘open hand’, ‘move hand forward’, etc.

  5. MobileSingleArmControl: Comprehensive commands for a mobile single-arm robot, including movements and rotations.

The dynamically created Enums are: - LangControl: Combines CommandControl, MobileControl, HeadControl, and HandControl. - MobileSingleArmLangControl: Based on MobileSingleArmControl.

Example usage:

execute_command(LangControl.START) # Output: Starting the system… execute_command(LangControl.MOVE_FORWARD) # Output: Moving forward…

command_str = “move forward” command = get_command_from_string(command_str) execute_command(command) # Execute: Moving forward…

class mbodied.types.language.control.LangControl(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

CLOSE_HAND = 'close hand'
GO_HOME = 'go home'
LOOK_DOWN = 'look down'
LOOK_LEFT = 'look left'
LOOK_RIGHT = 'look right'
LOOK_UP = 'look up'
MOVE_BACKWARD = 'move backward'
MOVE_FORWARD = 'move forward'
MOVE_HAND_BACKWARD = 'move hand backward'
MOVE_HAND_DOWN = 'move hand down'
MOVE_HAND_FORWARD = 'move hand forward'
MOVE_HAND_LEFT = 'move hand left'
MOVE_HAND_RIGHT = 'move hand right'
MOVE_HAND_UP = 'move hand up'
OPEN_HAND = 'open hand'
PAUSE = 'pause'
RESTART = 'restart'
RESUME = 'resume'
SLEEP = 'sleep'
START = 'start'
STOP = 'stop'
TURN_LEFT = 'turn left'
TURN_RIGHT = 'turn right'
class mbodied.types.language.control.MobileSingleArmLangControl(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

CLOSE_HAND = 'close hand'
LOOK_DOWN = 'look down'
LOOK_DOWN_A_LITTLE = 'look down a little'
LOOK_DOWN_A_LOT = 'look down a lot'
LOOK_LEFT = 'look left'
LOOK_LEFT_A_LITTLE = 'look left a little'
LOOK_LEFT_A_LOT = 'look left a lot'
LOOK_RIGHT = 'look right'
LOOK_RIGHT_A_LITTLE = 'look right a little'
LOOK_RIGHT_A_LOT = 'look right a lot'
LOOK_UP = 'look up'
LOOK_UP_A_LITTLE = 'look up a little'
LOOK_UP_A_LOT = 'look up a lot'
MOVE_BACKWARD = 'move backward'
MOVE_BACKWARD_A_LITTLE = 'move backward a little'
MOVE_BACKWARD_A_LOT = 'move backward a lot'
MOVE_FORWARD = 'move forward'
MOVE_FORWARD_A_LITTLE = 'move forward a little'
MOVE_FORWARD_A_LOT = 'move forward a lot'
MOVE_HAND_BACKWARD = 'move hand backward'
MOVE_HAND_BACKWARD_A_LITTLE = 'move hand backward a little'
MOVE_HAND_BACKWARD_A_LOT = 'move hand backward a lot'
MOVE_HAND_DOWN = 'move hand down'
MOVE_HAND_DOWN_A_LITTLE = 'move hand down a little'
MOVE_HAND_DOWN_A_LOT = 'move hand down a lot'
MOVE_HAND_FORWARD = 'move hand forward'
MOVE_HAND_FORWARD_A_LITTLE = 'move hand forward a little'
MOVE_HAND_FORWARD_A_LOT = 'move hand forward a lot'
MOVE_HAND_LEFT = 'move hand left'
MOVE_HAND_LEFT_A_LITTLE = 'move hand left a little'
MOVE_HAND_LEFT_A_LOT = 'move hand left a lot'
MOVE_HAND_RIGHT = 'move hand right'
MOVE_HAND_RIGHT_A_LITTLE = 'move hand right a little'
MOVE_HAND_RIGHT_A_LOT = 'move hand right a lot'
MOVE_HAND_UP = 'move hand up'
MOVE_HAND_UP_A_LITTLE = 'move hand up a little'
MOVE_HAND_UP_A_LOT = 'move hand up a lot'
MOVE_HOME = 'move home'
OPEN_HAND = 'open hand'
PITCH_HAND_DOWN = 'pitch hand down'
PITCH_HAND_DOWN_A_LITTLE = 'pitch hand down a little'
PITCH_HAND_DOWN_A_LOT = 'pitch hand down a lot'
PITCH_HAND_UP = 'pitch hand up'
PITCH_HAND_UP_A_LITTLE = 'pitch hand up a little'
PITCH_HAND_UP_A_LOT = 'pitch hand up a lot'
ROLL_HAND_CLOCK_WISE = 'roll hand clock wise'
ROLL_HAND_CLOCK_WISE_A_LITTLE = 'roll hand clock wise a little'
ROLL_HAND_CLOCK_WISE_A_LOT = 'roll hand clock wise a lot'
ROLL_HAND_COUNTER_CLOCK_WISE = 'roll hand counter clock wise'
ROLL_HAND_COUNTER_CLOCK_WISE_A_LITTLE = 'roll hand counter clock wise a little'
ROLL_HAND_COUNTER_CLOCK_WISE_A_LOT = 'roll hand counter clock wise a lot'
ROTATE_WAIST_LEFT = 'rotate waist left'
ROTATE_WAIST_LEFT_A_LITTLE = 'rotate waist left a little'
ROTATE_WAIST_LEFT_A_LOT = 'rotate waist left a lot'
ROTATE_WAIST_RIGHT = 'rotate waist right'
ROTATE_WAIST_RIGHT_A_LITTLE = 'rotate waist right a little'
ROTATE_WAIST_RIGHT_A_LOT = 'rotate waist right a lot'
SLEEP = 'sleep'
TURN_LEFT = 'turn left'
TURN_LEFT_A_LITTLE = 'turn left a little'
TURN_LEFT_A_LOT = 'turn left a lot'
TURN_RIGHT = 'turn right'
TURN_RIGHT_A_LITTLE = 'turn right a little'
TURN_RIGHT_A_LOT = 'turn right a lot'
YAW_HAND_CLOCK_WISE = 'yaw hand clock wise'
YAW_HAND_CLOCK_WISE_A_LITTLE = 'yaw hand clock wise a little'
YAW_HAND_CLOCK_WISE_A_LOT = 'yaw hand clock wise a lot'
YAW_HAND_COUNTER_CLOCK_WISE = 'yaw hand counter clock wise'
YAW_HAND_COUNTER_CLOCK_WISE_A_LITTLE = 'yaw hand counter clock wise a little'
YAW_HAND_COUNTER_CLOCK_WISE_A_LOT = 'yaw hand counter clock wise a lot'
mbodied.types.language.control.create_enum_from_list(name, string_list) Enum[source]

Dynamically create an Enum type from a list of strings.

Parameters:
  • name (str) – The name of the Enum class.

  • string_list (list[str]) – The list of strings to be converted into Enum members.

Returns:

A dynamically created Enum type with members based on the string list.

Return type:

Enum

mbodied.types.language.control.get_command_from_string(command_str) Enum[source]

Get the Enum member corresponding to a given command string.

mbodied.types.language.control.language_control_to_list(enum: Enum) list[str][source]

Convert an Enum type to a list of its values. So it’s easier to pass i.e. as prompt.

Module contents