tools.py 503 Bytes
Newer Older
1
2
3
4
5
# -*- coding: utf-8 -*-
# Copyright 2011, Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST

from __future__ import print_function

Guilhem Saurel's avatar
Guilhem Saurel committed
6
7

def addTrace(robot, trace, entityName, signalName, autoRecompute=True):
8
9
10
11
12
13
14
15
    """
    Add a signal to a tracer and recompute it automatically if necessary.
    """
    signal = '{0}.{1}'.format(entityName, signalName)
    filename = '{0}-{1}'.format(entityName, signalName)
    trace.add(signal, filename)
    if autoRecompute:
        robot.device.after.addSignal(signal)