KITProsthesisIceDriver.cpp
Go to the documentation of this file.
2 #include <iostream>
3 #include <memory>
4 
5 using namespace KITProsthesis;
6 
7 void KITProsthesisIceDriver::sendGrasp(Ice::Int n, const Ice::Current&)
8 {
9  iface.sendGrasp(n);
10 }
11 void KITProsthesisIceDriver::sendThumbPWM(const ProsthesisMotorValues& motorValues, const Ice::Current&)
12 {
13  iface.sendThumbPWM(motorValues.v, motorValues.maxPWM, motorValues.pos);
14 }
15 
16 void KITProsthesisIceDriver::sendFingerPWM(const ProsthesisMotorValues& motorValues, const Ice::Current&)
17 {
18  iface.sendFingerPWM(motorValues.v, motorValues.maxPWM, motorValues.pos);
19 }
20 
22 {
24  switch (iface.getState())
25  {
28  break;
31  break;
34  break;
37  break;
40  break;
43  break;
46  break;
49  break;
52  break;
55  break;
58  break;
59  }
60 
61  value.thumbPWM = iface.getThumbPWM();
62  value.thumbPos = iface.getThumbPos();
63 
64  value.fingerPWM = iface.getFingerPWM();
65  value.fingerPos = iface.getFingerPos();
66 
67  //add IMU here
68  return value;
69 }
BLEProthesisInterface::State::Running
@ Running
BLEProthesisInterface::State::Disconnected
@ Disconnected
KITProsthesis::ProsthesisState::Created
@ Created
Definition: KITProstheticHandInterface.ice:34
KITProsthesis::ProsthesisMotorValues::v
long v
Definition: KITProstheticHandInterface.ice:50
KITProsthesis::KITProstheticHandInterface::getSensorValues
ProsthesisSensorValues getSensorValues()
BLEProthesisInterface::State::Killed
@ Killed
BLEProthesisInterface::State::DiscoveringServices
@ DiscoveringServices
BLEProthesisInterface::State::ConnectingDone
@ ConnectingDone
KITProsthesis::ProsthesisState::Running
@ Running
Definition: KITProstheticHandInterface.ice:43
KITProsthesis::ProsthesisState::Killed
@ Killed
Definition: KITProstheticHandInterface.ice:44
BLEProthesisInterface::State::Connecting
@ Connecting
KITProsthesis::ProsthesisState::DiscoveringServices
@ DiscoveringServices
Definition: KITProstheticHandInterface.ice:40
KITProsthesis::ProsthesisMotorValues::pos
long pos
Definition: KITProstheticHandInterface.ice:52
KITProsthesis::ProsthesisSensorValues
Definition: KITProstheticHandInterface.ice:55
KITProsthesisIceDriver.h
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
BLEProthesisInterface::State::Created
@ Created
KITProsthesis::ProsthesisState::ConnectingDone
@ ConnectingDone
Definition: KITProstheticHandInterface.ice:39
BLEProthesisInterface::State::DiscoveringServicesDone
@ DiscoveringServicesDone
KITProsthesis::ProsthesisState::DiscoveringDevicesDone
@ DiscoveringDevicesDone
Definition: KITProstheticHandInterface.ice:36
KITProsthesisIceDriver::sendThumbPWM
void sendThumbPWM(const KITProsthesis::ProsthesisMotorValues &, const ::Ice::Current &=::Ice::emptyCurrent) override
Definition: KITProsthesisIceDriver.cpp:11
KITProsthesisIceDriver::sendGrasp
void sendGrasp(Ice::Int, const Ice::Current &=Ice::emptyCurrent) override
Definition: KITProsthesisIceDriver.cpp:7
KITProsthesis::ProsthesisState::Disconnected
@ Disconnected
Definition: KITProstheticHandInterface.ice:37
KITProsthesis::ProsthesisState::DiscoveringDevices
@ DiscoveringDevices
Definition: KITProstheticHandInterface.ice:35
KITProsthesis::ProsthesisMotorValues
Definition: KITProstheticHandInterface.ice:48
BLEProthesisInterface::State::ConnectingService
@ ConnectingService
KITProsthesis::ProsthesisState::ConnectingService
@ ConnectingService
Definition: KITProstheticHandInterface.ice:42
KITProsthesis::ProsthesisMotorValues::maxPWM
long maxPWM
Definition: KITProstheticHandInterface.ice:51
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:916
KITProsthesis
Definition: KITProstheticHandInterface.ice:27
KITProsthesis::ProsthesisState::DiscoveringServicesDone
@ DiscoveringServicesDone
Definition: KITProstheticHandInterface.ice:41
KITProsthesisIceDriver::sendFingerPWM
void sendFingerPWM(const KITProsthesis::ProsthesisMotorValues &, const ::Ice::Current &=::Ice::emptyCurrent) override
Definition: KITProsthesisIceDriver.cpp:16
BLEProthesisInterface::State::DiscoveringDevicesDone
@ DiscoveringDevicesDone
KITProsthesis::ProsthesisState::Connecting
@ Connecting
Definition: KITProstheticHandInterface.ice:38
BLEProthesisInterface::State::DiscoveringDevices
@ DiscoveringDevices