Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
web-ros3rag
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
JastAdd
web-ros3rag
Commits
cdd97099
Commit
cdd97099
authored
2 years ago
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
coordinator activated
parent
a82654a8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+24
-21
24 additions, 21 deletions
main.py
with
24 additions
and
21 deletions
main.py
+
24
−
21
View file @
cdd97099
...
...
@@ -40,7 +40,16 @@ message_queue = queue.Queue()
expert_view_buttons
=
[
'
send-place-a-model-details
'
,
'
send-place-b-model-details
'
,
'
send-place-b-demo-initial_scene
'
'
send-place-b-demo-initial_scene
'
,
'
send-coordinator-model-details
'
,
'
send-place-a-robot-ctrl-up
'
,
'
send-place-b-robot-ctrl-up
'
,
'
send-place-a-rag-up
'
,
'
send-place-b-rag-up
'
,
'
send-place-a-robot-ctrl-ready
'
,
'
send-place-b-robot-ctrl-ready
'
,
'
send-place-a-rag-ready
'
,
'
send-place-b-rag-ready
'
,
]
# button-id: (topic, payload)
...
...
@@ -71,17 +80,15 @@ commands = {
'
send-coordinator-model-details
'
:
(
'
coordinator/model
'
,
'
details
'
),
'
send-coordinator-exit
'
:
(
'
coordinator/exit
'
,
'
1
'
),
#
'send-place-a-robot-ctrl-up': ('ros-place-a/status', 'up'),
#
'send-place-b-robot-ctrl-up': ('ros-place-b/status', 'up'),
'
send-place-a-robot-ctrl-up
'
:
(
'
ros-place-a/status
'
,
'
up
'
),
'
send-place-b-robot-ctrl-up
'
:
(
'
ros-place-b/status
'
,
'
up
'
),
'
send-place-a-rag-up
'
:
(
'
rag-a/status
'
,
'
up
'
),
'
send-place-b-rag-up
'
:
(
'
rag-b/status
'
,
'
up
'
),
'
send-dummy-up
'
:
(
'
random/status
'
,
'
up
'
),
#
'send-place-a-robot-ctrl-ready': ('ros-place-a/status', 'ready'),
#
'send-place-b-robot-ctrl-ready': ('ros-place-b/status', 'ready'),
'
send-place-a-robot-ctrl-ready
'
:
(
'
ros-place-a/status
'
,
'
ready
'
),
'
send-place-b-robot-ctrl-ready
'
:
(
'
ros-place-b/status
'
,
'
ready
'
),
'
send-place-a-rag-ready
'
:
(
'
rag-a/status
'
,
'
ready
'
),
'
send-place-b-rag-ready
'
:
(
'
rag-b/status
'
,
'
ready
'
),
'
send-dummy-ready
'
:
(
'
random/status
'
,
'
ready
'
),
}
# button-id: (topic, textarea-content-id, protobuf-object)
...
...
@@ -191,24 +198,22 @@ app.layout = html.Div([
html
.
H3
(
"
Coordinator
"
),
# html.Div([ # Row for commands coordinator
html
.
Button
(
'
Model
'
,
id
=
'
send-coordinator-model
'
,
style
=
button_style_normal
),
html
.
Button
(
'
Model (Details)
'
,
id
=
'
send-coordinator-model-details
'
,
style
=
button_style_normal
),
html
.
Button
(
'
Model (Details)
'
,
id
=
'
send-coordinator-model-details
'
,
style
=
button_style_normal
_invisible
),
html
.
Button
(
'
Exit
'
,
id
=
'
send-coordinator-exit
'
,
style
=
button_style_exit
),
# ], className='row'),
# html.Div([ # Row for commands up
# html.Button('Robot Control A Up', id='send-place-a-robot-ctrl-up', style=button_style_normal),
# html.Button('Robot Control B Up', id='send-place-b-robot-ctrl-up', style=button_style_normal),
html
.
Button
(
'
RAG A Up
'
,
id
=
'
send-place-a-rag-up
'
,
style
=
button_style_normal
),
html
.
Button
(
'
RAG B Up
'
,
id
=
'
send-place-b-rag-up
'
,
style
=
button_style_normal
),
html
.
Button
(
'
Dummy Up
'
,
id
=
'
send-dummy-up
'
,
style
=
button_style_normal
),
html
.
Button
(
'
Robot A Up
'
,
id
=
'
send-place-a-robot-ctrl-up
'
,
style
=
button_style_normal_invisible
),
html
.
Button
(
'
Robot B Up
'
,
id
=
'
send-place-b-robot-ctrl-up
'
,
style
=
button_style_normal_invisible
),
html
.
Button
(
'
RAG A Up
'
,
id
=
'
send-place-a-rag-up
'
,
style
=
button_style_normal_invisible
),
html
.
Button
(
'
RAG B Up
'
,
id
=
'
send-place-b-rag-up
'
,
style
=
button_style_normal_invisible
),
# ], className='row'),
# html.Div([ # Row for commands ready
# html.Button('Robot Control A Ready', id='send-place-a-robot-ctrl-ready', style=button_style_normal),
# html.Button('Robot Control B Ready', id='send-place-b-robot-ctrl-ready', style=button_style_normal),
html
.
Button
(
'
RAG A Ready
'
,
id
=
'
send-place-a-rag-ready
'
,
style
=
button_style_normal
),
html
.
Button
(
'
RAG B Ready
'
,
id
=
'
send-place-b-rag-ready
'
,
style
=
button_style_normal
),
html
.
Button
(
'
Dummy Ready
'
,
id
=
'
send-dummy-ready
'
,
style
=
button_style_normal
),
html
.
Button
(
'
Robot A Ready
'
,
id
=
'
send-place-a-robot-ctrl-ready
'
,
style
=
button_style_normal_invisible
),
html
.
Button
(
'
Robot B Ready
'
,
id
=
'
send-place-b-robot-ctrl-ready
'
,
style
=
button_style_normal_invisible
),
html
.
Button
(
'
RAG A Ready
'
,
id
=
'
send-place-a-rag-ready
'
,
style
=
button_style_normal_invisible
),
html
.
Button
(
'
RAG B Ready
'
,
id
=
'
send-place-b-rag-ready
'
,
style
=
button_style_normal_invisible
),
# ], className='row'),
],
className
=
"
four columns
"
,
id
=
'
coordinator-div
'
,
style
=
{
'
display
'
:
'
none
'
}
),
],
className
=
"
four columns
"
,
id
=
'
coordinator-div
'
),
html
.
Div
([
# Column for commands of place a
html
.
H3
(
"
Commands Place A
"
),
html
.
Button
(
'
Model
'
,
id
=
'
send-place-a-model
'
,
style
=
button_style_normal
),
...
...
@@ -364,7 +369,6 @@ def send_json_for_object_to_topic(json_content: str, obj, topic: str):
@app.callback
(
[
Output
(
button_id
,
'
style
'
)
for
button_id
in
expert_view_buttons
],
Output
(
'
coordinator-div
'
,
'
style
'
),
Output
(
'
arm-buttons
'
,
'
style
'
),
Output
(
'
object-buttons
'
,
'
style
'
),
Input
(
'
expert-view
'
,
'
value
'
)
...
...
@@ -373,7 +377,6 @@ def toggle_expert_view(visibility_state):
local_buttons_style
=
dict
(
buttons_style
)
local_buttons_style
[
'
display
'
]
=
'
flex
'
if
visibility_state
else
'
none
'
result
=
[
button_style_normal
if
visibility_state
else
button_style_normal_invisible
for
_
in
expert_view_buttons
]
result
.
append
({
'
display
'
:
'
block
'
if
visibility_state
else
'
none
'
})
result
.
append
(
local_buttons_style
)
result
.
append
(
local_buttons_style
)
print
(
result
)
...
...
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