Add a V plate model so the detector has something to find in simulation
The chain was testable but not runnable: simulation fakes the dock entirely (use_simulated_goal writes an invented pose 1.6 m ahead of base_link), so no physical object exists for a laser to see. Nothing in the worlds under Test/simulators is a dock either. This is the missing half - an SDF plate whose geometry matches the v_std profile exactly: 90 degree interior angle, 0.30 m wings. 0.02 m thick so min_split_dist does not read the two faces of one wing as two segments, and 0.6 m tall from the floor so a planar laser at any plausible mounting height cuts through it. The plate and the profile have to agree. Change the model and the wing_length gate rejects the very object that was just spawned, which is the kind of failure that looks like a broken detector.
This commit is contained in:
@@ -67,6 +67,12 @@ target_link_libraries(dock_pattern_action_handler
|
|||||||
${TF3_LIBRARY}
|
${TF3_LIBRARY}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Model + launch để dựng tấm chữ V trong Gazebo. Không phải build artifact, nhưng launch file tra
|
||||||
|
# đường dẫn qua $(find dock_pattern_action) nên phải có mặt sau khi install.
|
||||||
|
install(DIRECTORY sim/
|
||||||
|
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/sim
|
||||||
|
)
|
||||||
|
|
||||||
install(TARGETS dock_pattern_action_handler
|
install(TARGETS dock_pattern_action_handler
|
||||||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||||
|
|||||||
29
sim/launch/spawn_dock_plate.launch
Normal file
29
sim/launch/spawn_dock_plate.launch
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<!--
|
||||||
|
Dựng một tấm dẫn hướng chữ V vào world Gazebo đang chạy.
|
||||||
|
|
||||||
|
Chạy SAU khi world đã lên:
|
||||||
|
roslaunch dock_pattern_action spawn_dock_plate.launch x:=3.0 y:=0.0 yaw:=3.14159
|
||||||
|
|
||||||
|
`yaw` quay tấm; đỉnh chữ V mở về phía +X của chính tấm, nên đặt `yaw` sao cho mặt trong hướng về
|
||||||
|
phía robot sẽ đứng. Mặc định 3.14159 = tấm quay lưng về +X của world, tức robot đứng ở phía +X
|
||||||
|
nhìn vào.
|
||||||
|
|
||||||
|
Hình học của model KHỚP profile `v_std`: góc trong 90 độ, cánh 0.30 m. Đổi model thì phải đổi
|
||||||
|
profile theo, nếu không cổng `wing_length` sẽ loại đúng cái tấm vừa dựng.
|
||||||
|
-->
|
||||||
|
<launch>
|
||||||
|
<arg name="x" default="3.0" />
|
||||||
|
<arg name="y" default="0.0" />
|
||||||
|
<arg name="z" default="0.0" />
|
||||||
|
<arg name="yaw" default="3.14159" />
|
||||||
|
<arg name="name" default="dock_plate_v" />
|
||||||
|
|
||||||
|
<!-- Gazebo tìm model theo GAZEBO_MODEL_PATH; trỏ thẳng vào thư mục sim/models của gói này. -->
|
||||||
|
<env name="GAZEBO_MODEL_PATH"
|
||||||
|
value="$(find dock_pattern_action)/sim/models:$(optenv GAZEBO_MODEL_PATH)" />
|
||||||
|
|
||||||
|
<node name="spawn_$(arg name)" pkg="gazebo_ros" type="spawn_model" output="screen"
|
||||||
|
args="-sdf -file $(find dock_pattern_action)/sim/models/dock_plate_v/model.sdf
|
||||||
|
-model $(arg name)
|
||||||
|
-x $(arg x) -y $(arg y) -z $(arg z) -Y $(arg yaw)" />
|
||||||
|
</launch>
|
||||||
14
sim/models/dock_plate_v/model.config
Normal file
14
sim/models/dock_plate_v/model.config
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<model>
|
||||||
|
<name>dock_plate_v</name>
|
||||||
|
<version>1.0</version>
|
||||||
|
<sdf version="1.6">model.sdf</sdf>
|
||||||
|
<author>
|
||||||
|
<name>T800 Robotics</name>
|
||||||
|
<email>tdd@gmail.com</email>
|
||||||
|
</author>
|
||||||
|
<description>
|
||||||
|
Tấm dẫn hướng chữ V của trạm dock, dùng để kiểm bộ dò biên dạng bằng LiDAR trong Gazebo.
|
||||||
|
Góc trong tại đỉnh 90 độ, mỗi cánh 0.30 m — khớp profile `v_std`.
|
||||||
|
</description>
|
||||||
|
</model>
|
||||||
58
sim/models/dock_plate_v/model.sdf
Normal file
58
sim/models/dock_plate_v/model.sdf
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!--
|
||||||
|
Tấm dẫn hướng chữ V.
|
||||||
|
|
||||||
|
Hình học phải KHỚP profile `v_std` trong action_handlers_params.yaml:
|
||||||
|
vertex_angle = 90 độ (góc TRONG tại đỉnh, giữa hai cánh)
|
||||||
|
wing_length = 0.30 m (từ đỉnh ra đầu mút)
|
||||||
|
|
||||||
|
Đỉnh nằm tại gốc model, hai cánh mở về phía +X. Robot tiếp cận từ +X nên nó nhìn thấy MẶT TRONG
|
||||||
|
của chữ V — đúng thứ bộ dò khớp.
|
||||||
|
|
||||||
|
Mỗi cánh nghiêng 45 độ so với trục Y, nên góc giữa hai cánh = 180 - 2*45 = 90 độ.
|
||||||
|
|
||||||
|
Cao 0.6 m và đáy sát sàn: LiDAR phẳng gắn ở độ cao nào trong khoảng đó cũng cắt qua tấm. Dày
|
||||||
|
0.02 m để `min_split_dist` (0.02 m) không nhầm hai mặt của cùng một cánh thành hai đoạn.
|
||||||
|
-->
|
||||||
|
<sdf version="1.6">
|
||||||
|
<model name="dock_plate_v">
|
||||||
|
<static>true</static>
|
||||||
|
|
||||||
|
<link name="wing_left">
|
||||||
|
<!-- Tâm cánh nằm giữa đỉnh và đầu mút: 0.15 m dọc theo cánh. -->
|
||||||
|
<pose>0.10607 0.10607 0.3 0 0 0.7854</pose>
|
||||||
|
<collision name="collision">
|
||||||
|
<geometry>
|
||||||
|
<box><size>0.02 0.30 0.6</size></box>
|
||||||
|
</geometry>
|
||||||
|
</collision>
|
||||||
|
<visual name="visual">
|
||||||
|
<geometry>
|
||||||
|
<box><size>0.02 0.30 0.6</size></box>
|
||||||
|
</geometry>
|
||||||
|
<material>
|
||||||
|
<ambient>0.9 0.6 0.1 1</ambient>
|
||||||
|
<diffuse>0.9 0.6 0.1 1</diffuse>
|
||||||
|
</material>
|
||||||
|
</visual>
|
||||||
|
</link>
|
||||||
|
|
||||||
|
<link name="wing_right">
|
||||||
|
<pose>0.10607 -0.10607 0.3 0 0 -0.7854</pose>
|
||||||
|
<collision name="collision">
|
||||||
|
<geometry>
|
||||||
|
<box><size>0.02 0.30 0.6</size></box>
|
||||||
|
</geometry>
|
||||||
|
</collision>
|
||||||
|
<visual name="visual">
|
||||||
|
<geometry>
|
||||||
|
<box><size>0.02 0.30 0.6</size></box>
|
||||||
|
</geometry>
|
||||||
|
<material>
|
||||||
|
<ambient>0.9 0.6 0.1 1</ambient>
|
||||||
|
<diffuse>0.9 0.6 0.1 1</diffuse>
|
||||||
|
</material>
|
||||||
|
</visual>
|
||||||
|
</link>
|
||||||
|
</model>
|
||||||
|
</sdf>
|
||||||
Reference in New Issue
Block a user