From 31535e4b1029d6c1d5f6404bcbf23ac859779e4b Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Fri, 21 Mar 2025 18:37:34 +0300 Subject: [PATCH] refactor(world): configuration using xacro with procedural features --- rbs_mill_assist/world/default.sdf | 225 ------------------ rbs_mill_assist/world/inc/camera.xacro | 58 +++++ rbs_mill_assist/world/inc/from_places.xacro | 30 +++ .../world/inc/generate_shildiks.xacro | 44 ++++ rbs_mill_assist/world/inc/ground.xacro | 64 +++++ rbs_mill_assist/world/inc/light_macro.xacro | 18 ++ rbs_mill_assist/world/inc/model_macro.xacro | 16 ++ rbs_mill_assist/world/inc/plugins_macro.xacro | 28 +++ rbs_mill_assist/world/world.xacro | 6 + rbs_mill_assist/world/world_macro.xacro | 68 ++++++ 10 files changed, 332 insertions(+), 225 deletions(-) delete mode 100644 rbs_mill_assist/world/default.sdf create mode 100644 rbs_mill_assist/world/inc/camera.xacro create mode 100644 rbs_mill_assist/world/inc/from_places.xacro create mode 100644 rbs_mill_assist/world/inc/generate_shildiks.xacro create mode 100644 rbs_mill_assist/world/inc/ground.xacro create mode 100644 rbs_mill_assist/world/inc/light_macro.xacro create mode 100644 rbs_mill_assist/world/inc/model_macro.xacro create mode 100644 rbs_mill_assist/world/inc/plugins_macro.xacro create mode 100644 rbs_mill_assist/world/world.xacro create mode 100644 rbs_mill_assist/world/world_macro.xacro diff --git a/rbs_mill_assist/world/default.sdf b/rbs_mill_assist/world/default.sdf deleted file mode 100644 index 4914e0c..0000000 --- a/rbs_mill_assist/world/default.sdf +++ /dev/null @@ -1,225 +0,0 @@ - - - - - 1.0 1.0 1.0 - false - - - - 0.001 - 1.0 - - - - - - - - - - gz-physics-dartsim-plugin - - - - ogre2 - - - - - - - - - - false - 0 0 10 0 0 0 - 0.8 0.8 0.8 1 - 0.2 0.2 0.2 1 - - 1000 - 0.9 - 0.01 - 0.001 - - -0.5 0.1 -0.9 - - - - shildik_0 - -0.403959 0.250 0.02 0 0 1.57 - model://shildik - - - shildik_1 - -0.447918 0.250 0.02 0 0 1.57 - model://shildik - - - shildik_2 - -0.491997 0.250 0.02 0 0 1.57 - model://shildik - - - shildik_3 - -0.536033 0.250 0.02 0 0 1.57 - model://shildik - - - shildik_4 - -0.491997 0.250 0.03 0 0 1.57 - model://shildik - - - - true - 0.350 -0.170 0 0 0 3.14159 - model://laser - - - - true - -0.050 0.250 0.0 0.0 0.0 1.57 - model://bunker - - - - true - -0.470 0.250 0 0 0 1.57 - model://bunker_4_slots - - - - true - 0.350 -0.170 0.01 0 0 1.57 - model://conductor - - - - 0 -0.93 0.42 0 0.4 1.81 - 1 - - - - - 0 0 0 0 0 0 - - - 0.01 0.01 0.01 - - - - 0 0 0 1 - 0 0 0 1 - 0 0 0 1 - - - - - - 0 0 0 0 0 0 - - - 0.01 0.01 0.01 - - - - - - - - 1.047 - - 1920 - 1080 - R8G8B8 - - - 0.1 - 3 - - - depth - - - 1 - 30 - true - /rgbd_camera/image - true - - - - - - - 1 - - 0 0 -0.40000000000000002 0 0 0 - - 0 0 0 0 0 0 - 10 - - 4.708333333333333 - 0 - 0 - 8.6666666666666661 - 0 - 8.0416666666666661 - - - - 0 0 0 0 0 0 - - - 1.2 0.69999999999999996 0.80000000000000004 - - - - - - 1.0 - 1.0 - - - - - - 0.00001 - 0.8 - 1e5 - 1e3 - - - - - - 0 0 0 0 0 0 - - - 1.2 0.69999999999999996 0.80000000000000004 - - - - 0.6 0.4 0.2 1 - 0.6 0.4 0.2 1 - 0.1 0.1 0.1 1 - 0 0 0 1 - - - false - - - - - - diff --git a/rbs_mill_assist/world/inc/camera.xacro b/rbs_mill_assist/world/inc/camera.xacro new file mode 100644 index 0000000..74d6747 --- /dev/null +++ b/rbs_mill_assist/world/inc/camera.xacro @@ -0,0 +1,58 @@ + + + + + + 1 + + + + 0 0 0 0 0 0 + + + 0.01 0.01 0.01 + + + + 0 0 0 1 + 0 0 0 1 + 0 0 0 1 + + + + + 0 0 0 0 0 0 + + + 0.01 0.01 0.01 + + + + + + + 1.047 + + 1920 + 1080 + R8G8B8 + + + 0.1 + 3 + + + depth + + + 1 + 30 + true + /${name}/image + true + + + + + + diff --git a/rbs_mill_assist/world/inc/from_places.xacro b/rbs_mill_assist/world/inc/from_places.xacro new file mode 100644 index 0000000..323a60f --- /dev/null +++ b/rbs_mill_assist/world/inc/from_places.xacro @@ -0,0 +1,30 @@ + + + + + + + + + ${model["pose"]["position"]["x"]} + ${model["pose"]["position"]["y"]} + ${model["pose"]["position"]["z"]} + + + + + ${orientation['r']} + ${orientation['p']} + ${orientation['y']} + + + + + 0 0 0 + + + + + + + diff --git a/rbs_mill_assist/world/inc/generate_shildiks.xacro b/rbs_mill_assist/world/inc/generate_shildiks.xacro new file mode 100644 index 0000000..2f271c8 --- /dev/null +++ b/rbs_mill_assist/world/inc/generate_shildiks.xacro @@ -0,0 +1,44 @@ + + + + + + + + + + + + + ${slot["pose"]["position"]["x"]} ${slot["pose"]["position"]["y"]} ${slot["pose"]["position"]["z"] + z_offset} ${rpy} + + + + ${slot["pose"]["position"]["x"]} ${slot["pose"]["position"]["y"]} ${slot["pose"]["position"]["z"] + z_offset} ${rpy} + + + + + + + + + + + + + + + diff --git a/rbs_mill_assist/world/inc/ground.xacro b/rbs_mill_assist/world/inc/ground.xacro new file mode 100644 index 0000000..71fab2a --- /dev/null +++ b/rbs_mill_assist/world/inc/ground.xacro @@ -0,0 +1,64 @@ + + + + + 1 + + 0 0 -0.40000000000000002 0 0 0 + + 0 0 0 0 0 0 + 10 + + 4.708333333333333 + 0 + 0 + 8.6666666666666661 + 0 + 8.0416666666666661 + + + + 1000 + 0 0 0 0 0 0 + + + 1.2 0.69999999999999996 0.80000000000000004 + + + + + + 1.0 + 1.0 + + + + + + 0.00001 + 0.8 + 1e5 + 1e3 + + + + + + 0 0 0 0 0 0 + + + 1.2 0.69999999999999996 0.80000000000000004 + + + + 0.6 0.4 0.2 1 + 0.6 0.4 0.2 1 + 0.1 0.1 0.1 1 + 0 0 0 1 + + + false + + + + diff --git a/rbs_mill_assist/world/inc/light_macro.xacro b/rbs_mill_assist/world/inc/light_macro.xacro new file mode 100644 index 0000000..64ec7b4 --- /dev/null +++ b/rbs_mill_assist/world/inc/light_macro.xacro @@ -0,0 +1,18 @@ + + + + + false + 0 0 10 0 0 0 + 0.8 0.8 0.8 1 + 0.2 0.2 0.2 1 + + 1000 + 0.9 + 0.01 + 0.001 + + -0.5 0.1 -0.9 + + + diff --git a/rbs_mill_assist/world/inc/model_macro.xacro b/rbs_mill_assist/world/inc/model_macro.xacro new file mode 100644 index 0000000..82e64c4 --- /dev/null +++ b/rbs_mill_assist/world/inc/model_macro.xacro @@ -0,0 +1,16 @@ + + + + + + + + + ${scene_name} + + ${static} + + model://${model_name} + + + diff --git a/rbs_mill_assist/world/inc/plugins_macro.xacro b/rbs_mill_assist/world/inc/plugins_macro.xacro new file mode 100644 index 0000000..54c228c --- /dev/null +++ b/rbs_mill_assist/world/inc/plugins_macro.xacro @@ -0,0 +1,28 @@ + + + + + + ${physics_engine} + + + + ${render_engine} + + + + + + + + + diff --git a/rbs_mill_assist/world/world.xacro b/rbs_mill_assist/world/world.xacro new file mode 100644 index 0000000..9986d4b --- /dev/null +++ b/rbs_mill_assist/world/world.xacro @@ -0,0 +1,6 @@ + + + + + + diff --git a/rbs_mill_assist/world/world_macro.xacro b/rbs_mill_assist/world/world_macro.xacro new file mode 100644 index 0000000..d7647d9 --- /dev/null +++ b/rbs_mill_assist/world/world_macro.xacro @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + 1.0 1.0 1.0 + false + + + 0.001 + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 -0.93 0.42 0 0.4 1.81 + + + + + + +