Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Navigation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Software
ArmarX
Skills
Navigation
Commits
57539bfd
Commit
57539bfd
authored
3 years ago
by
Fabian Reister
Browse files
Options
Downloads
Patches
Plain Diff
remote gui: control group
parent
495f7ad0
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/Navigation/components/Navigator/Navigator.cpp
+116
-25
116 additions, 25 deletions
source/Navigation/components/Navigator/Navigator.cpp
source/Navigation/components/Navigator/Navigator.h
+20
-7
20 additions, 7 deletions
source/Navigation/components/Navigator/Navigator.h
with
136 additions
and
32 deletions
source/Navigation/components/Navigator/Navigator.cpp
+
116
−
25
View file @
57539bfd
...
...
@@ -22,6 +22,7 @@
#include
"Navigator.h"
#include
<cmath>
#include
<iterator>
#include
<boost/uuid/uuid.hpp>
...
...
@@ -198,32 +199,121 @@ void armarx::nav::components::Navigator::createRemoteGuiTab()
// Setup the widgets.
tab
.
boxLayerName
.
setValue
(
0
);
tab
.
numBoxes
.
setValue
(
1
);
tab
.
numBoxes
.
setRange
(
0
,
100
);
{
tab
.
targetPoseGroup
.
group
.
setLabel
(
"Target pose"
);
{
float
max
=
10'000
;
tab
.
targetPoseGroup
.
targetPoseX
.
setRange
(
-
max
,
max
);
tab
.
targetPoseGroup
.
targetPoseX
.
setDecimals
(
0
);
tab
.
targetPoseGroup
.
targetPoseX
.
setSteps
(
int
(
max
/
10
));
tab
.
targetPoseGroup
.
targetPoseX
.
setValue
(
0.
F
);
}
{
float
max
=
10'000
;
tab
.
targetPoseGroup
.
targetPoseY
.
setRange
(
-
max
,
max
);
tab
.
targetPoseGroup
.
targetPoseY
.
setDecimals
(
0
);
tab
.
targetPoseGroup
.
targetPoseY
.
setSteps
(
int
(
max
/
10
));
tab
.
targetPoseGroup
.
targetPoseY
.
setValue
(
0.
F
);
}
{
float
max
=
10'000
;
tab
.
targetPoseGroup
.
targetPoseZ
.
setRange
(
-
max
,
max
);
tab
.
targetPoseGroup
.
targetPoseZ
.
setDecimals
(
0
);
tab
.
targetPoseGroup
.
targetPoseZ
.
setSteps
(
int
(
max
/
10
));
tab
.
targetPoseGroup
.
targetPoseZ
.
setValue
(
0.
F
);
}
{
float
max
=
180
;
tab
.
targetPoseGroup
.
targetPoseRoll
.
setRange
(
-
max
,
max
);
tab
.
targetPoseGroup
.
targetPoseRoll
.
setDecimals
(
0
);
tab
.
targetPoseGroup
.
targetPoseRoll
.
setSteps
(
2
*
max
);
tab
.
targetPoseGroup
.
targetPoseRoll
.
setValue
(
0.
F
);
}
{
float
max
=
180
;
tab
.
targetPoseGroup
.
targetPosePitch
.
setRange
(
-
max
,
max
);
tab
.
targetPoseGroup
.
targetPosePitch
.
setDecimals
(
0
);
tab
.
targetPoseGroup
.
targetPosePitch
.
setSteps
(
2
*
max
);
tab
.
targetPoseGroup
.
targetPosePitch
.
setValue
(
0.
F
);
}
{
float
max
=
180
;
tab
.
targetPoseGroup
.
targetPoseYaw
.
setRange
(
-
max
,
max
);
tab
.
targetPoseGroup
.
targetPoseYaw
.
setDecimals
(
0
);
tab
.
targetPoseGroup
.
targetPoseYaw
.
setSteps
(
2
*
max
);
tab
.
targetPoseGroup
.
targetPoseYaw
.
setValue
(
0.
F
);
}
// tab.boxLayerName.setValue(0);
// tab.numBoxes.setValue(1);
// tab.numBoxes.setRange(0, 100);
// tab.drawBoxes.setLabel("Draw Boxes");
// Setup the layout.
GridLayout
grid
;
int
row
=
0
;
{
grid
.
add
(
Label
(
"X"
),
{
row
,
0
}).
add
(
tab
.
targetPoseGroup
.
targetPoseX
,
{
row
,
1
});
++
row
;
grid
.
add
(
Label
(
"Y"
),
{
row
,
0
}).
add
(
tab
.
targetPoseGroup
.
targetPoseY
,
{
row
,
1
});
++
row
;
grid
.
add
(
Label
(
"Z"
),
{
row
,
0
}).
add
(
tab
.
targetPoseGroup
.
targetPoseZ
,
{
row
,
1
});
++
row
;
grid
.
add
(
Label
(
"Roll"
),
{
row
,
0
}).
add
(
tab
.
targetPoseGroup
.
targetPoseRoll
,
{
row
,
1
});
++
row
;
grid
.
add
(
Label
(
"Pitch"
),
{
row
,
0
}).
add
(
tab
.
targetPoseGroup
.
targetPosePitch
,
{
row
,
1
});
++
row
;
grid
.
add
(
Label
(
"Yaw"
),
{
row
,
0
}).
add
(
tab
.
targetPoseGroup
.
targetPoseYaw
,
{
row
,
1
});
++
row
;
// grid.add(Label("Num Boxes"), {row, 0}).add(tab.numBoxes, {row, 1});
// ++row;
// grid.add(tab.drawBoxes, {row, 0}, {2, 1});
// ++row;
}
VBoxLayout
root
=
{
grid
,
VSpacer
()};
tab
.
targetPoseGroup
.
group
.
addChild
(
root
);
}
tab
.
drawBoxes
.
setLabel
(
"Draw Boxes"
);
{
tab
.
controlGroup
.
group
.
setLabel
(
"Control"
);
// Setup the layout.
GridLayout
grid
;
int
row
=
0
;
{
grid
.
add
(
tab
.
controlGroup
.
moveToButton
,
{
row
,
1
});
++
row
;
GridLayout
grid
;
int
row
=
0
;
{
grid
.
add
(
Label
(
"Box Layer"
),
{
row
,
0
}).
add
(
tab
.
boxLayerName
,
{
row
,
1
});
++
row
;
grid
.
add
(
tab
.
controlGroup
.
pauseButton
,
{
row
,
1
});
++
row
;
grid
.
add
(
Label
(
"Num Boxes"
),
{
row
,
0
}).
add
(
tab
.
numBoxes
,
{
row
,
1
});
++
row
;
grid
.
add
(
tab
.
controlGroup
.
continueButton
,
{
row
,
1
});
++
row
;
}
grid
.
add
(
tab
.
drawBoxes
,
{
row
,
0
},
{
2
,
1
})
;
++
row
;
VBoxLayout
root
=
{
grid
,
VSpacer
()}
;
tab
.
controlGroup
.
group
.
addChild
(
root
)
;
}
VBoxLayout
root
=
{
grid
,
VSpacer
()};
ARMARX_TRACE
;
RemoteGui_createTab
(
getName
(),
root
,
&
tab
);
RemoteGui_createTab
(
getName
(),
tab
.
targetPoseGroup
.
group
,
&
tab
);
}
void
armarx
::
nav
::
components
::
Navigator
::
RemoteGui_update
()
...
...
@@ -242,12 +332,13 @@ void armarx::nav::components::Navigator::RemoteGui_update()
// sendDebugObserverBatch();
// }
// }
if
(
tab
.
drawBoxes
.
wasClicked
())
{
// Lock shared variables in methods running in seperate threads
// and pass them to functions. This way, the called functions do
// not need to think about locking.
std
::
scoped_lock
lock
(
propertiesMutex
);
// drawBoxes(properties, arviz);
}
// if (tab.drawBoxes.wasClicked())
// {
// ARMARX_INFO << "Navigator control requested from remote GUI";
// // Lock shared variables in methods running in seperate threads
// // and pass them to functions. This way, the called functions do
// // not need to think about locking.
// std::scoped_lock lock(propertiesMutex);
// // drawBoxes(properties, arviz);
// }
}
This diff is collapsed.
Click to expand it.
source/Navigation/components/Navigator/Navigator.h
+
20
−
7
View file @
57539bfd
...
...
@@ -114,11 +114,9 @@ namespace armarx::nav::components
VirtualRobot
::
RobotPtr
getRobot
();
void
createRemoteGuiTab
();
void
RemoteGui_update
()
override
;
private:
// TODO update context periodically
...
...
@@ -128,17 +126,32 @@ namespace armarx::nav::components
server
::
PlatformUnitExecutor
executor
;
std
::
map
<
std
::
string
,
server
::
Navigator
>
navigators
;
std
::
mutex
propertiesMutex
;
struct
RemoteGuiTab
:
armarx
::
RemoteGui
::
Client
::
Tab
{
armarx
::
RemoteGui
::
Client
::
LineEdit
boxLayerName
;
armarx
::
RemoteGui
::
Client
::
IntSpinBox
numBoxes
;
struct
{
armarx
::
RemoteGui
::
Client
::
GroupBox
group
;
armarx
::
RemoteGui
::
Client
::
FloatSpinBox
targetPoseX
;
armarx
::
RemoteGui
::
Client
::
FloatSpinBox
targetPoseY
;
armarx
::
RemoteGui
::
Client
::
FloatSpinBox
targetPoseZ
;
armarx
::
RemoteGui
::
Client
::
FloatSpinBox
targetPoseRoll
;
armarx
::
RemoteGui
::
Client
::
FloatSpinBox
targetPosePitch
;
armarx
::
RemoteGui
::
Client
::
FloatSpinBox
targetPoseYaw
;
}
targetPoseGroup
;
struct
{
armarx
::
RemoteGui
::
Client
::
GroupBox
group
;
armarx
::
RemoteGui
::
Client
::
Button
moveToButton
;
armarx
::
RemoteGui
::
Client
::
Button
pauseButton
;
armarx
::
RemoteGui
::
Client
::
Button
continueButton
;
}
controlGroup
;
armarx
::
RemoteGui
::
Client
::
Button
drawBoxes
;
};
RemoteGuiTab
tab
;
};
...
...
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