Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Robot.h
- Committer:
- mazdo25
- Date:
- 2019-02-18
- Revision:
- 0:f45212966fb1
File content as of revision 0:f45212966fb1:
class Robot {
private:
float robotAngularVelocity;
float robotTranslationalVeocity;
Wheel* leftWheel;
Wheel* rightWheel;
float static const distanceBetweenWheels = 0.19;
public:
Robot(Wheel* LW, Wheel* RW) {
leftWheel = LW;
rightWheel= RW;
robotTranslationalVeocity = (lTemp + rTemp)/2;
};
void turn(float angularVelocity){//positive value is right, negative value is left
};
void calculateTranslationalVelocity(){
robotTranslationalVeocity = (LW->calculateAngularVelocity() + RW->calculateAngularVelocity();)/2;
}
void calculateAngularVelocity(){
robotAngularVelocity = (LW->calculateAngularVelocity() - RW->calculateAngularVelocity())/distanceBetweenWheels;
}
void Turn(float degrees){
}
};