unittest/python/crocoddyl/diagnostic.py
def displayTrajectory(robot, xs, dt=0.1, rate=-1, cameraTF=None):
    """  Display a robot trajectory xs using Gepetto-viewer gui.

    :param robot: Robot wrapper
    :param xs: state trajectory
    :param dt: step duration
    :param rate: visualization rate
    :param cameraTF: camera transform
    """
    if not hasattr(robot, 'viewer'):
        robot.initDisplay(loadModel=True)
    if cameraTF is not None:
        robot.viewer.gui.setCameraTransform(0, cameraTF)
    import numpy as np

    def a2m(a):
        return np.matrix(a).T

    import time
    S = 1 if rate <= 0 else max(len(xs) / rate, 1)
    for i, x in enumerate(xs):
        if not i % S:
            robot.display(a2m(x[:robot.nq]))
            time.sleep(dt)
  Display a robot trajectory xs using Gepetto-viewer gui.

    :param robot: Robot wrapper
    :param xs: state trajectory
    :param dt: step duration
    :param rate: visualization rate
    :param cameraTF: camera transform
    
Display a robot trajectory xs using Gepetto-viewer gui.
Display a robot trajectory xs using Gepetto - viewer gui .
def displayTrajectory(robot, xs, dt=0.1, rate=-1, cameraTF=None):
    if not hasattr(robot, 'viewer'):
        robot.initDisplay(loadModel=True)
    if cameraTF is not None:
        robot.viewer.gui.setCameraTransform(0, cameraTF)
    import numpy as np
    def a2m(a):
        return np.matrix(a).T
    import time
    S = 1 if rate <= 0 else max(len(xs) / rate, 1)
    for i, x in enumerate(xs):
        if not i % S:
            robot.display(a2m(x[:robot.nq]))
            time.sleep(dt)
def displayTrajectory ( robot , xs , dt = 0.1 , rate = - 1 , cameraTF = None ) : if not hasattr ( robot , 'viewer' ) : robot . initDisplay ( loadModel = True ) if cameraTF is not None : robot . viewer . gui . setCameraTransform ( 0 , cameraTF ) import numpy as np def a2m ( a ) : return np . matrix ( a ) . T import time S = 1 if rate <= 0 else max ( len ( xs ) / rate , 1 ) for i , x in enumerate ( xs ) : if not i % S : robot . display ( a2m ( x [ : robot . nq ] ) ) time . sleep ( dt )
Display a robot trajectory xs using Gepetto-viewer gui.
Display a robot trajectory xs using Gepetto - viewer gui .
"""  Display a robot trajectory xs using Gepetto-viewer gui.

    :param robot: Robot wrapper
    :param xs: state trajectory
    :param dt: step duration
    :param rate: visualization rate
    :param cameraTF: camera transform
    """
robot
None
xs
None
dt
None
rate
None
cameraTF
None