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
Diff: Robot.h
- Revision:
- 0:f45212966fb1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Robot.h Mon Feb 18 13:13:34 2019 +0000 @@ -0,0 +1,33 @@ +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){ + + } + + }; \ No newline at end of file