9 #include "imstkDeviceClient.h" 24 namespace IO {
class SerialStream; }
40 uint16_t deviceId = -1;
41 unsigned char modelNumber = -1;
42 unsigned char hardwareVersion = -1;
43 unsigned char firmwareVersion = -1;
44 Haply::HardwareAPI::UUID quat;
47 friend std::ostream& operator<<(std::ostream& os,
const DeviceInfo& info);
57 void update()
override;
65 DeviceClient(name,
"localhost"), m_handleName(handleName) { }
81 class HaplyHandle :
public Haply::HardwareAPI::Devices::Handle
84 HaplyHandle(std::iostream* stream) : Handle(stream) { }
87 void OnReceiveHandleInfo(HandleInfoResponse& response)
override { m_infoResponse = response; }
88 void OnReceiveHandleStatusMessage(HandleStatusResponse& response)
override { m_statusResponse = response; }
89 void OnReceiveHandleErrorResponse(HandleErrorResponse& response)
override { m_errorResponse = response; }
92 Haply::HardwareAPI::Devices::Handle::HandleInfoResponse m_infoResponse;
93 Haply::HardwareAPI::Devices::Handle::HandleStatusResponse m_statusResponse;
95 Haply::HardwareAPI::Devices::Handle::HandleErrorResponse m_errorResponse;
99 std::shared_ptr<Haply::HardwareAPI::Devices::Inverse3> m_device;
100 std::shared_ptr<Haply::HardwareAPI::IO::SerialStream> m_deviceStream;
102 std::string m_handleName =
"";
103 bool m_handleEnabled =
false;
104 unsigned char m_lastReturnType;
105 std::shared_ptr<HaplyHandle> m_handleDevice;
106 std::shared_ptr<Haply::HardwareAPI::IO::SerialStream> m_handleDeviceStream;
107 Haply::HardwareAPI::Devices::Inverse3::EndEffectorStateResponse m_deviceResponse;
109 Vec3f m_devicePos = Vec3f::Zero();
110 Vec3f m_deviceVelocity = Vec3f::Zero();
111 Vec3f m_deviceForce = Vec3f::Zero();
112 DeviceInfo m_deviceInfo;
The device client's represents the device and provides an interface to acquire data from a device...
HaplyDeviceClient(const std::string &name="", const std::string &handleName="")
Constructor/Destructor, only the DeviceManager can construct.
Subclass of DeviceClient for haply, currently implemented only for the Inverse3. Warning: This code i...
Devices manager using Haply, only supports Inverse3 right now Warning: This code is based off an earl...