Skip to content

Commit

Permalink
Merge pull request #140 from BlueAndi/feature/3D_models
Browse files Browse the repository at this point in the history
Better 3D Models
  • Loading branch information
gabryelreyes authored Jul 25, 2024
2 parents 9374349 + d34f085 commit cd4f128
Show file tree
Hide file tree
Showing 11 changed files with 254,433 additions and 43 deletions.
153 changes: 117 additions & 36 deletions webots/protos/Zumo32U4.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#VRML_SIM R2023a utf8
# template language: javascript

EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2023a/projects/appearances/protos/Rubber.proto"

Expand All @@ -8,6 +9,7 @@ PROTO Zumo32U4 [
field SFString name "Zumo"
field SFString contactMaterial "default" # Contact material of the tracks
field SFNode zumoComSystemSlot NULL # Slot for the ZumoComSystem
field SFBool performanceMode FALSE # Use basic blocks for the robot instead of meshes. Increases performance.
]
{
Robot {
Expand All @@ -30,9 +32,10 @@ PROTO Zumo32U4 [
}
DEF SHIELD Group {
children [
%< if (true == fields.performanceMode.value) { >%
Transform {
translation 0.047 0 0.007
rotation 0 1 0 -0.42
translation 0.046 0 0.006
rotation 0 1 0 -0.26
children [
Shape {
appearance PBRAppearance {
Expand All @@ -44,6 +47,7 @@ PROTO Zumo32U4 [
}
]
}
%<}>%
]
}
DEF TRACK_LEFT Track {
Expand Down Expand Up @@ -184,38 +188,20 @@ PROTO Zumo32U4 [
}
DEF BODY Group {
children [
Shape {
Shape {
appearance DEF BODY_COLOR PBRAppearance {
emissiveColor 0.2 0.2 0.2
baseColor 0.2 0.2 0.2
metalness 0
}
geometry DEF BODY_GEOMETRY Box {
size 0.06 0.065 0.02
size 0.085 0.065 0.023
}
}
Transform {
translation 0.0325 0 0.0025
children [
Shape {
appearance USE BODY_COLOR
geometry Box {
size 0.025 0.065 0.015
}
}
]
}
Transform {
translation -0.01 0 0
children [
Shape {
appearance USE BODY_COLOR
geometry USE BODY_GEOMETRY
}
]
}
]
}
DEF LINE_SENSOR_ARRAY Group {
children [
%< if (true == fields.performanceMode.value) { >%
Transform {
translation 0.0425 0 -0.0075
children [
Expand All @@ -228,7 +214,7 @@ PROTO Zumo32U4 [
]
}
Transform {
translation 0.049 0 -0.009
translation 0.044 0 -0.009
children [
Shape {
appearance USE BODY_COLOR
Expand All @@ -238,14 +224,18 @@ PROTO Zumo32U4 [
}
]
}
%<}>%
DistanceSensor {
translation 0.05 0.001 -0.01
translation 0.045 0.001 -0.01
rotation 0 1 0 1.5708
children [
Shape {
appearance DEF LSAPPEARANCE PBRAppearance {
baseColor 0 0 0
metalness 0
%< if (false == fields.performanceMode.value) { >%
transparency 1
%<}>%
}
geometry DEF LIGHTSENSOR Box {
size 0.00025 0.002 0.004
Expand All @@ -265,13 +255,16 @@ PROTO Zumo32U4 [
aperture 0.4
}
Emitter {
translation 0.05 -0.001 -0.01
translation 0.045 -0.001 -0.01
rotation 0 1 0 1.5708
children [
Shape {
appearance DEF EMAPPEARANCE PBRAppearance {
baseColor 1 0 0
metalness 0
%< if (false == fields.performanceMode.value) { >%
transparency 1
%<}>%
}
geometry DEF EMITTER Box {
size 0.00025 0.002 0.004
Expand All @@ -286,7 +279,7 @@ PROTO Zumo32U4 [
aperture 0.35
}
DistanceSensor {
translation 0.05 0.011 -0.01
translation 0.045 0.011 -0.01
rotation 0 1 0 1.5708
children [
Shape {
Expand All @@ -306,7 +299,7 @@ PROTO Zumo32U4 [
aperture 0.4
}
Emitter {
translation 0.05 0.009 -0.01
translation 0.045 0.009 -0.01
rotation 0 1 0 1.5708
children [
Shape {
Expand All @@ -321,7 +314,7 @@ PROTO Zumo32U4 [
aperture 0.35
}
DistanceSensor {
translation 0.05 -0.009 -0.01
translation 0.045 -0.009 -0.01
rotation 0 1 0 1.5708
children [
Shape {
Expand All @@ -341,7 +334,7 @@ PROTO Zumo32U4 [
aperture 0.4
}
Emitter {
translation 0.05 -0.011 -0.01
translation 0.045 -0.011 -0.01
rotation 0 1 0 1.5708
children [
Shape {
Expand All @@ -356,7 +349,7 @@ PROTO Zumo32U4 [
aperture 0.35
}
DistanceSensor {
translation 0.05 0.046 -0.01
translation 0.045 0.046 -0.01
rotation 0 1 0 1.5708
children [
Shape {
Expand All @@ -376,7 +369,7 @@ PROTO Zumo32U4 [
aperture 0.4
}
Emitter {
translation 0.05 0.044 -0.01
translation 0.045 0.044 -0.01
rotation 0 1 0 1.5708
children [
Shape {
Expand All @@ -391,7 +384,7 @@ PROTO Zumo32U4 [
aperture 0.35
}
DistanceSensor {
translation 0.05 -0.044 -0.01
translation 0.045 -0.044 -0.01
rotation 0 1 0 1.5708
children [
Shape {
Expand All @@ -411,7 +404,7 @@ PROTO Zumo32U4 [
aperture 0.4
}
Emitter {
translation 0.05 -0.046 -0.01
translation 0.045 -0.046 -0.01
rotation 0 1 0 1.5708
children [
Shape {
Expand Down Expand Up @@ -569,6 +562,94 @@ PROTO Zumo32U4 [
}
]
}
%< if (false == fields.performanceMode.value) { >%
DEF MESH Transform {
translation 0 0 -0.01
scale 0.001 0.001 0.001
children [
%< if (undefined == fields.zumoComSystemSlot.value) { >%
Shape {
appearance PBRAppearance {
baseColor 0.1 0.4 0.1
metalness 0
}
geometry Mesh {
url [
"./mesh_Zumo32U4/lcd_1.stl"
]
name "LCD"
}
castShadows FALSE
}
%<}>%
Shape {
appearance PBRAppearance {
baseColor 0.74902 0.737255 0.694118
metalness 0
}
geometry Mesh {
url [
"./mesh_Zumo32U4/blade_default_1.stl"
]
name "Blade"
}
castShadows FALSE
}
Shape {
appearance PBRAppearance {
baseColor 0.180392 0.172549 0.160784
metalness 0
}
geometry Mesh {
url [
"./mesh_Zumo32U4/ir-emitter-led-holder_default_1.stl"
]
name "Emitter_holder"
}
castShadows FALSE
}
Shape {
appearance PBRAppearance {
baseColor 0.858824 0.843137 0.8
metalness 0
}
geometry Mesh {
url [
"./mesh_Zumo32U4/ir-led_left_1.stl"
]
name "IR_Left"
}
castShadows FALSE
}
Shape {
appearance PBRAppearance {
baseColor 0.858824 0.839216 0.796078
metalness 0
}
geometry Mesh {
url [
"./mesh_Zumo32U4/ir-led_right_1.stl"
]
name "IR_Right"
}
castShadows FALSE
}
Shape {
appearance PBRAppearance {
baseColor 0.0941176 0.0941176 0.0862745
metalness 0
}
geometry Mesh {
url [
"./mesh_Zumo32U4/irs08a_default_1.stl"
]
name "IRS"
}
castShadows FALSE
}
]
}
%<}>%
]
name IS name
boundingObject USE BODY
Expand Down
26 changes: 19 additions & 7 deletions webots/protos/ZumoComSystem.proto
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
#VRML_SIM R2023a utf8
# template language: javascript

PROTO ZumoComSystem [
field SFString name "ZumoComSystem"
field SFString name "ZumoComSystem"
field SFBool performanceMode FALSE # Use basic blocks for the robot instead of meshes. Increases performance.
]
{
Slot {
type "ZumoComSystem"
endPoint Robot {
translation 0 0 0.1
translation -0.005 0 0.018
children [
DEF BODY Group {
children [
%< if (false == fields.performanceMode.value) { >%
Transform {
translation -0.05 0.033 0
rotation 8.8992e-07 1.07489e-06 1 -1.5535153071795866
scale 0.01 0.01 0.01
children [
CadShape {
url [
"./mesh_ZumoComSystem/ZumoComSystem.obj"
]
}
]
}
%< } else { >%
Shape {
geometry Box {
size 0.06 0.05 0.01
}
}
%<}>%
]
}
Receiver {
Expand All @@ -32,11 +49,6 @@ PROTO ZumoComSystem [
]
name IS name
description "DroidControlShip"
boundingObject USE BODY
physics Physics {
density -1
mass 0.1
}
controller "<extern>"
}
}
Expand Down
Binary file added webots/protos/mesh_Zumo32U4/blade_default_1.stl
Binary file not shown.
Binary file not shown.
Binary file added webots/protos/mesh_Zumo32U4/ir-led_left_1.stl
Binary file not shown.
Binary file added webots/protos/mesh_Zumo32U4/ir-led_right_1.stl
Binary file not shown.
Binary file added webots/protos/mesh_Zumo32U4/irs08a_default_1.stl
Binary file not shown.
Binary file added webots/protos/mesh_Zumo32U4/lcd_1.stl
Binary file not shown.
32 changes: 32 additions & 0 deletions webots/protos/mesh_ZumoComSystem/ZumoComSystem.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# WaveFront *.mtl file (generated by Autodesk ATF)

newmtl Opaque(255,255,255)
Kd 1.000000 1.000000 1.000000

newmtl Opaque(64,64,64)
Kd 0.250980 0.250980 0.250980

newmtl Steel_-_Satin
Kd 0.627451 0.627451 0.627451

newmtl Opaque(202,209,238)
Kd 0.792157 0.819608 0.933333

newmtl Opaque(211,175,56)
Kd 0.827451 0.686275 0.219608

newmtl Opaque(192,192,192)
Kd 0.752941 0.752941 0.752941

newmtl Opaque(57,57,57)
Kd 0.223529 0.223529 0.223529

newmtl Opaque(165,158,150)
Kd 0.647059 0.619608 0.588235

newmtl Opaque(165,132,0)
Kd 0.647059 0.517647 0.000000

newmtl Opaque(80,124,105)
Kd 0.313725 0.486275 0.411765

Loading

0 comments on commit cd4f128

Please sign in to comment.