First commit

This commit is contained in:
2025-11-07 11:39:23 +00:00
commit 4fb3471833
281 changed files with 6610 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#VRML_SIM R2023b utf8
# template language: javascript
PROTO BumpSensor [
field SFString name ""
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
] {
TouchSensor {
translation IS translation
rotation IS rotation
name IS name
children [
Shape {
appearance PBRAppearance {
baseColor 0.5 0 0
roughness 0.7
}
geometry DEF BUMPER Box {
size 0.01 0.05 0.01
}
}
]
boundingObject Box {
size 0.03 0.05 0.01
}
}
}

View File

@@ -0,0 +1,52 @@
#VRML_SIM R2023b utf8
PROTO Caster [
field SFString name ""
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
] {
Pose {
translation IS translation
rotation IS rotation
children [
Solid {
name IS name
children [
DEF CASTER_BALL Shape {
appearance PBRAppearance {
baseColor 0 0.0051864 0
roughness 0
metalness 0
}
geometry Sphere {
radius 0.005
}
castShadows FALSE
}
]
boundingObject USE CASTER_BALL
physics Physics {
density 8000 # steel
}
}
Pose {
translation 0 0 0.01075
children [
DEF CASTER_TOP_CYLINDER Shape {
appearance PBRAppearance {
baseColor 0 0.0051864 0
roughness 0.5
metalness 0
}
geometry Cylinder {
height 0.0215
radius 0.01
subdivision 6
top FALSE
}
}
]
}
]
}
}

View File

@@ -0,0 +1,51 @@
#VRML_SIM R2023b utf8
# template language: javascript
PROTO Flag [
field SFString name ""
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
field SFColor flagColour 0.1 0.1 0.7
] {
Solid {
translation IS translation
rotation IS rotation
name IS name
children [
Shape { # pole
appearance PBRAppearance {
baseColor 0.0705882 0.0705882 0.0705882
roughness 0.4
metalness 0
}
geometry Cylinder {
height 0.2
radius 0.0075
subdivision 8
bottom FALSE
}
}
Solid {
translation -0.08 0 0.04925
children [
Shape {
appearance PBRAppearance {
metalness 0
baseColor IS flagColour
}
geometry Box {
size 0.15 0.005 0.1
}
}
]
name %<= "\"" + fields.name.value + "flag\"" >%
}
]
boundingObject Box {
size 0.015 0.015 0.2
}
physics Physics {
density 1000
}
}
}

View File

@@ -0,0 +1,85 @@
#VRML_SIM R2023b utf8
# template language: javascript
PROTO MotorAssembly [
field SFString name ""
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
field SFFloat maxVelocity 25
field SFBool reversed FALSE
] {
Pose {
translation IS translation
rotation IS rotation
children [
Solid {
translation 0 0.04 0
rotation -1 0 0 1.5708
name %<= "\"" + fields.name.value + " housing\"" >%
children [
Shape {
appearance PBRAppearance {
baseColor 0.36 0.36 0.36
roughness 0.3
metalness 0
}
geometry Cylinder {
height 0.07
radius 0.015
subdivision 12
}
}
]
boundingObject Box {
size 0.03 0.03 0.07
}
physics Physics {
density 8000 # steel
}
}
HingeJoint {
jointParameters HingeJointParameters {
position 0
%< if (fields.reversed.value) { >%
axis 0 -1 0
%< } else { >%
axis 0 1 0
%< } >%
}
device [
RotationalMotor {
name IS name
maxVelocity IS maxVelocity
sound ""
}
PositionSensor {
name %<= "\"" + fields.name.value + " sensor\"" >%
}
]
endPoint Solid {
translation 0 0 0
rotation -1 0 0 1.5708
children [
DEF WHEEL_GEO Shape {
appearance PBRAppearance {
baseColor 0 0.0051864 0
roughness 0.3
metalness 0
}
geometry Cylinder {
height 0.021
radius 0.05
subdivision 24
}
}
]
name IS name
boundingObject USE WHEEL_GEO
physics Physics {
density 2000
}
}
}
]
}
}

View File

@@ -0,0 +1,37 @@
#VRML_SIM R2023b utf8
PROTO RGBLed [
field SFString name ""
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
] {
LED {
name IS name
translation IS translation
rotation IS rotation
children [
Shape {
appearance DEF APP_LED PBRAppearance {
baseColor 0.6 0.4 0.4
roughness 1
emissiveIntensity 100
}
geometry Box {
size 0.02 0.04 0.005
}
castShadows FALSE
}
]
color [
1 0 0 # RED
1 1 0 # YELLOW
0 1 0 # GREEN
0 1 1 # CYAN
0 0 1 # BLUE
1 0 1 # MAGENTA
1 1 1 # WHITE
]
}
}

View File

@@ -0,0 +1,40 @@
#VRML_SIM R2023b utf8
PROTO ReflectanceSensor [
field SFString name ""
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
] {
Pose {
translation IS translation
rotation IS rotation
children [
DistanceSensor {
name IS name
rotation 0 1 0 1.5708
type "infra-red"
lookupTable [
# 2% standard deviation
0 0 0.02
0.1 1023 0.02
]
children [
Pose {
children [
Shape {
appearance PBRAppearance {
baseColor 0.1 0.1 1
metalness 0
}
geometry Box {
size 0.002 0.045 0.015
}
castShadows FALSE
}
]
}
]
}
]
}
}

View File

@@ -0,0 +1,56 @@
#VRML_SIM R2023b utf8
PROTO RobotCamera [
field SFString name ""
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
field SFInt32 width 800
field SFInt32 height 450
] {
Camera {
name IS name
translation IS translation
rotation IS rotation
children [
Pose {
translation 0 0 0
rotation 0 1 0 1.5708
children [
Shape {
appearance PBRAppearance {
baseColor 0 0 0
}
geometry Cylinder {
height 0.01
radius 0.01
}
castShadows FALSE
}
]
translationStep 0.001
}
Pose {
translation -0.02 0 0
children [
Shape {
appearance PBRAppearance {
baseColor 0.4 0.4 0.4
metalness 0
}
geometry Box {
size 0.03 0.03 0.03
}
}
]
}
]
# In radians, ~45 degrees
fieldOfView 0.82
width IS width
height IS height
recognition Recognition {
frameThickness 2
maxRange 6
}
}
}

View File

@@ -0,0 +1,75 @@
#VRML_SIM R2023b utf8
# template language: javascript
PROTO UltrasoundModule [
field SFString name ""
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
field SFInt32 range 4
field SFBool upright FALSE
] {
DistanceSensor {
name IS name
translation IS translation
rotation IS rotation
type "sonar"
numberOfRays 10
aperture 0.3
lookupTable [
# 1% standard deviation, with no deviation at the limits
0 0 0
0.01 10 0.01
%<= fields.range.value * 0.99 >% %<= fields.range.value * 1000 * 0.99 >% 0.01
%<= fields.range.value >% %<= fields.range.value * 1000 >% 0
# Return 0 for out of range values
%<= fields.range.value + 0.001 >% 0 0
]
children [
Pose {
%< if (fields.upright.value) { >%
rotation 0 1 1 3.14159
%< } else { >%
rotation 0 0 1 3.14159
%< } >%
children [
Shape {
appearance PBRAppearance {
baseColor 0.1 0.1 1
metalness 0
}
geometry Box {
size 0.002 0.045 0.02
}
}
Pose {
translation -0.007 0.013 0
rotation 0 -1 0 1.5708
children [
DEF SONAR_TRX Shape {
appearance PBRAppearance {
baseColor 0.92 0.92 0.92
roughness 0.3
}
geometry Cylinder {
radius 0.008
height 0.012
subdivision 12
bottom FALSE
}
castShadows FALSE
}
]
}
Pose {
translation -0.007 -0.013 0
rotation 0 -1 0 1.5708
children [
USE SONAR_TRX
]
}
]
}
]
}
}

View File

@@ -0,0 +1,201 @@
#VRML_SIM R2023b utf8
# template language: javascript
PROTO VacuumSucker [
field SFString name ""
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
field SFFloat max_height 0.35
field SFFloat forward_reach 0.12
] {
Pose {
translation IS translation
rotation IS rotation
children [
Pose {
translation 0 0 %<= fields.max_height.value / 4 >%
children [
DEF BASE Solid {
children [
Shape {
appearance PBRAppearance {
baseColor 0.7 0.7 0.7
roughness 1
metalness 0
}
geometry DEF BASE_GEO Box {
size 0.06 0.06 %<= fields.max_height.value / 2 >%
}
}
]
name "Tower Base"
boundingObject USE BASE_GEO
physics Physics {
density 500 # Hollow Aluminium
}
}
SliderJoint {
jointParameters JointParameters {
axis 0 0 1
minStop 0
maxStop IS max_height
position 0.01
}
device [
LinearMotor {
name %<= "\"" + fields.name.value + " motor::main\"" >%
minPosition 0
maxPosition IS max_height
maxVelocity 2
sound ""
}
PositionSensor {
name %<= "\"" + fields.name.value + " position sensor\"" >%
}
]
endPoint Solid {
translation %<= (fields.forward_reach.value + 0.055) - 0.05 >% 0 %<= fields.max_height.value / 4 - 0.05 >%
children [
Solid {
children [
Pose {
translation %<= 0.025 - (fields.forward_reach.value + 0.055) / 2 >% 0 0.08
children [
Shape { # Horizontal arm
appearance PBRAppearance {
baseColor 0.7 0.7 0.7
roughness 1
metalness 0
}
geometry Box {
size %<= fields.forward_reach.value + 0.055 >% 0.05 0.02
}
}
]
}
Pose {
translation %<= 0.05 - (fields.forward_reach.value + 0.055) >% 0 %<= 0.06 - (fields.max_height.value / 4) >%
children [
Shape { # Column
appearance PBRAppearance {
baseColor 0.7 0.7 0.7
roughness 1
metalness 0
}
geometry DEF COLUMN_GEO Box {
size 0.05 0.05 %<= fields.max_height.value / 2 + 0.02 >%
}
}
]
}
Pose {
translation 0 0 0.045
children [
Shape {
appearance PBRAppearance {
baseColor 0.7 0.7 0.7
roughness 1
metalness 0
}
geometry Box {
size 0.05 0.05 0.05
}
}
]
}
]
name "Armature"
boundingObject Pose {
translation %<= 0.05 - (fields.forward_reach.value + 0.055) >% 0 %<= 0.06 - (fields.max_height.value / 4) >%
children [USE COLUMN_GEO]
}
physics Physics {
density 200 # Hollow Aluminium
}
}
DEF SUCKER Shape {
appearance PBRAppearance {
baseColor 0 0 0
roughness 1
metalness 1
}
geometry DEF hook_geo Box {
size 0.05 0.05 0.04
}
castShadows FALSE
}
Connector {
# Shift origin to near the lower face of the hook shape
translation 0 0 -0.01
rotation 0 1 0 3.1416
type "active"
distanceTolerance 0.094 # (0.14 / 2) * sqrt(2)
axisTolerance 3.1415
rotationTolerance 0
numberOfRotations 0
tensileStrength 35
shearStrength 20
snap FALSE
autoLock TRUE
name IS name
unilateralUnlock TRUE
unilateralLock TRUE
}
]
boundingObject Pose {
translation 0 0 0.005
children [
Box {
size 0.05 0.05 0.03
}
]
}
physics Physics {
density 1500 # rubber
}
}
}
# Secondary slider joint for telescoping column
SliderJoint {
jointParameters JointParameters {
axis 0 0 1
minStop 0
maxStop %<= fields.max_height.value / 2 >%
position 0.005
}
device [
LinearMotor {
name %<= "\"" + fields.name.value + " motor::extension\"" >%
minPosition 0
maxPosition %<= fields.max_height.value / 2 >%
maxVelocity 1
sound ""
multiplier 0.5
}
]
endPoint Solid {
translation 0 0 0.005
children [
Shape {
appearance PBRAppearance {
baseColor 0.7 0.7 0.7
roughness 1
metalness 0
}
geometry DEF COLUMN_GEO Box {
size 0.055 0.055 %<= fields.max_height.value / 2 + 0.01 >%
}
}
]
name "Extension"
boundingObject USE COLUMN_GEO
physics Physics {
density 200 # Hollow Aluminium
}
}
}
]
}
]
}
}