KITProsthesisIceDriver.cpp
Go to the documentation of this file.
1
#include "
KITProsthesisIceDriver.h
"
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
21
ProsthesisSensorValues
KITProsthesisIceDriver::getSensorValues
(
const
Ice::Current&)
22
{
23
ProsthesisSensorValues
value
;
24
switch
(iface.getState())
25
{
26
case
BLEProthesisInterface::State::Created
:
27
value
.state =
ProsthesisState::Created
;
28
break
;
29
case
BLEProthesisInterface::State::DiscoveringDevices
:
30
value
.state =
ProsthesisState::DiscoveringDevices
;
31
break
;
32
case
BLEProthesisInterface::State::DiscoveringDevicesDone
:
33
value
.state =
ProsthesisState::DiscoveringDevicesDone
;
34
break
;
35
case
BLEProthesisInterface::State::Disconnected
:
36
value
.state =
ProsthesisState::Disconnected
;
37
break
;
38
case
BLEProthesisInterface::State::Connecting
:
39
value
.state =
ProsthesisState::Connecting
;
40
break
;
41
case
BLEProthesisInterface::State::ConnectingDone
:
42
value
.state =
ProsthesisState::ConnectingDone
;
43
break
;
44
case
BLEProthesisInterface::State::DiscoveringServices
:
45
value
.state =
ProsthesisState::DiscoveringServices
;
46
break
;
47
case
BLEProthesisInterface::State::DiscoveringServicesDone
:
48
value
.state =
ProsthesisState::DiscoveringServicesDone
;
49
break
;
50
case
BLEProthesisInterface::State::ConnectingService
:
51
value
.state =
ProsthesisState::ConnectingService
;
52
break
;
53
case
BLEProthesisInterface::State::Running
:
54
value
.state =
ProsthesisState::Running
;
55
break
;
56
case
BLEProthesisInterface::State::Killed
:
57
value
.state =
ProsthesisState::Killed
;
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
RobotAPI
drivers
KITProsthesisIceDriver
KITProsthesisIceDriver.cpp
Generated on Sat Oct 12 2024 09:14:07 for armarx_documentation by
1.8.17