Public Member Functions | Public Attributes | Private Member Functions | List of all members
simple_script_server.simple_script_server.simple_script_server Class Reference

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, 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)
 

Detailed Description

Simple script server class.

Implements the python interface for the script server.

Definition at line 126 of file simple_script_server.py.

Constructor & Destructor Documentation

def simple_script_server.simple_script_server.simple_script_server.__init__ (   self,
  parse = False 
)

Initializes simple_script_server class.

Parameters
parseDefines wether to run script in simulation for graph generation or not

Definition at line 130 of file simple_script_server.py.

Member Function Documentation

def simple_script_server.simple_script_server.simple_script_server._determine_desired_velocity (   self,
  default_vel,
  start_pos,
  component_name,
  joint_names,
  speed_factor,
  urdf_vel 
)
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 854 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.

Parameters
parameter_nameName of the parameter on the parameter server which holds the rgb values.

Definition at line 1114 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.

Parameters
component_nameName 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.

Parameters
component_nameName 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.

Parameters
component_nameName of the component.
parameter_nameName of the parameter on the ROS parameter server.
blockingBool 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.

Parameters
component_nameName of the component.
parameter_nameName of the parameter on the ROS parameter server.
blockingBool 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,
  blocking = True 
)

Relative movement of the base.

Parameters
component_nameName of component; here always "base".
parameter_nameList of length 3: (item 1 & 2) relative x and y translation [m]; (item 3) relative rotation about z axis [rad].
blockingBool value to specify blocking behaviour.

throws error code 3 in case of invalid parameter_name vector

Definition at line 915 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.

Parameters
component_nameName of the component.
parameter_nameList of movements for each joint of the component
blockingBool value to specify blocking behaviour.

throws error code 3 in case of invalid parameter_name vector

Definition at line 997 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.

Parameters
component_nameName of the component.
parameter_nameName of the parameter on the ROS parameter server.
blockingBool value to specify blocking behaviour.

Definition at line 864 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.

Parameters
parameter_nameName of the parameter
languageLanguage to use

Definition at line 1341 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 981 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.

Parameters
component_nameName 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.

Parameters
parameter_nameName of the parameter
languageLanguage to use for the TTS system

Definition at line 1271 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 1154 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.

Parameters
parameter_nameName of the parameter on the parameter server which holds the mimic mode (string).

Definition at line 1203 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 1407 of file simple_script_server.py.

def simple_script_server.simple_script_server.simple_script_server.sleep (   self,
  duration 
)

Sleep for a certain time.

Parameters
durationDuration in seconds to sleep.

Definition at line 1423 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.

Parameters
component_nameName 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.

Parameters
component_nameName of the component (namespace of the action).
dataThe data to be send in the ActionGoal.
blockingWhether 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.

Parameters
component_nameName of the component.
service_nameName of the trigger service.
blockingService 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.

Parameters
component_nameName of the component.
action_nameName of the action.
blockingWhether 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.

Parameters
durationDuration in seconds for timeout.
Todo:
TODO: implement waiting for timeout

Definition at line 1441 of file simple_script_server.py.

Member Data Documentation

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.


The documentation for this class was generated from the following file:


cob_script_server
Author(s): Florian Weisshardt
autogenerated on Wed Apr 7 2021 03:03:06