diff --git a/webots/protos/FlagShip.proto b/webots/protos/FlagShip.proto new file mode 100644 index 00000000..7f931d58 --- /dev/null +++ b/webots/protos/FlagShip.proto @@ -0,0 +1,47 @@ +#VRML_SIM R2025a utf8 + +# FlagShip is an extension that is mounted on top of the ZumoComSystem (DroidControlShip). +# It provides 360-degree lidar scanning capabilities for the Zumo robot platform. +PROTO FlagShip [ + field SFString name "FlagShip" + field SFBool synchronization TRUE +] +{ + Slot { + type "FlagShip" + endPoint Robot { + children [ + Transform { + translation 0 0 0.03 + children [ + Shape { + appearance PBRAppearance { + baseColor 0.9 0.15 0.15 + roughness 0.4 + metalness 0 + } + geometry Cylinder { + height 0.01 + radius 0.03 + } + } + Lidar { + name "lidar" + horizontalResolution 1440 + fieldOfView 6.28318530718 + numberOfLayers 1 + minRange 0.15 + maxRange 12 + defaultFrequency 8 + minFrequency 5 + maxFrequency 20 + } + ] + } + ] + name IS name + controller "" + synchronization IS synchronization + } + } +} diff --git a/webots/protos/ZumoComSystem.proto b/webots/protos/ZumoComSystem.proto index e57024d9..aadfa4f1 100644 --- a/webots/protos/ZumoComSystem.proto +++ b/webots/protos/ZumoComSystem.proto @@ -5,6 +5,7 @@ PROTO ZumoComSystem [ field SFString name "ZumoComSystem" field SFBool performanceMode FALSE # Use basic blocks for the robot instead of meshes. Increases performance. field SFBool synchronization TRUE # Set to FALSE when used alongside another extern controller. + field SFNode flagShipSlot NULL # Slot for the FlagShip ] { Slot { @@ -54,6 +55,10 @@ PROTO ZumoComSystem [ Compass { name "compass" } + Slot { + type "FlagShip" + endPoint IS flagShipSlot + } ] name IS name description "DroidControlShip" diff --git a/webots/worlds/zumo_with_flag_ship/DcsMinTrack.proto b/webots/worlds/zumo_with_flag_ship/DcsMinTrack.proto new file mode 100644 index 00000000..97724387 --- /dev/null +++ b/webots/worlds/zumo_with_flag_ship/DcsMinTrack.proto @@ -0,0 +1,40 @@ +#VRML_SIM R2025a utf8 + +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/floors/protos/RectangleArena.proto" + +PROTO DcsMinTrack [ + field SFString contactMaterial "default" # Is `Solid.contactMaterial`. +] +{ + RectangleArena { + contactMaterial IS contactMaterial + floorSize 2 2 + floorTileSize 4 4 + floorAppearance PBRAppearance { + baseColorMap ImageTexture { + url [ + "./dcs.png" + ] + } + roughness 1 + roughnessMap ImageTexture { + url [ + "https://raw.githubusercontent.com/cyberbotics/webots/R2022a/projects/appearances/protos/textures/parquetry/chequered_parquetry_roughness.jpg" + ] + } + metalness 0 + normalMap ImageTexture { + url [ + "https://raw.githubusercontent.com/cyberbotics/webots/R2022a/projects/appearances/protos/textures/parquetry/chequered_parquetry_normal.jpg" + ] + } + occlusionMap ImageTexture { + url [ + "https://raw.githubusercontent.com/cyberbotics/webots/R2022a/projects/appearances/protos/textures/parquetry/chequered_parquetry_occlusion.jpg" + ] + } + } + wallThickness 0.001 + wallHeight 0.05 + } +} \ No newline at end of file diff --git a/webots/worlds/zumo_with_flag_ship/DcsMinimalLidarExample.wbt b/webots/worlds/zumo_with_flag_ship/DcsMinimalLidarExample.wbt new file mode 100644 index 00000000..7166836f --- /dev/null +++ b/webots/worlds/zumo_with_flag_ship/DcsMinimalLidarExample.wbt @@ -0,0 +1,68 @@ +#VRML_SIM R2025a utf8 + +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/backgrounds/protos/TexturedBackground.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/backgrounds/protos/TexturedBackgroundLight.proto" +EXTERNPROTO "../../protos/ZumoComSystem.proto" +EXTERNPROTO "../../protos/Zumo32U4.proto" +EXTERNPROTO "../../protos/FlagShip.proto" +EXTERNPROTO "./DcsMinTrack.proto" + +WorldInfo { + info [ + "World for testing DroidControlShip and a standalone native ROS2 LiDAR robot." + ] + title "DCS Demo Track LiDAR Example" + basicTimeStep 8 +} + +Viewpoint { + orientation 0.3787583266277594 0.09714544028170935 -0.9203830145339561 2.677946076660944 + position 1.2569587324159737 0.7945022889765716 1.5111964909293643 +} + +TexturedBackground { +} +TexturedBackgroundLight { +} + +DcsMinTrack { + contactMaterial "cardboard" +} + +Zumo32U4 { + name "Zumo" + performanceMode TRUE + zumoComSystemSlot ZumoComSystem { + name "ZumoComSystem" + performanceMode TRUE + flagShipSlot FlagShip { + name "FlagShip" + } + } +} + +Solid { + name "LidarTarget" + translation 0.6 0.02 0.0 + children [ + Shape { + appearance PBRAppearance { + baseColor 0.1 0.6 0.9 + roughness 0.5 + metalness 0 + } + geometry Box { + size 0.12 0.2 0.12 + } + } + ] + boundingObject Box { + size 0.12 0.2 0.12 + } +} + +Robot { + name "Ros2Supervisor" + controller "" + supervisor TRUE +} \ No newline at end of file diff --git a/webots/worlds/zumo_with_flag_ship/TestWorld.wbt b/webots/worlds/zumo_with_flag_ship/TestWorld.wbt new file mode 100644 index 00000000..87ef204c --- /dev/null +++ b/webots/worlds/zumo_with_flag_ship/TestWorld.wbt @@ -0,0 +1,237 @@ +#VRML_SIM R2025a utf8 + +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/backgrounds/protos/TexturedBackground.proto" +EXTERNPROTO "../../protos/ZumoComSystem.proto" +EXTERNPROTO "../../protos/Zumo32U4.proto" +EXTERNPROTO "../../protos/FlagShip.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/plants/protos/PottedTree.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/floors/protos/Floor.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/appearances/protos/CementTiles.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/apartment_structure/protos/Window.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/apartment_structure/protos/Wall.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/appearances/protos/Roughcast.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/apartment_structure/protos/Radiator.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/apartment_structure/protos/Door.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/cabinet/protos/Cabinet.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/factory/containers/protos/CardboardBox.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/kitchen/fridge/protos/Fridge.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/lights/protos/FloorLight.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/living_room_furniture/protos/Sofa.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/living_room_furniture/protos/Armchair.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/paintings/protos/LandscapePainting.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/tables/protos/Table.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/traffic/protos/DirectionPanel.proto" +EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2025a/projects/objects/plants/protos/BunchOfSunFlowers.proto" + +WorldInfo { + info [ + "Simple Zumo-based simulation with a nested ZumoComSystem and FlagShip lidar robot." + ] + title "ROS2 simulation of the Zumo robot setup" + basicTimeStep 8 +} +Viewpoint { + orientation -0.2878951570967451 -0.16506369377382343 0.9433293992651676 4.177335774513749 + position 9.141595121588473 4.8923306199482335 3.8476210861955575 +} +TexturedBackground { + texture "empty_office" + skybox FALSE +} +Zumo32U4 { + translation 6.36 0 0 + performanceMode TRUE + zumoComSystemSlot ZumoComSystem { + name "ZumoComSystem" + performanceMode TRUE + flagShipSlot FlagShip { + name "FlagShip" + } + } +} + +Robot { + name "Ros2Supervisor" + controller "" + supervisor TRUE +} + +PottedTree { + translation 7 -4 0 + rotation 0 0 1 1.5708 + name "potted tree(5)" +} +PottedTree { + translation 5.8 3.3 0 + rotation 0 0 1 1.5708 + name "potted tree(8)" +} +Floor { + translation 7.5 0 0 + name "floor(1)" + size 5 10 + tileSize 2 2 + appearance CementTiles { + textureTransform TextureTransform { + scale 0.6 0.6 + } + } +} +Window { + translation 6.5 -5.1 0 + rotation 0 0 1 -1.5707953071795862 + name "window(1)" + size 0.2 1 2.4 +} +Wall { + translation 7.5 5.1 0 + rotation 0 0 1 3.14159 + name "wall(5)" + size 5 0.2 2.4 + appearance Roughcast { + textureTransform TextureTransform { + scale 7 2.4 + } + } +} +Wall { + translation 5.5 -5.1 0 + name "wall(7)" + size 1 0.2 2.4 + appearance Roughcast { + textureTransform TextureTransform { + scale 7 2.4 + } + } +} +Wall { + translation 8.5 -5.1 0 + name "wall(10)" + size 3 0.2 2.4 + appearance Roughcast { + textureTransform TextureTransform { + scale 7 2.4 + } + } +} +Wall { + translation 10.1 0 0 + rotation -0.00022772198819084869 0 0.9999999740713477 1.57103 + name "wall(6)" + size 10.4 0.2 2.4 + appearance Roughcast { + textureTransform TextureTransform { + scale 7 2.4 + } + } +} +Wall { + translation 5 2 0 + rotation 0 0.00022681898833087582 0.9999999742765728 -1.570565307179586 + name "wall(2)" + size 6 0.2 2.4 + appearance Roughcast { + textureTransform TextureTransform { + scale 7 2.4 + } + } +} +Wall { + translation 5 -3.5 0 + rotation 0 0.0002268199883307215 0.9999999742763461 -1.570565307179586 + name "wall(1)" + size 3 0.2 2.4 + appearance Roughcast { + textureTransform TextureTransform { + scale 7 2.4 + } + } +} +Radiator { + translation 7.33 4.87 0.38 + rotation 0.0002336949872371335 0 0.9999999726933261 -1.5710253071795863 +} +Door { + translation 5 -1.5 0 + rotation -0.581329088895979 0.5726190875640585 -0.5780690883974646 0.000396075 + position -1.5000000005630203 + wallAppearance Roughcast { + textureTransform TextureTransform { + scale 7 2.4 + } + } + frameAppearance Roughcast { + textureTransform TextureTransform { + scale 1 2.4 + } + } +} +Cabinet { + translation 9.5 -2.5 0 + rotation 0.00011300299708654554 0.00011407199705898447 0.999999987108951 3.14137 +} +CardboardBox { + translation 9.7 4.7 0.3 + rotation -0.577349935856137 0.577349935856137 0.5773509358560258 2.09439 +} +CardboardBox { + translation 9 4.6 0.3 + rotation 0.06500310682387538 0.06496520681989673 -0.995768104533426 -1.5750353071795864 + name "cardboard box(1)" +} +CardboardBox { + translation 9.6 4 0.3 + rotation -0.06496610766674145 -0.06500200767097807 -0.9957681175119917 -1.5750353071795864 + name "cardboard box(2)" +} +CardboardBox { + translation 9.4 4.5 0.9 + rotation -0.06512832729035975 -0.027078811346683294 -0.997509417980808 -2.358005307179586 + name "cardboard box(3)" +} +Fridge { + translation 5.7 4.64 0 + rotation 0.5822796992968663 -0.5748877031142695 0.5748517031328608 -0.0003953071795859131 +} +FloorLight { + translation 8.84 1 0 + name "floor light(1)" + bulbColor 0.26331 0.374105 0.963333 + pointLightColor 0.0350805 0.179232 0.956664 + pointLightIntensity 4 + pointLightCastShadows TRUE +} +Sofa { + translation 9 -0.518 0 + rotation 0.00014495699695408652 0 0.9999999894937345 3.14131 +} +Armchair { + translation 7.62 1.03 0 + rotation 0.00022763298820402747 0 0.999999974091611 -1.5710253071795863 +} +LandscapePainting { + translation 8.5 -4.98 1.2 + rotation -0.00014498499390527302 -0.00014496999390590354 -0.9999999789815259 -1.570515307179586 +} +PottedTree { + translation 9.17 -1.7 0 + rotation 0 0 1 1.5708 +} +PottedTree { + translation 5.6 -4.5 0 + rotation 0 0 1 1.5708 + name "potted tree(3)" +} +Table { + translation 7.7 -0.52 0 + rotation 0 0.00022690898831680196 0.9999999742561552 -1.570565307179586 + size 1.3 0.8 0.5 +} +DirectionPanel { + translation 8 5 1.5 + rotation 0.00010265399783649644 -0.00010265399783649644 0.9999999894621566 1.5708 +} +BunchOfSunFlowers { + translation 7.68 -0.52 0.5 + rotation 0 0 1 1.5708 +} diff --git a/webots/worlds/zumo_with_flag_ship/dcs.png b/webots/worlds/zumo_with_flag_ship/dcs.png new file mode 100644 index 00000000..9964b11d Binary files /dev/null and b/webots/worlds/zumo_with_flag_ship/dcs.png differ