Files
trolley_detection_action/sim/models/trolley_4legs_tape_all/model.sdf
duongtd bfdcac512f feat: add the 4-leg trolley detection action
TrolleyDetectionActionHandler finds a 4-leg trolley in a raw LaserScan with
dock_pattern_detector's LegPatternMatcher, filters the detections and writes a
static dock_target frame for the docking leg that drives under the trolley.

- entry_direction forward/backward sets the goal heading; a lidar that faces
  the wrong way fails the action instead of writing a reversed goal
- an upside-down lidar (roll pi in TF) is detected from TF and its bearings
  are mirrored; a scan plane tilted more than 5 deg fails the action
- profiles validated at boot; optional prior, reflective tape (all/entry)
- gtest (11 tests) incl. a recorded Gazebo scan from a roll-pi lidar
- sim models trolley_4legs (+ taped variants) the robot can drive under,
  spawn launch and generator script
- doc/MEASURE_AND_CONFIGURE.md: how to measure a trolley and fill the profile
2026-10-28 13:33:52 +07:00

154 lines
7.3 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0"?>
<!--
Xe hàng 4 chân ĐƠN GIẢN cho trolley_detection_action trong Gazebo. Sinh bằng
sim/gen_trolley_models.py — sửa số ở script rồi sinh lại, đừng sửa tay file này.
Kích thước chân khớp xe `tci_trolley` của world factory_ss_demo:
cart_depth = 0.720 m (trục X của model) cart_opening = 0.517 m (trục Y)
chân hộp 0.030 x 0.030 m, cao tới mặt dưới sàn xe 0.380 m
KHÁC tci_trolley, cố ý:
- gốc model ĐÚNG TÂM 4 chân, chân chạm sàn ở z = 0 → spawn z = 0, ground truth = pose model;
- KHÔNG có tấm đáy 0.78 x 0.613 x 0.01 m sát sàn mà mesh tci_trolley mang theo (robot đâm vào
nó khi chui gầm);
- mặt dưới sàn xe ở 0.380 m thay vì 0.352 m: không có khe dẫn hướng cho phần gồ 0.3595 m
trên nóc hook_150, nên nâng sàn để chừa 20 mm;
- không bánh xe, tay đẩy, thanh mảnh — chỉ chân + mặt sàn. Lidar (0.184 m) chỉ thấy 4 chân.
Bản này: dải trên CẢ 4 chân (`tape_legs: all`), collision 0.14–0.24 m khai laser_retro 2000.
-->
<sdf version="1.6">
<model name="trolley_4legs_tape_all">
<static>true</static>
<link name="frame">
<collision name="entry_left_low">
<pose>0.3600 0.2585 0.0700 0 0 0</pose>
<laser_retro>0</laser_retro>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
</collision>
<visual name="entry_left_low_visual">
<pose>0.3600 0.2585 0.0700 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
<material><ambient>0.3 0.3 0.3 1</ambient><diffuse>0.3 0.3 0.3 1</diffuse></material>
</visual>
<collision name="entry_left_band">
<pose>0.3600 0.2585 0.1900 0 0 0</pose>
<laser_retro>2000</laser_retro>
<geometry><box><size>0.03 0.03 0.1000</size></box></geometry>
</collision>
<visual name="entry_left_band_visual">
<pose>0.3600 0.2585 0.1900 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1000</size></box></geometry>
<material><ambient>0.9 0.9 0.2 1</ambient><diffuse>0.9 0.9 0.2 1</diffuse></material>
</visual>
<collision name="entry_left_high">
<pose>0.3600 0.2585 0.3100 0 0 0</pose>
<laser_retro>0</laser_retro>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
</collision>
<visual name="entry_left_high_visual">
<pose>0.3600 0.2585 0.3100 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
<material><ambient>0.3 0.3 0.3 1</ambient><diffuse>0.3 0.3 0.3 1</diffuse></material>
</visual>
<collision name="entry_right_low">
<pose>0.3600 -0.2585 0.0700 0 0 0</pose>
<laser_retro>0</laser_retro>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
</collision>
<visual name="entry_right_low_visual">
<pose>0.3600 -0.2585 0.0700 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
<material><ambient>0.3 0.3 0.3 1</ambient><diffuse>0.3 0.3 0.3 1</diffuse></material>
</visual>
<collision name="entry_right_band">
<pose>0.3600 -0.2585 0.1900 0 0 0</pose>
<laser_retro>2000</laser_retro>
<geometry><box><size>0.03 0.03 0.1000</size></box></geometry>
</collision>
<visual name="entry_right_band_visual">
<pose>0.3600 -0.2585 0.1900 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1000</size></box></geometry>
<material><ambient>0.9 0.9 0.2 1</ambient><diffuse>0.9 0.9 0.2 1</diffuse></material>
</visual>
<collision name="entry_right_high">
<pose>0.3600 -0.2585 0.3100 0 0 0</pose>
<laser_retro>0</laser_retro>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
</collision>
<visual name="entry_right_high_visual">
<pose>0.3600 -0.2585 0.3100 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
<material><ambient>0.3 0.3 0.3 1</ambient><diffuse>0.3 0.3 0.3 1</diffuse></material>
</visual>
<collision name="far_left_low">
<pose>-0.3600 0.2585 0.0700 0 0 0</pose>
<laser_retro>0</laser_retro>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
</collision>
<visual name="far_left_low_visual">
<pose>-0.3600 0.2585 0.0700 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
<material><ambient>0.3 0.3 0.3 1</ambient><diffuse>0.3 0.3 0.3 1</diffuse></material>
</visual>
<collision name="far_left_band">
<pose>-0.3600 0.2585 0.1900 0 0 0</pose>
<laser_retro>2000</laser_retro>
<geometry><box><size>0.03 0.03 0.1000</size></box></geometry>
</collision>
<visual name="far_left_band_visual">
<pose>-0.3600 0.2585 0.1900 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1000</size></box></geometry>
<material><ambient>0.9 0.9 0.2 1</ambient><diffuse>0.9 0.9 0.2 1</diffuse></material>
</visual>
<collision name="far_left_high">
<pose>-0.3600 0.2585 0.3100 0 0 0</pose>
<laser_retro>0</laser_retro>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
</collision>
<visual name="far_left_high_visual">
<pose>-0.3600 0.2585 0.3100 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
<material><ambient>0.3 0.3 0.3 1</ambient><diffuse>0.3 0.3 0.3 1</diffuse></material>
</visual>
<collision name="far_right_low">
<pose>-0.3600 -0.2585 0.0700 0 0 0</pose>
<laser_retro>0</laser_retro>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
</collision>
<visual name="far_right_low_visual">
<pose>-0.3600 -0.2585 0.0700 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
<material><ambient>0.3 0.3 0.3 1</ambient><diffuse>0.3 0.3 0.3 1</diffuse></material>
</visual>
<collision name="far_right_band">
<pose>-0.3600 -0.2585 0.1900 0 0 0</pose>
<laser_retro>2000</laser_retro>
<geometry><box><size>0.03 0.03 0.1000</size></box></geometry>
</collision>
<visual name="far_right_band_visual">
<pose>-0.3600 -0.2585 0.1900 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1000</size></box></geometry>
<material><ambient>0.9 0.9 0.2 1</ambient><diffuse>0.9 0.9 0.2 1</diffuse></material>
</visual>
<collision name="far_right_high">
<pose>-0.3600 -0.2585 0.3100 0 0 0</pose>
<laser_retro>0</laser_retro>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
</collision>
<visual name="far_right_high_visual">
<pose>-0.3600 -0.2585 0.3100 0 0 0</pose>
<geometry><box><size>0.03 0.03 0.1400</size></box></geometry>
<material><ambient>0.3 0.3 0.3 1</ambient><diffuse>0.3 0.3 0.3 1</diffuse></material>
</visual>
<collision name="deck">
<pose>0 0 0.390 0 0 0</pose>
<geometry><box><size>0.780 0.577 0.020</size></box></geometry>
</collision>
<visual name="deck_visual">
<pose>0 0 0.390 0 0 0</pose>
<geometry><box><size>0.780 0.577 0.020</size></box></geometry>
</visual>
</link>
</model>
</sdf>