Simple script server class. More...
Public Member Functions | |
def | __init__ |
Initializes simple_script_server class. | |
def | calculate_point_time |
def | compose_color |
Set the color of the cob_light component. | |
def | compose_trajectory |
Parse and compose trajectory message. | |
def | halt |
Halts different components. | |
def | init |
Initializes different components. | |
def | move |
Deals with all kind of movements for different components. | |
def | move_base |
Deals with movements of the base. | |
def | move_base_rel |
Relative movement of the base. | |
def | move_traj |
Deals with all kind of trajectory movements for different components. | |
def | play |
Play a sound file. | |
def | publish_twist |
def | recover |
Recovers different components. | |
def | say |
Say some text. | |
def | set_light |
def | set_mimic |
Set the mimic of the cob_mimic component. | |
def | set_wav_path |
def | sleep |
Sleep for a certain time. | |
def | stop |
Stops different components. | |
def | string_action |
Allows to trigger actions of the type cob_actions/SetString. | |
def | trigger |
Deals with all kind of trigger services for different components. | |
def | trigger_action |
Allows to trigger actions of the type actionlib/TestAction. | |
def | wait_for_input |
Waits for user input. | |
Public Attributes | |
ns_global_prefix | |
parse | |
wav_path |
Simple script server class.
Implements the python interface for the script server.
Definition at line 118 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.__init__ | ( | self, | |
parse = False |
|||
) |
Initializes simple_script_server class.
parse | Defines wether to run script in simulation for graph generation or not |
Definition at line 122 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.calculate_point_time | ( | self, | |
component_name, | |||
start_pos, | |||
end_pos, | |||
default_vel, | |||
default_acc | |||
) |
Definition at line 629 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.compose_color | ( | self, | |
component_name, | |||
parameter_name | |||
) |
Set the color of the cob_light component.
The color is given by a parameter on the parameter server.
parameter_name | Name of the parameter on the parameter server which holds the rgb values. |
Definition at line 792 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.compose_trajectory | ( | self, | |
component_name, | |||
parameter_name | |||
) |
Parse and compose trajectory message.
Definition at line 498 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.halt | ( | self, | |
component_name, | |||
blocking = True |
|||
) |
Halts different components.
Based on the component, the corresponding halt service will be called.
component_name | Name of the component. |
Definition at line 209 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.init | ( | self, | |
component_name, | |||
blocking = True |
|||
) |
Initializes different components.
Based on the component, the corresponding init service will be called.
component_name | Name of the component. |
Definition at line 135 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.move | ( | self, | |
component_name, | |||
parameter_name, | |||
blocking = True , |
|||
mode = None |
|||
) |
Deals with all kind of movements for different components.
Based on the component, the corresponding move functions will be called.
component_name | Name of the component. |
parameter_name | Name of the parameter on the ROS parameter server. |
blocking | Bool value to specify blocking behaviour. |
Definition at line 381 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.move_base | ( | self, | |
component_name, | |||
parameter_name, | |||
blocking, | |||
mode | |||
) |
Deals with movements of the base.
A target will be sent to the actionlib interface of the move_base node.
component_name | Name of the component. |
parameter_name | Name of the parameter on the ROS parameter server. |
blocking | Bool value to specify blocking behaviour. |
Definition at line 394 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.move_base_rel | ( | self, | |
component_name, | |||
parameter_name = [0 , |
|||
blocking = True |
|||
) |
Relative movement of the base.
component_name | Name of component; here always "base". |
parameter_name | List of length 3: (item 1 & 2) relative x and y translation [m]; (item 3) relative rotation about z axis [rad]. |
blocking | Bool value to specify blocking behaviour. |
# throws error code 3 in case of invalid parameter_name vector
Definition at line 713 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.move_traj | ( | self, | |
component_name, | |||
parameter_name, | |||
blocking | |||
) |
Deals with all kind of trajectory movements for different components.
A trajectory will be sent to the actionlib interface of the corresponding component.
component_name | Name of the component. |
parameter_name | Name of the parameter on the ROS parameter server. |
blocking | Bool value to specify blocking behaviour. |
Definition at line 662 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.play | ( | self, | |
component_name, | |||
parameter_name, | |||
blocking = True |
|||
) |
Play a sound file.
parameter_name | Name of the parameter |
language | Language to use |
Definition at line 1019 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.publish_twist | ( | self, | |
pub, | |||
twist, | |||
end_time | |||
) |
Definition at line 779 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.recover | ( | self, | |
component_name, | |||
blocking = True |
|||
) |
Recovers different components.
Based on the component, the corresponding recover service will be called.
component_name | Name of the component. |
Definition at line 201 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.say | ( | self, | |
component_name, | |||
parameter_name, | |||
blocking = True |
|||
) |
Say some text.
The text to say may be given by a list of strings or a single string which points to a parameter on the ROS parameter server.
parameter_name | Name of the parameter |
language | Language to use for the TTS system |
Definition at line 949 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.set_light | ( | self, | |
component_name, | |||
parameter_name, | |||
blocking = False |
|||
) |
Definition at line 832 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.set_mimic | ( | self, | |
component_name, | |||
parameter_name, | |||
blocking = False |
|||
) |
Set the mimic of the cob_mimic component.
The mode is given by a parameter on the parameter server.
parameter_name | Name of the parameter on the parameter server which holds the mimic mode (string). |
Definition at line 881 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.set_wav_path | ( | self, | |
parameter_name, | |||
blocking = True |
|||
) |
Definition at line 1085 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.sleep | ( | self, | |
duration | |||
) |
Sleep for a certain time.
duration | Duration in seconds to sleep. |
Definition at line 1100 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.stop | ( | self, | |
component_name, | |||
mode = "omni" , |
|||
blocking = True |
|||
) |
Stops different components.
Based on the component, the corresponding stop service will be called.
component_name | Name of the component. |
Definition at line 143 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.string_action | ( | self, | |
component_name, | |||
data, | |||
blocking | |||
) |
Allows to trigger actions of the type cob_actions/SetString.
Based on the component and action name, the corresponding ActionServer will be called.
component_name | Name of the component (namespace of the action). |
data | The data to be send in the ActionGoal. |
blocking | Whether to wait for the Action to return. |
Definition at line 333 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.trigger | ( | self, | |
component_name, | |||
service_name, | |||
blocking = True |
|||
) |
Deals with all kind of trigger services for different components.
Based on the component and service name, the corresponding trigger service will be called.
component_name | Name of the component. |
service_name | Name of the trigger service. |
blocking | Service calls are always blocking. The parameter is only provided for compatibility with other functions. |
Definition at line 219 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.trigger_action | ( | self, | |
component_name, | |||
action_name, | |||
blocking = True |
|||
) |
Allows to trigger actions of the type actionlib/TestAction.
Based on the component and action name, the corresponding ActionServer will be called.
component_name | Name of the component. |
action_name | Name of the action. |
blocking | Whether to wait for the Action to return. |
Definition at line 282 of file simple_script_server.py.
def simple_script_server.simple_script_server.simple_script_server.wait_for_input | ( | self, | |
duration = 0 |
|||
) |
Waits for user input.
Waits either for a user input or until timeout is reached.
duration | Duration in seconds for timeout. |
Definition at line 1118 of file simple_script_server.py.
Definition at line 122 of file simple_script_server.py.
Definition at line 122 of file simple_script_server.py.
Definition at line 122 of file simple_script_server.py.