Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
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
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
RobotAPI
Commits
01976b7e
Commit
01976b7e
authored
3 years ago
by
Fabian Paus
Browse files
Options
Downloads
Patches
Plain Diff
ArViz: Add initial interface for interactions
parent
d35869fc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/components/ArViz/Example/ArVizExample.cpp
+16
-0
16 additions, 0 deletions
source/RobotAPI/components/ArViz/Example/ArVizExample.cpp
source/RobotAPI/interface/ArViz/Elements.ice
+71
-1
71 additions, 1 deletion
source/RobotAPI/interface/ArViz/Elements.ice
with
87 additions
and
1 deletion
source/RobotAPI/components/ArViz/Example/ArVizExample.cpp
+
16
−
0
View file @
01976b7e
...
...
@@ -500,6 +500,18 @@ namespace armarx
}
void
fillInteractionLayer
(
viz
::
Layer
&
layer
)
{
// TODO: Add interaction to client code
// 1. Make box selectable
viz
::
Box
box
=
viz
::
Box
(
"box"
)
.
position
(
Eigen
::
Vector3f
(
2000.0
f
,
0.0
f
,
2000.0
f
))
.
size
(
Eigen
::
Vector3f
(
200.0
f
,
200.0
f
,
200.0
f
))
.
color
(
viz
::
Color
::
fromRGBA
(
0
,
165
,
255
));
layer
.
add
(
box
);
}
void
ArVizExample
::
run
()
{
...
...
@@ -524,6 +536,7 @@ namespace armarx
viz
::
Layer
objectsLayer
=
arviz
.
layer
(
"Objects"
);
viz
::
Layer
disAppearingLayer
=
arviz
.
layer
(
"DisAppearing"
);
viz
::
Layer
robotHandsLayer
=
arviz
.
layer
(
"RobotHands"
);
viz
::
Layer
interactionLayer
=
arviz
.
layer
(
"Interaction"
);
// These layers are not updated in the loop.
...
...
@@ -545,6 +558,9 @@ namespace armarx
arviz
.
commit
(
colorMapsLayer
);
}
fillInteractionLayer
(
interactionLayer
);
arviz
.
commit
(
interactionLayer
);
CycleUtil
c
(
20
);
while
(
!
task
->
isStopped
())
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/interface/ArViz/Elements.ice
+
71
−
1
View file @
01976b7e
...
...
@@ -2,7 +2,6 @@
#include
<ArmarXCore/interface/core/BasicTypes.ice>
#include
<ArmarXCore/interface/core/BasicVectorTypes.ice>
#include
<RobotAPI/interface/core/PoseBase.ice>
module
armarx
...
...
@@ -30,6 +29,75 @@ module data
byte
b
=
100
;
};
module
InteractionEnableFlags
{
const
int
NONE
=
0
;
const
int
SELECT
=
1
;
const
int
CONTEXT_MENU
=
2
;
const
int
TRANSLATION_X
=
4
;
const
int
TRANSLATION_Y
=
8
;
const
int
TRANSLATION_Z
=
16
;
const
int
ROTATION_X
=
32
;
const
int
ROTATION_Y
=
64
;
const
int
ROTATION_Z
=
128
;
};
struct
InteractionDescription
{
int
enableFlags
=
0
;
Ice
::
StringSeq
contextMenuOptions
;
};
module
InteractionFeedbackType
{
const
int
NONE
=
0
;
const
int
SELCECT
=
1
;
const
int
DESELECT
=
2
;
const
int
CONTEXT_MENU_OPEN
=
3
;
const
int
CONTEXT_MENU_CHOSEN
=
4
;
const
int
TRANSFORM
=
5
;
// Flag to indicate the kind of transformation
const
int
TRANSLATION_FLAG
=
16
;
const
int
ROTATION_FLAG
=
32
;
// Flag to indicate the axis used for transformation
const
int
AXIS_X_FLAG
=
64
;
const
int
AXIS_Y_FLAG
=
128
;
const
int
AXIS_Z_FLAG
=
256
;
// Flag to indicate state of the transformation
const
int
TRANSFORM_BEGIN_FLAG
=
512
;
const
int
TRANSFORM_DURING_FLAG
=
1024
;
const
int
TRANSFORM_END_FLAG
=
2048
;
};
struct
InteractionFeedback
{
// The type of interaction that happened (in the lower 4 bits)
// The higher bits are used for flags specifying more details of the interaction
int
type
=
0
;
// The element with which the interaction took place
string
layer
;
string
element
;
// The revision in which the interaction took place
long
revision
=
0
;
// Chosen context menu entry is only relevant for type == CONTEXT_MENU_CHOSEN
string
chosenContextMenuEntry
;
// Original and chosen poase are only relevant for type == TRANSFORM
GlobalPose
originalPose
;
GlobalPose
chosenPose
;
};
module
ElementFlags
{
const
int
NONE
=
0
;
...
...
@@ -40,6 +108,8 @@ module data
class
Element
{
string
id
;
InteractionDescription
interaction
;
GlobalPose
pose
;
float
scale
=
1
.
0
f
;
Color
color
;
...
...
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