KITProsthesisIceDriver.cpp
Go to the documentation of this file.
1
#include "
KITProsthesisIceDriver.h
"
2
3
#include <iostream>
4
#include <memory>
5
6
using namespace
KITProsthesis
;
7
8
void
9
KITProsthesisIceDriver::sendGrasp
(Ice::Int n,
const
Ice::Current&)
10
{
11
iface.sendGrasp(n);
12
}
13
14
void
15
KITProsthesisIceDriver::sendThumbPWM
(
const
ProsthesisMotorValues
& motorValues,
const
Ice::Current&)
16
{
17
iface.sendThumbPWM(motorValues.
v
, motorValues.
maxPWM
, motorValues.
pos
);
18
}
19
20
void
21
KITProsthesisIceDriver::sendFingerPWM
(
const
ProsthesisMotorValues
& motorValues,
const
Ice::Current&)
22
{
23
iface.sendFingerPWM(motorValues.
v
, motorValues.
maxPWM
, motorValues.
pos
);
24
}
25
26
ProsthesisSensorValues
27
KITProsthesisIceDriver::getSensorValues
(
const
Ice::Current&)
28
{
29
ProsthesisSensorValues
value;
30
switch
(iface.getState())
31
{
32
case
BLEProthesisInterface::State::Created
:
33
value.state =
ProsthesisState::Created
;
34
break
;
35
case
BLEProthesisInterface::State::DiscoveringDevices
:
36
value.state =
ProsthesisState::DiscoveringDevices
;
37
break
;
38
case
BLEProthesisInterface::State::DiscoveringDevicesDone
:
39
value.state =
ProsthesisState::DiscoveringDevicesDone
;
40
break
;
41
case
BLEProthesisInterface::State::Disconnected
:
42
value.state =
ProsthesisState::Disconnected
;
43
break
;
44
case
BLEProthesisInterface::State::Connecting
:
45
value.state =
ProsthesisState::Connecting
;
46
break
;
47
case
BLEProthesisInterface::State::ConnectingDone
:
48
value.state =
ProsthesisState::ConnectingDone
;
49
break
;
50
case
BLEProthesisInterface::State::DiscoveringServices
:
51
value.state =
ProsthesisState::DiscoveringServices
;
52
break
;
53
case
BLEProthesisInterface::State::DiscoveringServicesDone
:
54
value.state =
ProsthesisState::DiscoveringServicesDone
;
55
break
;
56
case
BLEProthesisInterface::State::ConnectingService
:
57
value.state =
ProsthesisState::ConnectingService
;
58
break
;
59
case
BLEProthesisInterface::State::Running
:
60
value.state =
ProsthesisState::Running
;
61
break
;
62
case
BLEProthesisInterface::State::Killed
:
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
}
KITProsthesisIceDriver.h
BLEProthesisInterface::State::DiscoveringDevices
@ DiscoveringDevices
Definition
BLEProthesisInterface.h:16
BLEProthesisInterface::State::Created
@ Created
Definition
BLEProthesisInterface.h:15
BLEProthesisInterface::State::Running
@ Running
Definition
BLEProthesisInterface.h:24
BLEProthesisInterface::State::ConnectingService
@ ConnectingService
Definition
BLEProthesisInterface.h:23
BLEProthesisInterface::State::DiscoveringServicesDone
@ DiscoveringServicesDone
Definition
BLEProthesisInterface.h:22
BLEProthesisInterface::State::ConnectingDone
@ ConnectingDone
Definition
BLEProthesisInterface.h:20
BLEProthesisInterface::State::DiscoveringDevicesDone
@ DiscoveringDevicesDone
Definition
BLEProthesisInterface.h:17
BLEProthesisInterface::State::Connecting
@ Connecting
Definition
BLEProthesisInterface.h:19
BLEProthesisInterface::State::DiscoveringServices
@ DiscoveringServices
Definition
BLEProthesisInterface.h:21
BLEProthesisInterface::State::Disconnected
@ Disconnected
Definition
BLEProthesisInterface.h:18
BLEProthesisInterface::State::Killed
@ Killed
Definition
BLEProthesisInterface.h:25
KITProsthesisIceDriver::sendThumbPWM
void sendThumbPWM(const KITProsthesis::ProsthesisMotorValues &, const ::Ice::Current &=::Ice::emptyCurrent) override
Definition
KITProsthesisIceDriver.cpp:15
KITProsthesisIceDriver::sendFingerPWM
void sendFingerPWM(const KITProsthesis::ProsthesisMotorValues &, const ::Ice::Current &=::Ice::emptyCurrent) override
Definition
KITProsthesisIceDriver.cpp:21
KITProsthesisIceDriver::sendGrasp
void sendGrasp(Ice::Int, const Ice::Current &=Ice::emptyCurrent) override
Definition
KITProsthesisIceDriver.cpp:9
KITProsthesis::KITProstheticHandInterface::getSensorValues
ProsthesisSensorValues getSensorValues()
KITProsthesis::ProsthesisState::DiscoveringDevicesDone
@ DiscoveringDevicesDone
Definition
KITProstheticHandInterface.ice:36
KITProsthesis::ProsthesisState::Running
@ Running
Definition
KITProstheticHandInterface.ice:43
KITProsthesis::ProsthesisState::DiscoveringServices
@ DiscoveringServices
Definition
KITProstheticHandInterface.ice:40
KITProsthesis::ProsthesisState::ConnectingDone
@ ConnectingDone
Definition
KITProstheticHandInterface.ice:39
KITProsthesis::ProsthesisState::Connecting
@ Connecting
Definition
KITProstheticHandInterface.ice:38
KITProsthesis::ProsthesisState::Created
@ Created
Definition
KITProstheticHandInterface.ice:34
KITProsthesis::ProsthesisState::Killed
@ Killed
Definition
KITProstheticHandInterface.ice:44
KITProsthesis::ProsthesisState::Disconnected
@ Disconnected
Definition
KITProstheticHandInterface.ice:37
KITProsthesis::ProsthesisState::ConnectingService
@ ConnectingService
Definition
KITProstheticHandInterface.ice:42
KITProsthesis::ProsthesisState::DiscoveringServicesDone
@ DiscoveringServicesDone
Definition
KITProstheticHandInterface.ice:41
KITProsthesis::ProsthesisState::DiscoveringDevices
@ DiscoveringDevices
Definition
KITProstheticHandInterface.ice:35
KITProsthesis
Definition
KITProstheticHandInterface.ice:28
KITProsthesis::ProsthesisMotorValues
Definition
KITProstheticHandInterface.ice:49
KITProsthesis::ProsthesisMotorValues::pos
long pos
Definition
KITProstheticHandInterface.ice:52
KITProsthesis::ProsthesisMotorValues::v
long v
Definition
KITProstheticHandInterface.ice:50
KITProsthesis::ProsthesisMotorValues::maxPWM
long maxPWM
Definition
KITProstheticHandInterface.ice:51
KITProsthesis::ProsthesisSensorValues
Definition
KITProstheticHandInterface.ice:56
RobotAPI
drivers
KITProsthesisIceDriver
KITProsthesisIceDriver.cpp
Generated by
1.13.2