summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/asserv/test_asserv.cc
diff options
context:
space:
mode:
authorhaller2005-04-21 22:50:59 +0000
committerhaller2005-04-21 22:50:59 +0000
commitecbb51012f9f230914f51aaa3b9cdfba8f9ef89c (patch)
tree5bae4738363a81aebde847c8cf58fd6612e72274 /2005/i/robert/src/asserv/test_asserv.cc
parenteb1df7a163cbdd528b92897a222d9a05e8519633 (diff)
Correction de bug
Encore des tout pitit truc à vérifier
Diffstat (limited to '2005/i/robert/src/asserv/test_asserv.cc')
-rw-r--r--2005/i/robert/src/asserv/test_asserv.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/2005/i/robert/src/asserv/test_asserv.cc b/2005/i/robert/src/asserv/test_asserv.cc
index 84c3366..3c3ba76 100644
--- a/2005/i/robert/src/asserv/test_asserv.cc
+++ b/2005/i/robert/src/asserv/test_asserv.cc
@@ -31,6 +31,7 @@
#include<stdexcept>
#include<cstdlib>
+#include<cmath>
/// Classe de test pour asserv.
class TestAsserv : public Asserv::Receiver
@@ -52,14 +53,14 @@ class TestAsserv : public Asserv::Receiver
void receivePosA (double aPos)
{
- std::cout << "A:" << "aPos:" << aPos << std::endl;
+ std::cout << "A:" << " aPosR: " << aPos << " aPosD: " << aPos / (2 * M_PI) * 360 << std::endl;
}
void receiveSpeedStat (int leftError, int leftInt, int rightError, int rightInt)
{
- std::cout << "S:" << "leftError:" << leftError << "leftInt:" <<
- leftInt << "rightError:" << rightError <<
- "rightInt:" << rightInt << std::endl;
+ std::cout << "S:" << " leftError: " << leftError << "leftInt: " <<
+ leftInt << " rightError: " << rightError <<
+ " rightInt: " << rightInt << std::endl;
}
void receivePwm (double leftPwm, double rightPwm)
@@ -71,9 +72,9 @@ class TestAsserv : public Asserv::Receiver
int motorTimer2, int motorTimer1,
int motorTimer0 )
{
- std::cout << "T:" << " motorTimer4:" << motorTimer4 << "motorTimer3:"
- << motorTimer3 << "motorTimer2:" << motorTimer2
- << "motorTimer1:" << motorTimer1 << "motorTimer0:"
+ std::cout << "T:" << " motorTimer4: " << motorTimer4 << " motorTimer3: "
+ << motorTimer3 << " motorTimer2: " << motorTimer2
+ << " motorTimer1: " << motorTimer1 << " motorTimer0: "
<< motorTimer0 << std::endl;
}
@@ -189,7 +190,7 @@ main (int argc, char **argv)
case 'w':
if(++i + 1 > argc)
throw std::runtime_error("syntax error");
- asserv.setPwm(strtod(argv[i], 0), strtod(argv[i + 1], 0));
+ asserv.setPwm(strtol(argv[i], 0, 10), strtol(argv[i + 1], 0, 10));
i++;
break;
case 'F':
@@ -223,7 +224,7 @@ main (int argc, char **argv)
case 'P':
if(++i > argc)
throw std::runtime_error("syntax error");
- asserv.fuckTheWall(atoi(argv[i]));
+ asserv.statInPort(strtol(argv[i], 0, 10));
break;
case 'H':