Simple script server class. More...
Public Member Functions | |
| def | __init__ (self, parse=False) |
| Initializes simple_script_server class. More... | |
| def | calculate_point_accelerations (self, prev, curr, post) |
| def | calculate_point_time (self, start_pos, end_pos, default_vel, default_acc) |
| def | calculate_point_velocities (self, prev, curr, post, stop_at_waypoints=False) |
| def | compose_color (self, component_name, parameter_name) |
| Set the color of the cob_light component. More... | |
| def | compose_trajectory (self, component_name, parameter_name, speed_factor=1.0, urdf_vel=False, default_vel=None, stop_at_waypoints=False) |
| Parse and compose trajectory message. More... | |
| def | halt (self, component_name, blocking=True) |
| Halts different components. More... | |
| def | init (self, component_name, blocking=True) |
| Initializes different components. More... | |
| def | move (self, component_name, parameter_name, blocking=True, mode=None, speed_factor=1.0, urdf_vel=False, default_vel=None, stop_at_waypoints=False) |
| Deals with all kind of movements for different components. More... | |
| def | move_base (self, component_name, parameter_name, blocking, mode) |
| Deals with movements of the base. More... | |
| def | move_base_rel (self, component_name, parameter_name=[0, 0, 0], blocking=True) |
| Relative movement of the base. More... | |
| def | move_rel (self, component_name, parameter_name, blocking=True, speed_factor=1.0, urdf_vel=False, default_vel=None, stop_at_waypoints=False) |
| Relative movement Deals with all kind of relative movements for different components. More... | |
| def | move_traj (self, component_name, parameter_name, blocking, speed_factor=1.0, urdf_vel=False, default_vel=None, stop_at_waypoints=False) |
| Deals with all kind of trajectory movements for different components. More... | |
| def | play (self, component_name, parameter_name, blocking=True) |
| Play a sound file. More... | |
| def | publish_twist (self, pub, twist, end_time) |
| def | recover (self, component_name, blocking=True) |
| Recovers different components. More... | |
| def | say (self, component_name, parameter_name, blocking=True) |
| Say some text. More... | |
| def | set_light (self, component_name, parameter_name, blocking=False) |
| def | set_mimic (self, component_name, parameter_name, blocking=False) |
| Set the mimic of the cob_mimic component. More... | |
| def | set_wav_path (self, parameter_name, blocking=True) |
| def | sleep (self, duration) |
| Sleep for a certain time. More... | |
| def | stop (self, component_name, mode="omni", blocking=True) |
| Stops different components. More... | |
| def | string_action (self, component_name, data, blocking) |
| Allows to trigger actions of the type cob_actions/SetString. More... | |
| def | trigger (self, component_name, service_name, blocking=True) |
| Deals with all kind of trigger services for different components. More... | |
| def | trigger_action (self, component_name, action_name, blocking=True) |
| Allows to trigger actions of the type actionlib/TestAction. More... | |
| def | wait_for_input (self, duration=0) |
| Waits for user input. More... | |
Public Attributes | |
| ns_global_prefix | |
| parse | |
| robot_urdf | |
| wav_path | |
Private Member Functions | |
| def | _determine_desired_velocity (self, default_vel, start_pos, component_name, joint_names, speed_factor, urdf_vel) |
Simple script server class.
Implements the python interface for the script server.
Definition at line 126 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 130 of file simple_script_server.py.
|
private |
Definition at line 513 of file simple_script_server.py.
| def simple_script_server.simple_script_server.simple_script_server.calculate_point_accelerations | ( | self, | |
| prev, | |||
| curr, | |||
| post | |||
| ) |
Definition at line 855 of file simple_script_server.py.
| def simple_script_server.simple_script_server.simple_script_server.calculate_point_time | ( | self, | |
| start_pos, | |||
| end_pos, | |||
| default_vel, | |||
| default_acc | |||
| ) |
Definition at line 754 of file simple_script_server.py.
| def simple_script_server.simple_script_server.simple_script_server.calculate_point_velocities | ( | self, | |
| prev, | |||
| curr, | |||
| post, | |||
stop_at_waypoints = False |
|||
| ) |
Definition at line 806 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 1115 of file simple_script_server.py.
| def simple_script_server.simple_script_server.simple_script_server.compose_trajectory | ( | self, | |
| component_name, | |||
| parameter_name, | |||
speed_factor = 1.0, |
|||
urdf_vel = False, |
|||
default_vel = None, |
|||
stop_at_waypoints = False |
|||
| ) |
Parse and compose trajectory message.
Definition at line 572 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 225 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 151 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, |
|||
speed_factor = 1.0, |
|||
urdf_vel = False, |
|||
default_vel = None, |
|||
stop_at_waypoints = False |
|||
| ) |
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 397 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 410 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,0,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. |
Definition at line 916 of file simple_script_server.py.
| def simple_script_server.simple_script_server.simple_script_server.move_rel | ( | self, | |
| component_name, | |||
| parameter_name, | |||
blocking = True, |
|||
speed_factor = 1.0, |
|||
urdf_vel = False, |
|||
default_vel = None, |
|||
stop_at_waypoints = False |
|||
| ) |
Relative movement Deals with all kind of relative movements for different components.
Based on the component, the corresponding move functions will be called.
| component_name | Name of the component. |
| parameter_name | List of movements for each joint of the component |
| blocking | Bool value to specify blocking behaviour. |
Definition at line 998 of file simple_script_server.py.
| def simple_script_server.simple_script_server.simple_script_server.move_traj | ( | self, | |
| component_name, | |||
| parameter_name, | |||
| blocking, | |||
speed_factor = 1.0, |
|||
urdf_vel = False, |
|||
default_vel = None, |
|||
stop_at_waypoints = False |
|||
| ) |
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 865 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 1342 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 982 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 217 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 1272 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 1155 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 1204 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 1408 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 1424 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 159 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 349 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 235 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 298 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 1442 of file simple_script_server.py.
| simple_script_server.simple_script_server.simple_script_server.ns_global_prefix |
Definition at line 132 of file simple_script_server.py.
| simple_script_server.simple_script_server.simple_script_server.parse |
Definition at line 134 of file simple_script_server.py.
| simple_script_server.simple_script_server.simple_script_server.robot_urdf |
Definition at line 138 of file simple_script_server.py.
| simple_script_server.simple_script_server.simple_script_server.wav_path |
Definition at line 133 of file simple_script_server.py.