Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
iMSTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Boeckel
iMSTK
Commits
55a57e2d
Commit
55a57e2d
authored
6 years ago
by
Sreekanth Arikatla
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Add dummy client that can be controlled externally
parent
d9e125e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/Devices/imstkDummyClient.cpp
+39
-0
39 additions, 0 deletions
Source/Devices/imstkDummyClient.cpp
Source/Devices/imstkDummyClient.h
+93
-0
93 additions, 0 deletions
Source/Devices/imstkDummyClient.h
with
132 additions
and
0 deletions
Source/Devices/imstkDummyClient.cpp
0 → 100644
+
39
−
0
View file @
55a57e2d
/*=========================================================================
Library: iMSTK
Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
& Imaging in Medicine, Rensselaer Polytechnic Institute.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#include
<map>
#include
"imstkDummyClient.h"
#include
"g3log/g3log.hpp"
namespace
imstk
{
void
DummyClient
::
setButton
(
const
unsigned
int
buttonId
,
const
bool
buttonStatus
)
{
auto
x
=
m_buttons
.
find
(
buttonId
);
if
(
x
!=
m_buttons
.
end
())
{
x
->
second
=
buttonStatus
;
}
}
}
// imstk
This diff is collapsed.
Click to expand it.
Source/Devices/imstkDummyClient.h
0 → 100644
+
93
−
0
View file @
55a57e2d
/*=========================================================================
Library: iMSTK
Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
& Imaging in Medicine, Rensselaer Polytechnic Institute.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#ifndef imstkDummyClient_h
#define imstkDummyClient_h
#include
"imstkDeviceClient.h"
namespace
imstk
{
///
/// \class Dummy client
/// \brief Allows setting the pose of the device from external caller
///
class
DummyClient
:
public
DeviceClient
{
public:
///
/// \brief Constructor/Destructor
///
DummyClient
(
std
::
string
name
)
:
DeviceClient
(
name
,
"localhost"
){}
virtual
~
DummyClient
(){}
protected
:
///
/// \brief Initialize the phantom omni device
///
void
init
(
const
unsigned
int
numButtons
=
0
)
{
for
(
unsigned
int
i
=
0
;
i
<
numButtons
;
++
i
)
{
m_buttons
[
i
]
=
false
;
}
};
void
run
()
=
delete
;
void
cleanUp
()
=
delete
;
public
:
///
/// \brief Set position
///
void
setPosition
(
const
Vec3d
&
pos
)
{
m_position
=
pos
;
};
///
/// \brief Set velocity
///
void
setVelocity
(
const
Vec3d
&
vel
)
{
m_velocity
=
vel
;
};
///
/// \brief Set orientation
///
void
setOrientation
(
const
Quatd
&
orient
)
{
m_orientation
=
orient
;
};
///
/// \brief Set orientation from 4x4 transform
///
void
setOrientation
(
double
*
transform
)
{
m_orientation
=
(
Eigen
::
Affine3d
(
Eigen
::
Matrix4d
(
transform
))).
rotation
();
};
///
/// \brief Set the button status if it exists
///
void
setButton
(
const
unsigned
int
buttonId
,
const
bool
buttonStatus
);
};
}
#endif // ifndef imstkDummyClient_h
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment