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
}
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:855
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:15
KITProsthesisIceDriver::sendGrasp
void sendGrasp(Ice::Int, const Ice::Current &=Ice::emptyCurrent) override
Definition:
KITProsthesisIceDriver.cpp:9
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:917
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:21
BLEProthesisInterface::State::DiscoveringDevicesDone
@ DiscoveringDevicesDone
KITProsthesis::ProsthesisState::Connecting
@ Connecting
Definition:
KITProstheticHandInterface.ice:38
BLEProthesisInterface::State::DiscoveringDevices
@ DiscoveringDevices
RobotAPI
drivers
KITProsthesisIceDriver
KITProsthesisIceDriver.cpp
Generated on Sat Mar 29 2025 09:17:26 for armarx_documentation by
1.8.17