= BURT Research - System Overview = {{{ #!div class="left" align="left" [[Image(htdocs:therapy/SystemOverview/system-overview.PNG)]] }}} BurtSharp is a client program to communicate with the Mainboard firmware through a CoAP/UDP-based server to control the BURT robot. BurtSharp provides the ability to monitor and respond to robot state information (position, configuration, fault states, etc.), basic control functions to specify robot behavior, and an interface to provide this functionality to Unity games. The BurtSharp control library is not real-time as it is built on top of Linux, which is not inherently real-time. BurtSharp uses similar communication protocol like ROS. Even though is fast, it is inherently best-effort in many cases and does not provide guarantees about the timing of control operations. ROS utilizes TCP/IP communication which is not able to achieve real-time communication over Ethernet. Although, BurtSharp uses the Constrained Application Protocol (CoAP) which was developed for devices constrained in terms of processing capabilities and power. == CoAP protocol == CoAP (http://coap.technology/) communicates based on Representational State Transfer (REST) architecture and supports four modes of REST which are PUT, GET, POST, and DELETE. A client sends a request with any one of the four modes and the server will respond with a reply in accordance with the request. The CoAP supports two modes: reliable and non-reliable. For instance, we use the reliable mode for activating the robot and non-reliable mode for sending force data. Reliability in CoAP is handled by using Confirmable (CON) messages. For every CON message send to the server, this will be replied by Acknowledge (ACK) packages to the client. In essence, CoAP's job is to define the URI structure (a hierarchy of objects accessible by GET/POST); handle GET/POST requests; handle the ACKs for confirmable transmissions; deal with dropped, reordered, or duplicate packets. MessagePack's job is to encode/decode structured data without resorting to encoding numbers as text. == Software Architecture Hierarchy == BURT-Research offers a Research Environment that comprises two libraries, BurtSharp and BurtSharp.UnityInterface, and a Medical demo application. The figure below illustrates the architecture of the two libraries that the Research Environment consists of. BurtSharp is a client program that communicates and controls the BURT robot, and BurtSharp.UnityInterface is an extension to BurtSharp that allows use of haptic objects and fixtures with Unity. Researchers can use these two libraries to test their control and haptic capabilities and can develop their own research tools. {{{ #!div class="left" align="left" [[Image(htdocs:therapy/SystemOverview/SystemArchitecture.PNG)]] }}} == BurtSharp Message Types == The mainboard control loop runs at 500 Hz, able to do math, send and receive messages in a stable and reliable way. BurtSharp subscribes to mainboard control loop messages. The BurtSharp-CoAP client runs in a separate thread “RunControlCycle()” and executes a callback to form the next control cycle output every time a message is received from the server “OnReceiveServerUpdate()”. This is higher reliable than having the replies be completely asynchronous from the mainboard control loop messages. BurtSharp sends one message (“RobotCommand”) per control cycle. * The BurtSharp-CoAP client subscribes to observable resource group packages such as: * ServerUpdate * "position": [x, y, z] * "velocity": [x, y, z] * "joint_position": [j1, j2, j3] * "joint_velocities": [j1, j2, j3] * "timestamp": * RobotStatus * "handedness": u8 * "Outerlink": u8 * "Patient": u8 * "Estop": u8 * The BurtSharp-CoAP client sends asynchronous NON-confirmable PUT requests to the mainboard-server through the “AsyncNonPutRequest” method. These requested messages can be one of the following control modes: * Cartesian Forces * Joint Torques * Cartesian Torques * Cartesian Forces + Joints Torques * The BurtSharp-CoAP client subscribes at mainboard fault updates and to observable resource faults information such as: * MainBoardFault.NotReady * MainBoardFault.NoCanAtStartup * MainBoardFault.NoCoapAtStartup * MainBoardFault.OuterLinkDisconnected * MainBoardFault.HandednessUnknown * MainBoardFault.InvalidEepromCrc * MainBoardFault.EStopPressed * MainBoardFault.EStopLatched * MainBoardFault.InitFailed * MainBoardFault.TorqueLimitJ1 * MainBoardFault.TorqueLimitJ2 * MainBoardFault.TorqueLimitJ3 * MainBoardFault.NotInHomingPositionAtStartup The Mainboard-CoAP communication API below enables researchers to interface their own controllers listening to CoAP protocol. http://web.barrett.com/support/Burt_Documentation/MainboardApi/v1.0.0/