Checkpoint 8

This commit is contained in:
Johnny Fernandes
2026-05-12 22:41:03 +01:00
parent a01a5c9cef
commit 5c2ee4bba5
31 changed files with 3189 additions and 380 deletions
+885
View File
@@ -0,0 +1,885 @@
#VRML_SIM R2025a utf8
# Shepherd Dog Robot - mecanum-wheeled base with dog character on top
# 4-wheel omnidirectional drive (front-left, front-right, rear-left, rear-right).
PROTO ShepherdDogMecanum [
field SFVec3f translation 0 0 0
field SFRotation rotation 0 1 0 0
field SFString name "ShepherdDog"
field SFString controller "shepherd_dog"
field MFString controllerArgs []
field SFString customData ""
field SFBool supervisor FALSE
field SFBool synchronization TRUE
]
{
Robot {
translation IS translation
rotation IS rotation
name IS name
controller IS controller
controllerArgs IS controllerArgs
customData IS customData
supervisor IS supervisor
synchronization IS synchronization
children [
# ========== CHASSIS / BASE ==========
DEF CHASSIS Transform {
translation 0 0 0.05
children [
Shape {
appearance DEF CHASSIS_APP PBRAppearance {
baseColor 0.2 0.2 0.2
roughness 0.6
metalness 0.3
}
geometry Box {
size 0.32 0.16 0.06
}
}
]
}
# Front slope
DEF CHASSIS_FRONT Transform {
translation 0.14 0 0.07
children [
Shape {
appearance USE CHASSIS_APP
geometry Box {
size 0.06 0.14 0.04
}
}
]
}
# Rear slope
DEF CHASSIS_REAR Transform {
translation -0.14 0 0.07
children [
Shape {
appearance USE CHASSIS_APP
geometry Box {
size 0.06 0.14 0.04
}
}
]
}
# ========== DOG BODY on top of chassis ==========
DEF BODY Transform {
translation 0 0 0.11
children [
Shape {
appearance DEF FUR_BROWN PBRAppearance {
baseColor 0.55 0.35 0.17
roughness 0.85
metalness 0.0
}
geometry Box {
size 0.30 0.16 0.08
}
}
]
}
# ========== CHEST ==========
DEF CHEST Transform {
translation 0.12 0 0.11
children [
Shape {
appearance DEF FUR_CREAM PBRAppearance {
baseColor 0.85 0.72 0.55
roughness 0.85
metalness 0.0
}
geometry Box {
size 0.08 0.18 0.08
}
}
]
}
# ========== HEAD ==========
DEF HEAD Transform {
translation 0.20 0 0.17
children [
Shape {
appearance USE FUR_BROWN
geometry Box {
size 0.10 0.12 0.09
}
}
]
}
# ========== SNOUT + LIDAR ==========
DEF SNOUT Transform {
translation 0.28 0 0.155
children [
Shape {
appearance USE FUR_CREAM
geometry Box {
size 0.08 0.07 0.05
}
}
# Nose
Transform {
translation 0.04 0 0.01
children [
Shape {
appearance PBRAppearance {
baseColor 0.1 0.1 0.1
roughness 0.4
}
geometry Sphere {
radius 0.013
subdivision 2
}
}
]
}
# Lidar front-facing 140° FOV, mounted at snout tip
Lidar {
translation 0.05 0 0.01
name "lidar"
horizontalResolution 180
fieldOfView 2.44
numberOfLayers 1
minRange 0.10
maxRange 12.0
noise 0.005
}
]
}
# ========== LEFT EAR ==========
DEF LEFT_EAR HingeJoint {
jointParameters HingeJointParameters {
axis 0 0 1
anchor 0.19 0.055 0.21
}
device [
RotationalMotor {
name "left ear motor"
maxVelocity 10.0
minPosition -0.5
maxPosition 0.5
}
]
endPoint Solid {
translation 0.19 0.055 0.21
rotation 0 0 1 0.2
name "left ear"
children [
Shape {
appearance DEF FUR_DARK PBRAppearance {
baseColor 0.35 0.20 0.10
roughness 0.85
metalness 0.0
}
geometry Box {
size 0.035 0.025 0.06
}
}
]
boundingObject Box {
size 0.035 0.025 0.06
}
physics Physics {
density -1
mass 0.005
}
}
}
# ========== RIGHT EAR ==========
DEF RIGHT_EAR HingeJoint {
jointParameters HingeJointParameters {
axis 0 0 1
anchor 0.19 -0.055 0.21
}
device [
RotationalMotor {
name "right ear motor"
maxVelocity 10.0
minPosition -0.5
maxPosition 0.5
}
]
endPoint Solid {
translation 0.19 -0.055 0.21
rotation 0 0 -1 0.2
name "right ear"
children [
Shape {
appearance USE FUR_DARK
geometry Box {
size 0.035 0.025 0.06
}
}
]
boundingObject Box {
size 0.035 0.025 0.06
}
physics Physics {
density -1
mass 0.005
}
}
}
# ========== EYES ==========
DEF LEFT_EYE Transform {
translation 0.25 0.05 0.19
children [
Shape {
appearance PBRAppearance {
baseColor 0.95 0.95 0.95
roughness 0.3
}
geometry Sphere {
radius 0.016
subdivision 2
}
}
# Pupil
Transform {
translation 0.012 0 0.004
children [
Shape {
appearance PBRAppearance {
baseColor 0.1 0.1 0.1
roughness 0.2
}
geometry Sphere {
radius 0.009
subdivision 2
}
}
]
}
]
}
DEF RIGHT_EYE Transform {
translation 0.25 -0.05 0.19
children [
Shape {
appearance PBRAppearance {
baseColor 0.95 0.95 0.95
roughness 0.3
}
geometry Sphere {
radius 0.016
subdivision 2
}
}
# Pupil
Transform {
translation 0.012 0 0.004
children [
Shape {
appearance PBRAppearance {
baseColor 0.1 0.1 0.1
roughness 0.2
}
geometry Sphere {
radius 0.009
subdivision 2
}
}
]
}
]
}
# ========== COLLAR ==========
DEF COLLAR Transform {
translation 0.16 0 0.125
children [
Shape {
appearance PBRAppearance {
baseColor 0.8 0.1 0.1
roughness 0.5
}
geometry Cylinder {
height 0.02
radius 0.095
subdivision 16
}
}
# ID tag
Transform {
translation 0 0.10 0
rotation 1 0 0 1.5708
children [
Shape {
appearance PBRAppearance {
baseColor 0.75 0.75 0.0
metalness 0.8
roughness 0.2
}
geometry Cylinder {
height 0.003
radius 0.018
subdivision 8
}
}
]
}
]
}
# ========== TAIL (lidar inside tail tip ball) ==========
DEF TAIL HingeJoint {
jointParameters HingeJointParameters {
axis 0 1 0
anchor -0.15 0 0.11
}
device [
RotationalMotor {
name "tail motor"
maxVelocity 5.0
minPosition -1.0
maxPosition 1.0
}
]
endPoint Solid {
translation -0.17 0 0.13
name "tail solid"
children [
Shape {
appearance USE FUR_BROWN
geometry Capsule {
height 0.12
radius 0.013
top FALSE
}
}
# Tail tip ball
Transform {
translation 0 0 0.08
children [
Shape {
appearance PBRAppearance {
baseColor 0.2 0.2 0.2
roughness 0.3
metalness 0.6
}
geometry Sphere {
radius 0.028
subdivision 4
}
}
]
}
]
boundingObject Group {
children [
Capsule {
height 0.12
radius 0.013
}
Transform {
translation 0 0 0.08
children [
Sphere {
radius 0.028
}
]
}
]
}
physics Physics {
density -1
mass 0.08
}
}
}
# ========== AXLE ARMS (4 corners) ==========
DEF FRONT_RIGHT_AXLE Transform {
translation 0.14 -0.115 0.038
children [
Shape {
appearance PBRAppearance {
baseColor 0.5 0.5 0.5
roughness 0.3
metalness 0.8
}
geometry Box {
size 0.02 0.08 0.02
}
}
]
}
DEF FRONT_LEFT_AXLE Transform {
translation 0.14 0.115 0.038
children [
Shape {
appearance PBRAppearance {
baseColor 0.5 0.5 0.5
roughness 0.3
metalness 0.8
}
geometry Box {
size 0.02 0.08 0.02
}
}
]
}
DEF REAR_RIGHT_AXLE Transform {
translation -0.14 -0.115 0.038
children [
Shape {
appearance PBRAppearance {
baseColor 0.5 0.5 0.5
roughness 0.3
metalness 0.8
}
geometry Box {
size 0.02 0.08 0.02
}
}
]
}
DEF REAR_LEFT_AXLE Transform {
translation -0.14 0.115 0.038
children [
Shape {
appearance PBRAppearance {
baseColor 0.5 0.5 0.5
roughness 0.3
metalness 0.8
}
geometry Box {
size 0.02 0.08 0.02
}
}
]
}
# ========== FRONT RIGHT WHEEL ==========
DEF FRONT_RIGHT_WHEEL_JOINT HingeJoint {
jointParameters HingeJointParameters {
axis 0 1 0
anchor 0.14 -0.14 0.038
}
device [
RotationalMotor {
name "front right wheel motor"
maxVelocity 70.0
maxTorque 20.0
}
PositionSensor {
name "front right wheel sensor"
resolution 0.00628
}
]
endPoint Solid {
translation 0.14 -0.14 0.038
rotation 0 -1 0 1.570796
children [
DEF WHEEL_VIS Pose {
rotation 1 0 0 -1.5708
children [
# Hub drum
Shape {
appearance PBRAppearance {
baseColor 0.5 0.5 0.5
roughness 0.3
metalness 0.7
}
geometry Cylinder {
height 0.018
radius 0.022
subdivision 16
}
}
# Axle boss
Shape {
appearance PBRAppearance {
baseColor 0.6 0.6 0.6
roughness 0.2
metalness 0.8
}
geometry Cylinder {
height 0.022
radius 0.008
subdivision 8
}
}
# Mecanum roller 1 (top, +y)
DEF ROLLER_1 Pose {
translation 0 0.031 0
rotation 0 0 1 0.7854
children [
Shape {
appearance PBRAppearance {
baseColor 0.12 0.12 0.12
roughness 0.7
metalness 0.1
}
geometry Capsule {
height 0.020
radius 0.007
subdivision 8
}
}
]
}
# Mecanum roller 2 (right, +x)
DEF ROLLER_2 Pose {
translation 0.031 0 0
rotation 0 0 1 0.7854
children [
Shape {
appearance PBRAppearance {
baseColor 0.12 0.12 0.12
roughness 0.7
metalness 0.1
}
geometry Capsule {
height 0.020
radius 0.007
subdivision 8
}
}
]
}
# Mecanum roller 3 (bottom, -y)
DEF ROLLER_3 Pose {
translation 0 -0.031 0
rotation 0 0 1 0.7854
children [
Shape {
appearance PBRAppearance {
baseColor 0.12 0.12 0.12
roughness 0.7
metalness 0.1
}
geometry Capsule {
height 0.020
radius 0.007
subdivision 8
}
}
]
}
# Mecanum roller 4 (left, -x)
DEF ROLLER_4 Pose {
translation -0.031 0 0
rotation 0 0 1 0.7854
children [
Shape {
appearance PBRAppearance {
baseColor 0.12 0.12 0.12
roughness 0.7
metalness 0.1
}
geometry Capsule {
height 0.020
radius 0.007
subdivision 8
}
}
]
}
# Mecanum roller 5 (diagonal +x+y)
DEF ROLLER_5 Pose {
translation 0.022 0.022 0
rotation 0 0 1 0.7854
children [
Shape {
appearance PBRAppearance {
baseColor 0.12 0.12 0.12
roughness 0.7
metalness 0.1
}
geometry Capsule {
height 0.020
radius 0.007
subdivision 8
}
}
]
}
# Mecanum roller 6 (diagonal +x-y)
DEF ROLLER_6 Pose {
translation 0.022 -0.022 0
rotation 0 0 1 0.7854
children [
Shape {
appearance PBRAppearance {
baseColor 0.12 0.12 0.12
roughness 0.7
metalness 0.1
}
geometry Capsule {
height 0.020
radius 0.007
subdivision 8
}
}
]
}
# Mecanum roller 7 (diagonal -x-y)
DEF ROLLER_7 Pose {
translation -0.022 -0.022 0
rotation 0 0 1 0.7854
children [
Shape {
appearance PBRAppearance {
baseColor 0.12 0.12 0.12
roughness 0.7
metalness 0.1
}
geometry Capsule {
height 0.020
radius 0.007
subdivision 8
}
}
]
}
# Mecanum roller 8 (diagonal -x+y)
DEF ROLLER_8 Pose {
translation -0.022 0.022 0
rotation 0 0 1 0.7854
children [
Shape {
appearance PBRAppearance {
baseColor 0.12 0.12 0.12
roughness 0.7
metalness 0.1
}
geometry Capsule {
height 0.020
radius 0.007
subdivision 8
}
}
]
}
]
}
]
name "front right wheel"
contactMaterial "MecanumWheel"
boundingObject Pose {
rotation 1 0 0 -1.5708
children [
Cylinder {
height 0.022
radius 0.038
}
]
}
physics Physics {
density -1
mass 0.06
centerOfMass [
0 0 0
]
}
}
}
# ========== FRONT LEFT WHEEL ==========
DEF FRONT_LEFT_WHEEL_JOINT HingeJoint {
jointParameters HingeJointParameters {
axis 0 1 0
anchor 0.14 0.14 0.038
}
device [
RotationalMotor {
name "front left wheel motor"
maxVelocity 70.0
maxTorque 20.0
}
PositionSensor {
name "front left wheel sensor"
resolution 0.00628
}
]
endPoint Solid {
translation 0.14 0.14 0.038
rotation 0.707105 0 0.707109 -3.14159
children [
USE WHEEL_VIS
]
name "front left wheel"
contactMaterial "MecanumWheel"
boundingObject Pose {
rotation 1 0 0 -1.5708
children [
Cylinder {
height 0.022
radius 0.038
}
]
}
physics Physics {
density -1
mass 0.06
centerOfMass [
0 0 0
]
}
}
}
# ========== REAR RIGHT WHEEL ==========
DEF REAR_RIGHT_WHEEL_JOINT HingeJoint {
jointParameters HingeJointParameters {
axis 0 1 0
anchor -0.14 -0.14 0.038
}
device [
RotationalMotor {
name "rear right wheel motor"
maxVelocity 70.0
maxTorque 20.0
}
PositionSensor {
name "rear right wheel sensor"
resolution 0.00628
}
]
endPoint Solid {
translation -0.14 -0.14 0.038
rotation 0 -1 0 1.570796
children [
USE WHEEL_VIS
]
name "rear right wheel"
contactMaterial "MecanumWheel"
boundingObject Pose {
rotation 1 0 0 -1.5708
children [
Cylinder {
height 0.022
radius 0.038
}
]
}
physics Physics {
density -1
mass 0.06
centerOfMass [
0 0 0
]
}
}
}
# ========== REAR LEFT WHEEL ==========
DEF REAR_LEFT_WHEEL_JOINT HingeJoint {
jointParameters HingeJointParameters {
axis 0 1 0
anchor -0.14 0.14 0.038
}
device [
RotationalMotor {
name "rear left wheel motor"
maxVelocity 70.0
maxTorque 20.0
}
PositionSensor {
name "rear left wheel sensor"
resolution 0.00628
}
]
endPoint Solid {
translation -0.14 0.14 0.038
rotation 0.707105 0 0.707109 -3.14159
children [
USE WHEEL_VIS
]
name "rear left wheel"
contactMaterial "MecanumWheel"
boundingObject Pose {
rotation 1 0 0 -1.5708
children [
Cylinder {
height 0.022
radius 0.038
}
]
}
physics Physics {
density -1
mass 0.06
centerOfMass [
0 0 0
]
}
}
}
# ========== IMU SENSORS ==========
Accelerometer {
translation 0 0 0.10
name "accelerometer"
}
Gyro {
translation 0 0 0.10
name "gyro"
}
Compass {
translation 0 0 0.10
name "compass"
}
# ========== GPS ==========
GPS {
translation 0 0 0.17
name "gps"
}
# ========== RECEIVER ==========
Receiver {
name "receiver"
channel 1
}
# ========== EMITTER ==========
Emitter {
name "emitter"
channel 1
range 50.0
}
]
# ========== BOUNDING OBJECT ==========
boundingObject Group {
children [
# Chassis box
Transform {
translation 0 0 0.05
children [
Box {
size 0.32 0.16 0.06
}
]
}
# Body box
Transform {
translation 0 0 0.11
children [
Box {
size 0.30 0.16 0.08
}
]
}
]
}
# ========== PHYSICS ==========
physics Physics {
density -1
mass 5.0
centerOfMass [
0 0 0.03
]
}
}
}