Changeset 167 in flair-src for trunk/demos/CircleFollower/uav


Ignore:
Timestamp:
Apr 12, 2017, 1:59:38 PM (7 years ago)
Author:
Sanahuja Guillaume
Message:

modifs pour template vectors

Location:
trunk/demos/CircleFollower/uav/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/demos/CircleFollower/uav/src/CircleFollower.cpp

    r147 r167  
    8989    //get roll, pitch and w from imu
    9090    Quaternion ahrsQuaternion;
    91     Vector3D ahrsAngularSpeed;
     91    Vector3Df ahrsAngularSpeed;
    9292    GetDefaultOrientation()->GetQuaternionAndAngularRates(ahrsQuaternion, ahrsAngularSpeed);
    9393
     
    101101}
    102102
    103 void CircleFollower::AltitudeValues(float &z,float &dz) {
    104     Vector3D uav_pos,uav_vel;
     103void CircleFollower::AltitudeValues(float &z,float &dz) const{
     104    Vector3Df uav_pos,uav_vel;
    105105
    106106    uavVrpn->GetPosition(uav_pos);
     
    112112
    113113AhrsData *CircleFollower::GetReferenceOrientation(void) {
    114     Vector2D pos_err, vel_err; // in Uav coordinate system
     114    Vector2Df pos_err, vel_err; // in Uav coordinate system
    115115    float yaw_ref;
    116116    Euler refAngles;
     
    128128    refAngles.roll=-uY->Output();
    129129
    130     customReferenceOrientation->SetQuaternionAndAngularRates(refAngles.ToQuaternion(),Vector3D(0,0,0));
     130    customReferenceOrientation->SetQuaternionAndAngularRates(refAngles.ToQuaternion(),Vector3Df(0,0,0));
    131131
    132132    return customReferenceOrientation;
    133133}
    134134
    135 void CircleFollower::PositionValues(Vector2D &pos_error,Vector2D &vel_error,float &yaw_ref) {
    136     Vector3D uav_pos,uav_vel; // in VRPN coordinate system
    137     Vector2D uav_2Dpos,uav_2Dvel; // in VRPN coordinate system
     135void CircleFollower::PositionValues(Vector2Df &pos_error,Vector2Df &vel_error,float &yaw_ref) {
     136    Vector3Df uav_pos,uav_vel; // in VRPN coordinate system
     137    Vector2Df uav_2Dpos,uav_2Dvel; // in VRPN coordinate system
    138138
    139139    uavVrpn->GetPosition(uav_pos);
     
    148148        yaw_ref=yawHold;
    149149    } else { //Circle
    150         Vector3D target_pos;
    151         Vector2D circle_pos,circle_vel;
    152         Vector2D target_2Dpos;
     150        Vector3Df target_pos;
     151        Vector2Df circle_pos,circle_vel;
     152        Vector2Df target_2Dpos;
    153153
    154154        targetVrpn->GetPosition(target_pos);
     
    238238        return;
    239239    }
    240     Vector3D uav_pos,target_pos;
    241     Vector2D uav_2Dpos,target_2Dpos;
     240    Vector3Df uav_pos,target_pos;
     241    Vector2Df uav_2Dpos,target_2Dpos;
    242242
    243243    targetVrpn->GetPosition(target_pos);
     
    265265                yawHold=vrpnQuaternion.ToEuler().yaw;
    266266
    267     Vector3D vrpnPosition;
     267    Vector3Df vrpnPosition;
    268268    uavVrpn->GetPosition(vrpnPosition);
    269269    vrpnPosition.To2Dxy(posHold);
  • trunk/demos/CircleFollower/uav/src/CircleFollower.h

    r122 r167  
    5454        void ExtraCheckJoystick(void);
    5555        const flair::core::AhrsData *GetOrientation(void) const;
    56         void AltitudeValues(float &z,float &dz);
    57         void PositionValues(flair::core::Vector2D &pos_error,flair::core::Vector2D &vel_error,float &yaw_ref);
     56        void AltitudeValues(float &z,float &dz) const;
     57        void PositionValues(flair::core::Vector2Df &pos_error,flair::core::Vector2Df &vel_error,float &yaw_ref);
    5858        flair::core::AhrsData *GetReferenceOrientation(void);
    5959        void SignalEvent(Event_t event);
     
    6161        flair::filter::Pid *uX, *uY;
    6262
    63         flair::core::Vector2D posHold;
     63        flair::core::Vector2Df posHold;
    6464        float yawHold;
    6565
Note: See TracChangeset for help on using the changeset viewer.