Spawning the plate a second time fails with "entity already exists" and leaves the previous one in the world. Edit the model, spawn again, and nothing changes - which reads as a broken model rather than a refused spawn. It cost a round trip here: the tape was added, the plate was respawned, and intensities stayed at zero because the plate standing in the world was the one from before the tape existed. The launch and the README now say to delete first, and the README lists the stale-plate case ahead of the two real ways intensities can come back empty, in the order worth checking them.
40 lines
2.0 KiB
XML
40 lines
2.0 KiB
XML
<!--
|
|
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
|
|
|
|
⚠ Gazebo TỪ CHỐI spawn đè lên model cùng tên: "SpawnModel: Failure - entity already exists".
|
|
Đã spawn một lần rồi thì phải xoá trước, nếu không thứ nằm trong world vẫn là BẢN CŨ — sửa
|
|
model.sdf xong mà không xoá thì không có gì thay đổi, và rất dễ tưởng nhầm là model sai:
|
|
|
|
rosservice call /gazebo/delete_model "model_name: 'dock_plate_v'"
|
|
|
|
Hoặc spawn thêm một cái tên khác để so sánh hai bản cạnh nhau:
|
|
|
|
roslaunch dock_pattern_action spawn_dock_plate.launch name:=dock_plate_v2 x:=3.0 y:=1.5
|
|
|
|
`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>
|