Skip to content
Snippets Groups Projects
Commit 88279883 authored by Yusuke Tanaka's avatar Yusuke Tanaka
Browse files

Added sensors for now

parent f238b458
No related merge requests found
......@@ -136,3 +136,8 @@ dmypy.json
# Cython debug symbols
cython_debug/
.idea
output/
/output/
......@@ -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,120,20):
for width in range(60,120,20):
for height in range(20,60,10):
for length in range(80,200,30):
for width in range(60,200,30):
for height in range(20,200,30):
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=False)
a.makeOutput("output/Paperbot/%(length)d_%(width)d_%(height)d/" %locals(), thickness=.3, tree=False, display=False, Webots=True)
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment