summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/asserv/asserv.cc
diff options
context:
space:
mode:
authorhaller2005-05-04 20:22:33 +0000
committerhaller2005-05-04 20:22:33 +0000
commitd3726bf21e29a70b4141a5802cb9a50b7880f364 (patch)
treef98f206e08da7154d4683df19f3d53e95acba9a4 /2005/i/robert/src/asserv/asserv.cc
parent7c4f39a4f958177b6a9f6b718055dd2dfe688e98 (diff)
Ajout de la fonction tempo
Modification de update
Diffstat (limited to '2005/i/robert/src/asserv/asserv.cc')
-rw-r--r--2005/i/robert/src/asserv/asserv.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/2005/i/robert/src/asserv/asserv.cc b/2005/i/robert/src/asserv/asserv.cc
index 662e52f..36b7534 100644
--- a/2005/i/robert/src/asserv/asserv.cc
+++ b/2005/i/robert/src/asserv/asserv.cc
@@ -323,12 +323,17 @@ double Asserv::getAccel(void)
/// Règle les vitesses maximum(lineaire et rotation)
void Asserv::setMaxSpeed(int maxSLin, int maxSRot)
{
- maxSLin_ = maxSLin;
- maxSRot_ = maxSRot;
+ maxSLin_ = (maxSLin > 0 ? maxSLin : maxSLin_);
+ maxSRot_ = (maxSRot > 0 ? maxSLin : maxSLin_);
// Envoie à l'AVR
proto_.send('p',"bbb", 'm', maxSLin, maxSRot);
}
+int Asserv::getMaxLSpeed(void)
+{
+ return maxSLin_;
+}
+
void Asserv::setUseTazFSM(bool use)
{
useTazFSM_ = use;
@@ -462,6 +467,8 @@ int Asserv::mm2pas(double dist, bool format24eme)
int Asserv::radTo256(double angle, bool format24eme)
{
+ if(angle < 0)
+ angle += 2 * M_PI;
if(format24eme)
return static_cast<int>((angle / (2 * M_PI)) * 256 * (1 << 24));
else