Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image/camera data types #101

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cisstCommon/cmnDataFunctionsJSON.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ void CISST_EXPORT cmnDataJSON<unsigned int>::SerializeText(const DataType & data
template <>
void CISST_EXPORT cmnDataJSON<unsigned int>::DeSerializeText(DataType & data, const Json::Value & jsonValue) CISST_THROW(std::runtime_error);

template <>
void CISST_EXPORT cmnDataJSON<long int>::SerializeText(const DataType & data, Json::Value & jsonValue);
template <>
void CISST_EXPORT cmnDataJSON<long int>::DeSerializeText(DataType & data, const Json::Value & jsonValue) CISST_THROW(std::runtime_error);

template <>
void CISST_EXPORT cmnDataJSON<unsigned long int>::SerializeText(const DataType & data, Json::Value & jsonValue);
template <>
Expand Down
2 changes: 2 additions & 0 deletions cisstMultiTask/code/mtsInterfaceRequired.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,8 @@ void mtsInterfaceRequired::GetEventList(mtsEventHandlerList & eventList)
iterEventWrite->second,
MTS_OPTIONAL));
}

eventList.SetValid(true);
}


Expand Down
4 changes: 3 additions & 1 deletion cisstMultiTask/code/mtsMailBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ void mtsMailBox::TriggerFinishedEventIfNeeded(const std::string &commandName, mt
if (resultPointer->Valid() != result.IsOK()) {
CMN_LOG_RUN_WARNING << "TriggerFinishedEventIfNeeded: result valid = " << resultPointer->Valid()
<< ", result OK = " << result.IsOK()
<< ", msg = " << mtsExecutionResult::ToString(result.Value()) << std::endl;
<< ", msg = " << mtsExecutionResult::ToString(result.Value())
<< ", msg type = " << resultPointer->Services()->GetName()
<< ", command name = " << commandName << std::endl;
}
resultPointer->SetValid(result.IsOK()); // Set data valid flag based on execution result
evt_result = finishedEvent->Execute(*resultPointer, MTS_NOT_BLOCKING);
Expand Down
3 changes: 3 additions & 0 deletions cisstParameterTypes/code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ cisst_data_generator (cisstParameterTypes
../prmInputData.cdg
../prmKeyValue.cdg
../prmOperatingState.cdg
../prmImageFrame.cdg
../prmCameraInfo.cdg
../prmDepthMap.cdg
../prmForwardKinematicsRequest.cdg
../prmForwardKinematicsResponse.cdg
../prmInverseKinematicsRequest.cdg
Expand Down
9 changes: 9 additions & 0 deletions cisstParameterTypes/code/prmClassServices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ CMN_IMPLEMENT_SERVICES(prmInputData);
#include <cisstParameterTypes/prmOperatingState.h>
CMN_IMPLEMENT_SERVICES(prmOperatingState);

#include <cisstParameterTypes/prmImageFrame.h>
CMN_IMPLEMENT_SERVICES(prmImageFrame);

#include <cisstParameterTypes/prmCameraInfo.h>
CMN_IMPLEMENT_SERVICES(prmCameraInfo);

#include <cisstParameterTypes/prmDepthMap.h>
CMN_IMPLEMENT_SERVICES(prmDepthMap);

#include <cisstParameterTypes/prmForwardKinematicsRequest.h>
CMN_IMPLEMENT_SERVICES(prmForwardKinematicsRequest);

Expand Down
65 changes: 65 additions & 0 deletions cisstParameterTypes/prmCameraInfo.cdg
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab:

inline-header {
#include <cisstVector/vctDynamicVectorTypes.h>
#include <cisstVector/vctDynamicNArray.h>
#include <cisstMultiTask/mtsGenericObject.h>
// Always include last
#include <cisstParameterTypes/prmExport.h>
}

class {
name prmCameraInfo;

attribute CISST_EXPORT;

base-class {
type mtsGenericObject;
is-data true;
}

member {
name Width;
type size_t;
default 0;
}

member {
name Height;
type size_t;
default 0;
}

member {
name DistortionParameters;
type vctDoubleVec;
}

member {
name Intrinsic;
type vct3x3;
}

member {
name Rectification;
type vctRot3;
}

member {
name Projection;
type vct3x4;
}

inline-header {
public:

private:
CMN_DECLARE_SERVICES(CMN_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEFAULT);
}
}


inline-header {
CMN_DECLARE_SERVICES_INSTANTIATION(prmCameraInfo);
}
60 changes: 60 additions & 0 deletions cisstParameterTypes/prmDepthMap.cdg
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab:

inline-header {
#include <cisstVector/vctDynamicVectorTypes.h>
#include <cisstVector/vctDynamicNArray.h>
#include <cisstMultiTask/mtsGenericObject.h>
// Always include last
#include <cisstParameterTypes/prmExport.h>
}

class {
name prmDepthMap;

attribute CISST_EXPORT;

base-class {
type mtsGenericObject;
is-data true;
}

member {
name Width;
type size_t;
default 0;
}

member {
name Height;
type size_t;
default 0;
}

member {
name Points;
type vctDynamicVector<float>;
}

member {
name Color;
type vctDynamicVector<char>;
}

member {
name ReferenceFrame;
type std::string;
}

inline-header {
public:

private:
CMN_DECLARE_SERVICES(CMN_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEFAULT);
}
}


inline-header {
CMN_DECLARE_SERVICES_INSTANTIATION(prmDepthMap);
}
56 changes: 56 additions & 0 deletions cisstParameterTypes/prmImageFrame.cdg
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab:

inline-header {
#include <cisstVector/vctDynamicVectorTypes.h>
#include <cisstVector/vctDynamicNArray.h>
#include <cisstMultiTask/mtsGenericObject.h>
// Always include last
#include <cisstParameterTypes/prmExport.h>
}

class {
name prmImageFrame;

attribute CISST_EXPORT;

base-class {
type mtsGenericObject;
is-data true;
}

member {
name Width;
type size_t;
default 0;
}

member {
name Height;
type size_t;
default 0;
}

member {
name Channels;
type size_t;
default 3;
}

member {
name Data;
type vctDynamicVector<char>;
}

inline-header {
public:

private:
CMN_DECLARE_SERVICES(CMN_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEFAULT);
}
}


inline-header {
CMN_DECLARE_SERVICES_INSTANTIATION(prmImageFrame);
}