Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rocolib_old
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yusuke Tanaka
rocolib_old
Commits
88279883
Commit
88279883
authored
4 years ago
by
Yusuke Tanaka
Browse files
Options
Downloads
Patches
Plain Diff
Added sensors for now
parent
f238b458
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+5
-0
5 additions, 0 deletions
.gitignore
TestPaperbot.py
+4
-4
4 additions, 4 deletions
TestPaperbot.py
rocolib/api/composables/graph/WboExporter.py
+52
-0
52 additions, 0 deletions
rocolib/api/composables/graph/WboExporter.py
with
61 additions
and
4 deletions
.gitignore
+
5
−
0
View file @
88279883
...
...
@@ -136,3 +136,8 @@ dmypy.json
# Cython debug symbols
cython_debug/
.idea
output/
/output/
This diff is collapsed.
Click to expand it.
TestPaperbot.py
+
4
−
4
View file @
88279883
...
...
@@ -13,12 +13,12 @@ height =30
#a.makeOutput("output/Paperbot_Whole", thickness=1, tree=False, display=False, botId=botId, Webots=True)
for
length
in
range
(
80
,
1
20
,
2
0
):
for
width
in
range
(
60
,
1
20
,
2
0
):
for
height
in
range
(
20
,
6
0
,
1
0
):
for
length
in
range
(
80
,
2
0
0
,
3
0
):
for
width
in
range
(
60
,
2
0
0
,
3
0
):
for
height
in
range
(
20
,
20
0
,
3
0
):
a
=
None
a
=
getComponent
(
"
Paperbot
"
,
length
=
length
,
width
=
width
,
height
=
height
)
a
.
makeOutput
(
"
output/Paperbot/%(length)d_%(width)d_%(height)d/
"
%
locals
(),
thickness
=
.
3
,
tree
=
False
,
display
=
False
,
Webots
=
Fals
e
)
a
.
makeOutput
(
"
output/Paperbot/%(length)d_%(width)d_%(height)d/
"
%
locals
(),
thickness
=
.
3
,
tree
=
False
,
display
=
False
,
Webots
=
Tru
e
)
This diff is collapsed.
Click to expand it.
rocolib/api/composables/graph/WboExporter.py
+
52
−
0
View file @
88279883
...
...
@@ -62,6 +62,11 @@ class WboRobotGenerator:
#other parts are added with solid
robotChildrenNodes
.
append
(
self
.
generateSolidNode
(
shapeName
,
shape
))
# TODO: remove this part ASAP
# Currently force to add sensors, but we don't technically have those information yet
robotChildrenNodes
.
append
(
self
.
generateCompassNode
())
robotChildrenNodes
.
append
(
self
.
generateGpsNode
())
#generate robot node and export
self
.
exportRobotWbo
(
self
.
generateRobotNode
(
robotChildrenNodes
))
...
...
@@ -134,6 +139,53 @@ class WboRobotGenerator:
"""
%
locals
()
def
generateCompassNode
(
self
):
return
"""
Compass {
children [
Solid {
translation 0 0.005 -0.072
children [
Shape {
appearance PBRAppearance {
baseColor 0.76463 0.937881 0
metalness 0
}
geometry Cylinder {
height 0.02
radius 0.005
}
}
]
}
]
name
"
Compass
"
}
"""
def
generateGpsNode
(
self
):
return
"""
GPS {
children [
Solid {
translation 0 0.005 -0.072
children [
DEF GPS Shape {
appearance PBRAppearance {
baseColor 1 0 0.0184329
metalness 0
}
geometry Cylinder {
height 0.01
radius 0.01
}
}
]
}
]
name
"
Globe_GPS
"
}
"""
class
WboShapeGenerator
:
# """
# WboExporter is a class to generate wbo file for webots simulations
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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