KITProsthesisIceDriver.cpp
Go to the documentation of this file.
2
3#include <iostream>
4#include <memory>
5
6using namespace KITProsthesis;
7
8void
9KITProsthesisIceDriver::sendGrasp(Ice::Int n, const Ice::Current&)
10{
11 iface.sendGrasp(n);
12}
13
14void
15KITProsthesisIceDriver::sendThumbPWM(const ProsthesisMotorValues& motorValues, const Ice::Current&)
16{
17 iface.sendThumbPWM(motorValues.v, motorValues.maxPWM, motorValues.pos);
18}
19
20void
21KITProsthesisIceDriver::sendFingerPWM(const ProsthesisMotorValues& motorValues, const Ice::Current&)
22{
23 iface.sendFingerPWM(motorValues.v, motorValues.maxPWM, motorValues.pos);
24}
25
28{
30 switch (iface.getState())
31 {
33 value.state = ProsthesisState::Created;
34 break;
37 break;
40 break;
43 break;
45 value.state = ProsthesisState::Connecting;
46 break;
49 break;
52 break;
55 break;
58 break;
60 value.state = ProsthesisState::Running;
61 break;
63 value.state = ProsthesisState::Killed;
64 break;
65 }
66
67 value.thumbPWM = iface.getThumbPWM();
68 value.thumbPos = iface.getThumbPos();
69
70 value.fingerPWM = iface.getFingerPWM();
71 value.fingerPos = iface.getFingerPos();
72
73 //add IMU here
74 return value;
75}
void sendThumbPWM(const KITProsthesis::ProsthesisMotorValues &, const ::Ice::Current &=::Ice::emptyCurrent) override
void sendFingerPWM(const KITProsthesis::ProsthesisMotorValues &, const ::Ice::Current &=::Ice::emptyCurrent) override
void sendGrasp(Ice::Int, const Ice::Current &=Ice::emptyCurrent) override
ProsthesisSensorValues getSensorValues()