/** \file
 *
 *  Contains the Trajectory class definition.
 *
 *  Copyright (c) 2007,2008,2009 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#ifndef TRAJECTORY_H_
#define TRAJECTORY_H_

/**
 *  This is a helper class for Depthcontrol, HeadingControl, and SpeedControl
 *  which projects the state of a variable forward into the future.
 *
 *  \ingroup modules_control
 */
class Trajectory
{
public:
    Trajectory( bool periodic = true );
    virtual ~Trajectory();

    // Executes the trajectory generator for one time step
    float project( float x0, float dt, float xf, float xdotmax, float xdot2, bool debug = false );

    float getXDot() const
    {
        return xDot_;
    }

    void setXDot( const float xDot )
    {
        xDot_ = xDot;
    }

    float getX() const
    {
        return x_;
    }

    void setX( float x0 )
    {
        x_ = x0;
    }

protected:
    bool initialized_;
    float x_;
    float xDot_;
    bool periodic_;

};

#endif /* TRAJECTORY_H_ */
