Ejemplo n.º 1
0
    def __init__(self,
                 joint_limits,
                 time_limit=1.0,
                 max_iterations=50,
                 test_trajectories=True,
                 plot_trajectories=False):

        # Store the limits used to smooth each joint as a map from joint name to simple limits structure
        # For now we don't handle time factor, and dynamic reparameterization
        self.joint_limits = joint_limits
        self.time_limit = time_limit
        self.max_iterations = max_iterations
        self.plot_trajectories = plot_trajectories
        self.test_trajectories = test_trajectories

        # Define which type of smoothing we will use
        self.piecewise_smoother = VigirTrajectoryPiecewiseSmoother(
            joint_limits, time_limit, max_iterations)
        ##self.quartic_smoother     = VigirTrajectoryQuarticSmoother(joint_limits, time_limit, max_iterations)
        self.cubic_smoother = VigirTrajectoryC3Smoother(
            joint_limits, time_limit, max_iterations)

        self.plotter = None
        if (self.plot_trajectories):
            self.plotter = VigirTrajectoryPlotter()