Skip to content

Commit 524fe86

Browse files
authored
Merge pull request #101 from brendanburkhart/feature/prm-image-types
Image/camera data types
2 parents 13943aa + c0801af commit 524fe86

File tree

8 files changed

+203
-1
lines changed

8 files changed

+203
-1
lines changed

cisstCommon/cmnDataFunctionsJSON.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ void CISST_EXPORT cmnDataJSON<unsigned int>::SerializeText(const DataType & data
6969
template <>
7070
void CISST_EXPORT cmnDataJSON<unsigned int>::DeSerializeText(DataType & data, const Json::Value & jsonValue) CISST_THROW(std::runtime_error);
7171

72+
template <>
73+
void CISST_EXPORT cmnDataJSON<long int>::SerializeText(const DataType & data, Json::Value & jsonValue);
74+
template <>
75+
void CISST_EXPORT cmnDataJSON<long int>::DeSerializeText(DataType & data, const Json::Value & jsonValue) CISST_THROW(std::runtime_error);
76+
7277
template <>
7378
void CISST_EXPORT cmnDataJSON<unsigned long int>::SerializeText(const DataType & data, Json::Value & jsonValue);
7479
template <>

cisstMultiTask/code/mtsInterfaceRequired.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,8 @@ void mtsInterfaceRequired::GetEventList(mtsEventHandlerList & eventList)
787787
iterEventWrite->second,
788788
MTS_OPTIONAL));
789789
}
790+
791+
eventList.SetValid(true);
790792
}
791793

792794

cisstMultiTask/code/mtsMailBox.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ void mtsMailBox::TriggerFinishedEventIfNeeded(const std::string &commandName, mt
222222
if (resultPointer->Valid() != result.IsOK()) {
223223
CMN_LOG_RUN_WARNING << "TriggerFinishedEventIfNeeded: result valid = " << resultPointer->Valid()
224224
<< ", result OK = " << result.IsOK()
225-
<< ", msg = " << mtsExecutionResult::ToString(result.Value()) << std::endl;
225+
<< ", msg = " << mtsExecutionResult::ToString(result.Value())
226+
<< ", msg type = " << resultPointer->Services()->GetName()
227+
<< ", command name = " << commandName << std::endl;
226228
}
227229
resultPointer->SetValid(result.IsOK()); // Set data valid flag based on execution result
228230
evt_result = finishedEvent->Execute(*resultPointer, MTS_NOT_BLOCKING);

cisstParameterTypes/code/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ cisst_data_generator (cisstParameterTypes
3030
../prmInputData.cdg
3131
../prmKeyValue.cdg
3232
../prmOperatingState.cdg
33+
../prmImageFrame.cdg
34+
../prmCameraInfo.cdg
35+
../prmDepthMap.cdg
3336
../prmForwardKinematicsRequest.cdg
3437
../prmForwardKinematicsResponse.cdg
3538
../prmInverseKinematicsRequest.cdg

cisstParameterTypes/code/prmClassServices.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ CMN_IMPLEMENT_SERVICES(prmInputData);
9999
#include <cisstParameterTypes/prmOperatingState.h>
100100
CMN_IMPLEMENT_SERVICES(prmOperatingState);
101101

102+
#include <cisstParameterTypes/prmImageFrame.h>
103+
CMN_IMPLEMENT_SERVICES(prmImageFrame);
104+
105+
#include <cisstParameterTypes/prmCameraInfo.h>
106+
CMN_IMPLEMENT_SERVICES(prmCameraInfo);
107+
108+
#include <cisstParameterTypes/prmDepthMap.h>
109+
CMN_IMPLEMENT_SERVICES(prmDepthMap);
110+
102111
#include <cisstParameterTypes/prmForwardKinematicsRequest.h>
103112
CMN_IMPLEMENT_SERVICES(prmForwardKinematicsRequest);
104113

cisstParameterTypes/prmCameraInfo.cdg

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2+
// ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab:
3+
4+
inline-header {
5+
#include <cisstVector/vctDynamicVectorTypes.h>
6+
#include <cisstVector/vctDynamicNArray.h>
7+
#include <cisstMultiTask/mtsGenericObject.h>
8+
// Always include last
9+
#include <cisstParameterTypes/prmExport.h>
10+
}
11+
12+
class {
13+
name prmCameraInfo;
14+
15+
attribute CISST_EXPORT;
16+
17+
base-class {
18+
type mtsGenericObject;
19+
is-data true;
20+
}
21+
22+
member {
23+
name Width;
24+
type size_t;
25+
default 0;
26+
}
27+
28+
member {
29+
name Height;
30+
type size_t;
31+
default 0;
32+
}
33+
34+
member {
35+
name DistortionParameters;
36+
type vctDoubleVec;
37+
}
38+
39+
member {
40+
name Intrinsic;
41+
type vct3x3;
42+
}
43+
44+
member {
45+
name Rectification;
46+
type vctRot3;
47+
}
48+
49+
member {
50+
name Projection;
51+
type vct3x4;
52+
}
53+
54+
inline-header {
55+
public:
56+
57+
private:
58+
CMN_DECLARE_SERVICES(CMN_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEFAULT);
59+
}
60+
}
61+
62+
63+
inline-header {
64+
CMN_DECLARE_SERVICES_INSTANTIATION(prmCameraInfo);
65+
}

cisstParameterTypes/prmDepthMap.cdg

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2+
// ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab:
3+
4+
inline-header {
5+
#include <cisstVector/vctDynamicVectorTypes.h>
6+
#include <cisstVector/vctDynamicNArray.h>
7+
#include <cisstMultiTask/mtsGenericObject.h>
8+
// Always include last
9+
#include <cisstParameterTypes/prmExport.h>
10+
}
11+
12+
class {
13+
name prmDepthMap;
14+
15+
attribute CISST_EXPORT;
16+
17+
base-class {
18+
type mtsGenericObject;
19+
is-data true;
20+
}
21+
22+
member {
23+
name Width;
24+
type size_t;
25+
default 0;
26+
}
27+
28+
member {
29+
name Height;
30+
type size_t;
31+
default 0;
32+
}
33+
34+
member {
35+
name Points;
36+
type vctDynamicVector<float>;
37+
}
38+
39+
member {
40+
name Color;
41+
type vctDynamicVector<char>;
42+
}
43+
44+
member {
45+
name ReferenceFrame;
46+
type std::string;
47+
}
48+
49+
inline-header {
50+
public:
51+
52+
private:
53+
CMN_DECLARE_SERVICES(CMN_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEFAULT);
54+
}
55+
}
56+
57+
58+
inline-header {
59+
CMN_DECLARE_SERVICES_INSTANTIATION(prmDepthMap);
60+
}

cisstParameterTypes/prmImageFrame.cdg

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2+
// ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab:
3+
4+
inline-header {
5+
#include <cisstVector/vctDynamicVectorTypes.h>
6+
#include <cisstVector/vctDynamicNArray.h>
7+
#include <cisstMultiTask/mtsGenericObject.h>
8+
// Always include last
9+
#include <cisstParameterTypes/prmExport.h>
10+
}
11+
12+
class {
13+
name prmImageFrame;
14+
15+
attribute CISST_EXPORT;
16+
17+
base-class {
18+
type mtsGenericObject;
19+
is-data true;
20+
}
21+
22+
member {
23+
name Width;
24+
type size_t;
25+
default 0;
26+
}
27+
28+
member {
29+
name Height;
30+
type size_t;
31+
default 0;
32+
}
33+
34+
member {
35+
name Channels;
36+
type size_t;
37+
default 3;
38+
}
39+
40+
member {
41+
name Data;
42+
type vctDynamicVector<char>;
43+
}
44+
45+
inline-header {
46+
public:
47+
48+
private:
49+
CMN_DECLARE_SERVICES(CMN_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEFAULT);
50+
}
51+
}
52+
53+
54+
inline-header {
55+
CMN_DECLARE_SERVICES_INSTANTIATION(prmImageFrame);
56+
}

0 commit comments

Comments
 (0)