]> defiant.homedns.org Git - a4wd3.git/commitdiff
urdf fixes
authorErik Andresen <erik@vontaene.de>
Tue, 13 Oct 2026 10:10:12 +0000 (12:10 +0200)
committerErik Andresen <erik@vontaene.de>
Tue, 13 Oct 2026 10:10:12 +0000 (12:10 +0200)
urdf/a4wd3.urdf

index fe01116e4ed4f68952ab7fcb0e69a4a931f78894..5148bd86ae3e3e2a4967b895dd6997f6f23fb4eb 100644 (file)
     </collision>
   </link>
 
+  <!-- Lidar mount (2026-10-13, final): 3x 18 mm distance holders stand on the FLAT CHASSIS DECK
+       (z=35.0 mm) at the plate's 3 chassis screw holes; the raised central ring (top 43.5 mm)
+       is UNDER THE PLATE CENTER and clears it by ~9.5 mm (verified from the RViz mesh: all 3
+       screw-hole locations read 35.0 mm). The 3 mm holder plate (80x75, from
+       a4wd3_rplidar_holder-Body.step) sits on the holders; the lidar bolts DIRECTLY onto the
+       plate top (35.0+18+3 = 56.0 mm = the user-measured 21 mm span above the deck).
+       Holders at the matched chassis holes (live): (62.5, 110.5) / (125.0, 110.5) / (125.0, 62.5) mm. -->
+  <joint name="base_to_lidar_mount" type="fixed">
+    <parent link="base_link"/>
+    <child link="lidar_mount"/>
+    <origin xyz="0.08625 0.07675 0.0545" rpy="0 0 0"/>
+  </joint>
+  <link name="lidar_mount">
+    <!-- plate box offset from the 4-hole center (= mount origin) to the TRUE outline center,
+         measured from the plate STEP: outline center (3.75,-1.25) in the STEP frame ->
+         live (+3.75,+1.25) mm via the chassis-hole rigid transform. Box stays 80x75x3. -->
+    <visual>
+      <origin xyz="0.00375 0.00125 0" rpy="0 0 0"/>
+      <geometry>
+        <box size="0.080 0.075 0.003"/>
+      </geometry>
+      <material name="mount_grey"><color rgba="0.30 0.30 0.30 1.0"/></material>
+    </visual>
+    <visual>
+      <origin xyz="-0.02375 0.03375 -0.0105" rpy="0 0 0"/>
+      <geometry><cylinder length="0.018" radius="0.003"/></geometry>
+      <material name="mount_grey"><color rgba="0.30 0.30 0.30 1.0"/></material>
+    </visual>
+    <visual>
+      <origin xyz="0.03875 0.03375 -0.0105" rpy="0 0 0"/>
+      <geometry><cylinder length="0.018" radius="0.003"/></geometry>
+      <material name="mount_grey"><color rgba="0.30 0.30 0.30 1.0"/></material>
+    </visual>
+    <visual>
+      <origin xyz="0.03875 -0.01425 -0.0105" rpy="0 0 0"/>
+      <geometry><cylinder length="0.018" radius="0.003"/></geometry>
+      <material name="mount_grey"><color rgba="0.30 0.30 0.30 1.0"/></material>
+    </visual>
+    <collision>
+      <origin xyz="0.00375 0.00125 0" rpy="0 0 0"/>
+      <geometry><box size="0.080 0.075 0.003"/></geometry>
+    </collision>
+  </link>
+
   <!-- RP-LIDAR A2M4 (r1), flat panel. Launch tf_base_scan VERBATIM for x/y:
        t=(+0.08125, +0.07425) m, yaw = pi (live base_link frame).
-       => 81.25 mm forward, 74.25 mm left.
-       Z (NOT in launch file, measured 2026-10-11): unit sits 21 mm ABOVE the LOCAL top
-       plate under the lidar (z=+46.0 mm there; the 55.8 mm global max is a raised area
-       elsewhere) -> unit bottom at z=+67.0 mm. After the 180 deg flip the full mesh spans
-       laser z -0.0009..+0.0399 -> joint z = 0.0679 m.
-       MESH GEOMETRY (verified by slice analysis 2026-10-11): the body is a cylinder
-       with its AXIS ALONG MESH Y (slices perp to Y: ~75 mm circles; perp to X/Z: ellipses).
-       Visual transform: Rx(+90 deg) maps mesh +Y -> laser +z, i.e. the unit is FLIPPED
-       180 deg about the laser x axis relative to the raw STL (user confirmed the raw
-       orientation rendered upside down). Origin offset puts the scan-face center
-       (mesh 7.26, 9.15, 75.24 mm) at the laser frame origin. Body then spans laser
-       z -0.0009..+0.0399 m (unit sits ABOVE the frame; bracket arm at unit top). -->
+       XY CORRECTED (holder-plate hole matching, residual 0.000 mm): plate 4-hole center
+       (= laser origin) at live (86.25, 76.75) mm.
+       Z (2026-10-13 final): spacers stand on the FLAT DECK at 35.0 mm (all 3 screw-hole
+       locations verified from the RViz mesh; the raised central ring tops at 43.5 mm but
+       clears the plate by ~9.5 mm). Stack: 35.0 + 18 mm spacers + 3 mm plate = 56.0 mm bolt
+       face (user-measured 21 mm span above the deck). LASER ORIGIN AT THE LENS: vendor spec
+       puts the sensor lens 31 mm above the bottom of the lidar; the scan axis runs through
+       the lens (= 4-hole center, datasheet Fig 5-1) -> joint z = 56.0 + 31.0 = 87.0 mm.
+       Scan plane is horizontal through the origin. (Whole stack dropped 8.5 mm vs the
+       earlier 43.5-mm ring-top assumption, which made the spacers float.) -->
   <joint name="base_to_laser" type="fixed">
     <parent link="base_link"/>
     <child link="laser"/>
-    <origin xyz="0.08125 0.07425 0.0679" rpy="0 0 3.14159"/>
+    <origin xyz="0.08625 0.07675 0.0870" rpy="0 0 3.14159"/>
   </joint>
   <link name="laser">
     <inertial>
       <inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.0001" iyz="0" izz="0.0002"/>
     </inertial>
     <visual>
-      <origin xyz="-0.0073 0.0752 -0.0092" rpy="1.5708 0 0"/>
+      <origin xyz="0.0051 0.0750 -0.0392" rpy="1.5708 0 0"/>
       <geometry>
         <!-- STL stores millimeter coordinates; URDF expects meters -->
         <mesh filename="package://a4wd3/meshes/rplidar_a2m4_decimated.stl" scale="0.001 0.001 0.001"/>
       </material>
     </visual>
     <collision>
-      <!-- body only (excl. bracket arm): mesh 79 x 40.8 x 75 mm, axis along mesh Y;
+      <!-- body only (excl. connector arm): mesh 75 x 40.8 x 75 mm, axis along mesh Y;
            center transformed into the laser frame by the same Rx(+90)+offset as the visual -->
-      <origin xyz="-0.0113 0.0002 0.0195" rpy="0 0 0"/>
+      <origin xyz="-0.0009 0.0 -0.0106" rpy="0 0 0"/>
       <geometry>
-        <box size="0.079 0.075 0.041"/>
+        <box size="0.075 0.075 0.0408"/>
       </geometry>
     </collision>
   </link>