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.
Fork of autonomous Robot Android by
Revision 37:fd68b9e0be08, committed 2013-06-09
- Comitter:
- chrigelburri
- Date:
- Sun Jun 09 17:37:20 2013 +0000
- Parent:
- 36:4226e50a0bcd
- Child:
- 38:d76e488e725f
- Commit message:
- beim qr wird desabled um den winkelfehler in grenzen zu halten;
Changed in this revision
| RobotControl/RobotControl.cpp | Show annotated file Show diff for this revision Revisions of this file |
| defines.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/RobotControl/RobotControl.cpp Sat May 25 15:42:24 2013 +0000
+++ b/RobotControl/RobotControl.cpp Sun Jun 09 17:37:20 2013 +0000
@@ -216,8 +216,10 @@
Actual.yposition += (Actual.speed * period * sin(Actual.theta));
//motor control
- if ( isEnabled() && ( getDistanceError() >= MIN_DISTANCE_ERROR ) ) {
-
+ if ( /*isEnabled() && */ ( getDistanceError() >= MIN_DISTANCE_ERROR ) ) {
+
+ motorControllerLeft->enable(true);
+ motorControllerRight->enable(true);
//postition control
speed = K1 * getDistanceError() * cos( getThetaErrorToGoal() );
omega = K2 * getThetaErrorToGoal() +
@@ -240,6 +242,9 @@
);
} else {
+
+ motorControllerLeft->enable(false);
+ motorControllerRight->enable(false);
motorControllerLeft->setVelocity(0.0f);
motorControllerRight->setVelocity(0.0f);
}
--- a/defines.h Sat May 25 15:42:24 2013 +0000 +++ b/defines.h Sun Jun 09 17:37:20 2013 +0000 @@ -152,7 +152,7 @@ * @brief Min. Distance to switch the position controller off. * Because when Distance Error goes to zero the ATAN2 is not define, given in [m] */ -#define MIN_DISTANCE_ERROR 0.001f +#define MIN_DISTANCE_ERROR 0.045f /*! @} */ /** @@ -193,7 +193,7 @@ /** * @brief 10Hz Rate for the Android communication , given in [s] */ -#define PERIOD_ANDROID (0.025f*2) +#define PERIOD_ANDROID (0.035f*2) //(0.025f*2) /*! @} */
