Changeset 177 in flair-src for trunk


Ignore:
Timestamp:
Apr 27, 2017, 5:49:17 PM (8 years ago)
Author:
Sanahuja Guillaume
Message:

use current zvel when switching from starttakingoff to stabilized into the traj generator

Location:
trunk/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairFilter/src/TrajectoryGenerator1D.cpp

    r157 r177  
    4141cvmatrix *TrajectoryGenerator1D::Matrix(void) const { return pimpl_->output; }
    4242
    43 void TrajectoryGenerator1D::StartTraj(float start_pos, float end_pos) {
    44   pimpl_->StartTraj(start_pos, end_pos);
     43void TrajectoryGenerator1D::StartTraj(float startPosition, float endPosition,float startVelocity) {
     44  pimpl_->StartTraj(startPosition,endPosition,startVelocity);
    4545}
    4646
  • trunk/lib/FlairFilter/src/TrajectoryGenerator1D.h

    r15 r177  
    7272  * \brief Start trajectory
    7373  *
    74   * \param start_pos start position
    75   * \param end_pos end position
     74  * \param startPosition start position
     75  * \param endPosition end position
     76  * \param startVelocity start velocity, should be actual velocity. This value will be saturated
     77  * max velocity defined in GCS.
    7678  */
    77   void StartTraj(float start_pos, float end_pos);
     79  void StartTraj(float startPosition, float endPosition,float startVelocity=0);
    7880
    7981  /*!
  • trunk/lib/FlairFilter/src/TrajectoryGenerator1D_impl.cpp

    r148 r177  
    7979}
    8080
    81 void TrajectoryGenerator1D_impl::StartTraj(float start_pos, float end_pos) {
     81void TrajectoryGenerator1D_impl::StartTraj(float start_pos, float end_pos,float startVelocity) {
    8282  is_started = true;
    8383  is_finished = false;
     
    8888  pos = start_pos;
    8989  acc = acceleration->Value();
    90   v = 0;
     90  v = startVelocity;
     91  if (fabs(v) > fabs(max_veloctity->Value())) {
     92    if (v > 0)
     93      v = max_veloctity->Value();
     94    else
     95      v = -max_veloctity->Value();
     96  }
    9197  if (end_position < start_pos) {
    9298    acc = -acc;
  • trunk/lib/FlairFilter/src/unexported/TrajectoryGenerator1D_impl.h

    r15 r177  
    3535  ~TrajectoryGenerator1D_impl();
    3636  void Update(flair::core::Time time);
    37   void StartTraj(float start_pos, float end_pos);
     37  void StartTraj(float start_pos, float end_pos,float startVelocity);
    3838  void StopTraj(void);
    3939  void Reset(void);
  • trunk/lib/FlairMeta/src/UavStateMachine.cpp

    r176 r177  
    279279    if (currentAltitude > groundAltitude + 0.03) {
    280280      altitudeTrajectory->StartTraj(currentAltitude,
    281                                     desiredTakeoffAltitude->Value());
     281                                    desiredTakeoffAltitude->Value(),currentVerticalSpeed);
    282282      altitudeState = AltitudeState_t::Stabilized;
    283283      SignalEvent(Event_t::Stabilized);
Note: See TracChangeset for help on using the changeset viewer.