agimus_sot.task.task.Task Class Reference

Wrapper of a task in SoT and its interface with ROS. More...

Inheritance diagram for agimus_sot.task.task.Task:
[legend]
Collaboration diagram for agimus_sot.task.task.Task:
[legend]

Public Member Functions

def __init__ (self, tasks=[], constraints=[], topics={})
 
def __add__ (self, other)
 
def __iadd__ (self, other)
 
def setControlSelection (self, selection)
 
def pushTo (self, solver)
 
def extendSignalGetters (self, topicName, signalGetters)
 
def addHppJointTopic (self, topicName, jointName=None, velocity=False, signalGetters=frozenset())
 
def addTfListenerTopic (self, topicName, frame0, frame1, defaultValue=None, signalGetters=frozenset(), maxDelay=1.5)
 
def makeTfListenerDefaultValue (self, name, value, outputs=None)
 Create an If entity whose condition is the transform was found in TF. More...
 

Public Attributes

 tasks
 Task to be added to a SoT solver. More...
 
 constraints
 Constraints This is likely not used anymore. More...
 
 topics
 The ROS topics where to read references. More...
 

Static Public Attributes

string sep = "___"
 

Detailed Description

Wrapper of a task in SoT and its interface with ROS.

This class represents a task as defined in the Stack of Tasks (dynamic_graph.sot.core.Task). It contains a dictionary the keys of which are the names of the SoT signals

Each child class sets a default value for the gain.

Constructor & Destructor Documentation

◆ __init__()

def agimus_sot.task.task.Task.__init__ (   self,
  tasks = [],
  constraints = [],
  topics = {} 
)

Member Function Documentation

◆ __add__()

◆ __iadd__()

◆ addHppJointTopic()

def agimus_sot.task.task.Task.addHppJointTopic (   self,
  topicName,
  jointName = None,
  velocity = False,
  signalGetters = frozenset() 
)
Add a topic that will received the pose (or velocity) of a joint from HPP
- param jointName: When None, uses topicName as the joint name in HPP.

References agimus_sot.task.task.Task.addTfListenerTopic(), agimus_sot.task.task.Task.extendSignalGetters(), agimus_sot.task.task.Task.topics, and agimus_sot.task.posture.Posture.topics.

Referenced by agimus_sot.task.pre_grasp.PreGrasp.makeTasks().

◆ addTfListenerTopic()

def agimus_sot.task.task.Task.addTfListenerTopic (   self,
  topicName,
  frame0,
  frame1,
  defaultValue = None,
  signalGetters = frozenset(),
  maxDelay = 1.5 
)
Parameters
signalsshould be a set of:
  • either a tuple (signal, availability signal)
  • or a signal

References agimus_sot.task.task.Task.extendSignalGetters(), agimus_sot.task.task.Task.topics, and agimus_sot.task.posture.Posture.topics.

Referenced by agimus_sot.task.task.Task.addHppJointTopic(), and agimus_sot.task.pre_grasp.PreGrasp.makeTasks().

◆ extendSignalGetters()

def agimus_sot.task.task.Task.extendSignalGetters (   self,
  topicName,
  signalGetters 
)

◆ makeTfListenerDefaultValue()

def agimus_sot.task.task.Task.makeTfListenerDefaultValue (   self,
  name,
  value,
  outputs = None 
)

Create an If entity whose condition is the transform was found in TF.

If the condition is not met, the value is used instead.

Parameters
valueeither a SignalBase or a transform.
outputsa signal or a list of signal that will receive the output of the If entity.
Returns
a 2-uplet:
  • the If entity, whose signal sin1 (resp. boolSelection) should be plugged to tf output signal (resp tf availability signal)
  • a tuple to be added to plugged to tf output signal (resp tf availability signal)

References agimus_sot.tools.assertEntityDoesNotExist(), agimus_sot.task.foot.Foot.name_prefix, agimus_sot.task.posture.Posture.name_prefix, agimus_sot.task.grasp.Grasp.name_prefix, agimus_sot.task.pre_grasp_post_action.PreGraspPostAction.name_prefix, agimus_sot.task.end_effector.EndEffector.name_prefix, agimus_sot.task.pre_grasp.PreGrasp.name_prefix, agimus_sot.tools.plugMatrixHomo(), agimus_sot.task.com.COM.sep, and agimus_sot.task.task.Task.sep.

◆ pushTo()

◆ setControlSelection()

Member Data Documentation

◆ constraints

agimus_sot.task.task.Task.constraints

Constraints This is likely not used anymore.

Referenced by agimus_sot.task.task.Task.__add__(), and agimus_sot.task.task.Task.__iadd__().

◆ sep

string agimus_sot.task.task.Task.sep = "___"
static

◆ tasks

◆ topics

agimus_sot.task.task.Task.topics

The ROS topics where to read references.

It is a dictionary. The key is the output signal name of a RosQueuedSubscribe entity. The value is a dictionary with:

  • "type": "vector", "matrixHomo", "vector3" ...,
  • "topic": the ROS topic name,
  • "signalGetters": a list of functions returning the input signals to be plugged.
  • "handler": [optional] some specific topics have specific handlers.
    • "hppjoint": needs two more keys
      • "velocity": boolean
      • "hppjoint": HPP joint name
    • "tf_listener": needs three more keys
      • "velocity": boolean
      • "frame0": base frame name
      • "frame1": child frame name
    • "hppcom": needs two more keys
      • "velocity": boolean
      • "hppcom": HPP CoM name

Referenced by agimus_sot.task.task.Task.__add__(), agimus_sot.task.task.Task.__iadd__(), agimus_sot.task.task.Task.addHppJointTopic(), agimus_sot.task.task.Task.addTfListenerTopic(), and agimus_sot.task.task.Task.extendSignalGetters().