Skip to content

Commit

Permalink
Joined DCS to RU using slot
Browse files Browse the repository at this point in the history
  • Loading branch information
gabryelreyes committed Jul 16, 2024
1 parent d7d53e5 commit e915d9a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 73 deletions.
44 changes: 19 additions & 25 deletions webots/protos/Zumo32U4.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2023a/projects/appearances/protos/Rubber.proto"

PROTO Zumo32U4 [
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
field SFString name "Zumo"
field SFString contactMaterial "default" # Contact material of the tracks
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
field SFString name "Zumo"
field SFString contactMaterial "default" # Contact material of the tracks
field SFNode zumoComSystemSlot NULL # Slot for the ZumoComSystem
]
{
Robot {
Expand All @@ -23,6 +24,10 @@ PROTO Zumo32U4 [
}
Speaker {
}
Slot {
type "ZumoComSystem"
endPoint IS zumoComSystemSlot
}
DEF SHIELD Group {
children [
Transform {
Expand All @@ -42,7 +47,6 @@ PROTO Zumo32U4 [
]
}
DEF TRACK_LEFT Track {
contactMaterial IS contactMaterial
translation 0 0.0375 0
rotation 0 1 0 0
children [
Expand Down Expand Up @@ -77,6 +81,7 @@ PROTO Zumo32U4 [
}
]
name "left_track"
contactMaterial IS contactMaterial
boundingObject DEF TRACK_BO Group {
children [
Transform {
Expand Down Expand Up @@ -128,7 +133,6 @@ PROTO Zumo32U4 [
geometriesCount 70
}
DEF TRACK_RIGHT Track {
contactMaterial IS contactMaterial
translation 0 -0.0375 0
children [
DEF WHEEL_FR TrackWheel {
Expand Down Expand Up @@ -162,6 +166,7 @@ PROTO Zumo32U4 [
}
]
name "track_right"
contactMaterial IS contactMaterial
boundingObject USE TRACK_BO
physics USE TRACK_PH
device [
Expand Down Expand Up @@ -435,8 +440,8 @@ PROTO Zumo32U4 [
0.301 0 0
]
type "infra-red"
aperture 0.4
numberOfRays 5
aperture 0.4
gaussianWidth 1000
}
DistanceSensor {
Expand All @@ -460,47 +465,36 @@ PROTO Zumo32U4 [
}
]
}
DEF IMU Group {
DEF IMU Group {
children [
Accelerometer {
name "accelerometer"
xAxis TRUE
yAxis TRUE
zAxis TRUE
resolution 0.001
lookupTable [
-19.62 -32768 0.001
0 0 0.001
0 0 0.001
19.62 32767 0.001
]
resolution 0.001
}
Gyro {
name "gyro"
xAxis TRUE
yAxis TRUE
zAxis TRUE
resolution 0.001
lookupTable [
-9.32 -32768 0
0 0 0
9.32 32767 0
]
resolution 0.001
}
Compass {
name "magnetometer"
xAxis TRUE
yAxis TRUE
zAxis TRUE
resolution 0.001
lookupTable [
-1 -32000 0
0 0 0
1 32000 0
]
resolution 0.001
}
]
}

DEF LEDS Group {
children [
LED {
Expand Down Expand Up @@ -576,12 +570,12 @@ PROTO Zumo32U4 [
]
}
]
name IS name
boundingObject USE BODY
physics Physics {
mass 0.2
density -1
mass 0.2
}
name IS name
controller "<extern>"
}
}
66 changes: 33 additions & 33 deletions webots/protos/ZumoComSystem.proto
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
#VRML_SIM R2023a utf8

PROTO ZumoComSystem [
field SFVec3f translation 0 0 0
field SFRotation rotation 0 0 1 0
field SFString name "ZumoComSystem"
field SFString name "ZumoComSystem"
]
{
Robot {
translation IS translation
rotation IS rotation
children [
DEF BODY Group {
children [
Shape {
geometry Box {
size 0.06 0.05 0.01
Slot {
type "ZumoComSystem"
endPoint Robot {
translation 0 0 0.1
children [
DEF BODY Group {
children [
Shape {
geometry Box {
size 0.06 0.05 0.01
}
}
}
]
]
}
Receiver {
name "serialComRx"
type "serial"
}
Emitter {
name "serialComTx"
type "serial"
}
GPS {
name "gps"
}
]
name IS name
description "DroidControlShip"
boundingObject USE BODY
physics Physics {
density -1
mass 0.1
}
Receiver {
name "serialComRx"
type "serial"
}
Emitter {
name "serialComTx"
type "serial"
}
GPS {
name "gps"
}
]
name IS name
description "DroidControlShip"
boundingObject USE BODY
physics Physics {
density -1
mass 0.1
controller "<extern>"
}
controller "<extern>"
}
}
24 changes: 9 additions & 15 deletions webots/worlds/zumo_with_com_system/PlatoonTrack.wbt
Original file line number Diff line number Diff line change
Expand Up @@ -41,33 +41,27 @@ DEF LEADER Zumo32U4 {
rotation -1.0564747468923541e-06 8.746699709178704e-07 0.9999999999990595 1.5880805820884731
name "leader"
contactMaterial "rubber"
}
ZumoComSystem {
translation 0 0 0
rotation 0 0 1 0
name "ZumoComSystemLeader"
zumoComSystemSlot ZumoComSystem {
name "ZumoComSystemLeader"
}
}
DEF FOLLOWER1 Zumo32U4 {
translation -3.15 -1.2 0.013994298332013683
rotation -1.0564747468923541e-06 8.746699709178704e-07 0.9999999999990595 1.5880805820884731
name "follower_1"
contactMaterial "rubber"
}
ZumoComSystem {
translation 0 0 0
rotation 0 0 1 0
name "ZumoComSystemFollower1"
zumoComSystemSlot ZumoComSystem {
name "ZumoComSystemFollower1"
}
}
DEF FOLLOWER2 Zumo32U4 {
translation -3.15 -1.35 0.013994298332013683
rotation -1.0564747468923541e-06 8.746699709178704e-07 0.9999999999990595 1.5880805820884731
name "follower_2"
contactMaterial "rubber"
}
ZumoComSystem {
translation 0 0 0
rotation 0 0 1 0
name "ZumoComSystemFollower2"
zumoComSystemSlot ZumoComSystem {
name "ZumoComSystemFollower2"
}
}
Supervisor {
name "PlatoonSupervisor"
Expand Down

0 comments on commit e915d9a

Please sign in to comment.