Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
für robo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Sagun Pokhrel
für robo
Commits
da9aa07f
Commit
da9aa07f
authored
1 year ago
by
Sagun Pokhrel
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
47601a7d
Branches
Branches containing commit
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vda_api_v1.py
+68
-0
68 additions, 0 deletions
vda_api_v1.py
with
68 additions
and
0 deletions
vda_api_v1.py
0 → 100644
+
68
−
0
View file @
da9aa07f
import
json
from
flask
import
Flask
,
render_template
,
request
,
jsonify
import
pickle
app
=
Flask
(
__name__
)
# float64 num = 0.10;
# testknoten = [{"x": 0.50, "y": 0.0, "mapid": "p1"}, {"x": 0.50, "y": 0.50, "mapid": "p1"}]
@app.route
(
"
/
"
)
def
home
():
return
"
HI, Das hier ist der ROBOMASTER
"
# der Ursprungspunkt des AGV beim Start
@app.route
(
"
/Ursprung
"
,
methods
=
[
"
GET
"
])
def
test
():
if
request
.
method
==
"
GET
"
:
return
jsonify
({
"
x
"
:
0.0
,
"
y
"
:
0.0
,
"
mapid
"
:
"
Startpunkt
"
})
@app.route
(
"
/start
"
,
methods
=
[
"
GET
"
,
"
POST
"
])
def
start
():
if
request
.
method
==
"
GET
"
:
global
beginn
beginn
=
[
{
"
x
"
:
5.0
,
"
y
"
:
0.0
,
"
mapid
"
:
"
p1
"
},
{
"
x
"
:
5.0
,
"
y
"
:
5.0
,
"
mapid
"
:
"
p2
"
},
{
"
x
"
:
0.0
,
"
y
"
:
5.0
,
"
mapid
"
:
"
p3
"
},
{
"
x
"
:
-
5.0
,
"
y
"
:
5.0
,
"
mapid
"
:
"
p4
"
},
{
"
x
"
:
-
5.0
,
"
y
"
:
-
5.0
,
"
mapid
"
:
"
p5
"
}
]
return
jsonify
(
beginn
)
# beim aufruf soll irgendwie x und y übergeben werden können
# die koordinaten werden dann in dem array abgespeichert und an emil gesendet
@app.route
(
"
/Punkt
"
)
def
func
():
x_s
=
request
.
args
[
"
x
"
]
y_s
=
request
.
args
[
"
y
"
]
x
=
float
(
x_s
)
y
=
float
(
y_s
)
erg
=
jsonify
({
"
x
"
:
x
,
"
y
"
:
y
,
"
theta
"
:
0.0
,
"
mapid
"
:
"
knoten
"
,
"
mapDescription
"
:
"
infos
"
})
return
erg
# ziel ist es irgedwie einzelne knoten von außen zu bekommen,
if
__name__
==
"
__main__
"
:
app
.
run
(
host
=
"
0.0.0.0
"
,
port
=
5000
,
debug
=
False
)
# emil hat ebenfalls in seiner implemntation eine variante knoten zu deklarieren
# bei einer weitern implementierung kann von unserer seite der vda-mechnismus laufen:
# Leon schick koordinaten, und emil bekommt vda-knoten
# diese werden dann in der ros-implemntation abgespielt
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