-
Notifications
You must be signed in to change notification settings - Fork 1
/
RobotSimulatorEmergencyPhase.cxx
60 lines (42 loc) · 1.45 KB
/
RobotSimulatorEmergencyPhase.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*=========================================================================
Program: BRP Prostate Robot: Testing Simulator (Client)
Language: C++
Copyright (c) Brigham and Women's Hospital. All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
Please see
http://wiki.na-mic.org/Wiki/index.php/ProstateBRP_OpenIGTLink_Communication_June_2013
for the detail of the testing protocol.
=========================================================================*/
#include "RobotSimulatorEmergencyPhase.h"
#include <string.h>
#include <stdlib.h>
#include "igtlOSUtil.h"
#include "igtlStringMessage.h"
#include "igtlClientSocket.h"
#include "igtlStatusMessage.h"
#include "igtlTransformMessage.h"
#include <cmath>
RobotSimulatorEmergencyPhase::RobotSimulatorEmergencyPhase() :
RobotSimulatorPhaseBase()
{
}
RobotSimulatorEmergencyPhase::~RobotSimulatorEmergencyPhase()
{
}
int RobotSimulatorEmergencyPhase::Initialize()
{
// Send Status after waiting for 2 seconds (mimicking initialization process)
igtl::Sleep(500); // wait for 1000 msec
this->SendStatusMessage(this->Name(), 1, 0);
return 1;
}
int RobotSimulatorEmergencyPhase::MessageHandler(igtl::MessageHeader* headerMsg)
{
if (RobotSimulatorPhaseBase::MessageHandler(headerMsg))
{
return 1;
}
return 0;
}