sim: dia hinh 3D -- doc va san cao tu model vslam_terrain_*, robot di tren mat san, LiDAR tia 3D, ground truth 6-DoF, world slope_test (5 doc 5-30 do)

This commit is contained in:
trung09122002
2026-10-03 18:31:13 +07:00
parent be2aa17e3e
commit 26ee1a3b72
27 changed files with 2373 additions and 37 deletions

View File

@@ -151,6 +151,7 @@ struct WebSnapshot {
Pose2D ground_truth;
double gt_roll = 0.0; // nghieng THAT, de doi chung gravity_align
double gt_pitch = 0.0;
double gt_z = 0.0; // do cao san THAT duoi robot (world co doc)
SafetySnapshot safety;
SlamSnapshot slam;

View File

@@ -141,6 +141,7 @@ void WriteStateJson(const WebSnapshot& s, std::string* out) {
Num("yaw", s.ground_truth.theta, 4, out); Comma(out);
Num("roll", s.gt_roll, 4, out); Comma(out);
Num("pitch", s.gt_pitch, 4, out); Comma(out);
Num("z", s.gt_z, 3, out); Comma(out);
// Sai so vi tri cua uoc luong so voi su that. Tinh o day thay vi de
// client tu tru: neu sau nay map va gt khac goc toa do thi phep tru
// ngay tren client se sai am tham.

View File

@@ -394,6 +394,8 @@ function onState(s) {
// khong phan biet duoc "dung o goc" voi "khong biet".
state.gt = s.gt || null;
txt('gtErr', s.gt ? fmt(s.gt.err, 3) + ' m' : '--');
// Do cao san THAT (sim co doc). Pose uoc luong hien la 2D: chua co z.
txt('gtZ', s.gt && s.gt.z !== undefined ? fmt(s.gt.z, 3) + ' m' : '--');
state.slamMode = s.slam.mode;
txt('mode', s.slam.mode);

View File

@@ -425,6 +425,19 @@ function v3dSetPose(group, p) {
group.position.x = p.x;
group.position.z = -p.y;
group.rotation.y = p.yaw;
// Cao do va nghieng CHI khi pose mang chung -- hien chi ground truth cua sim
// (`gt.z/roll/pitch`). Pose uoc luong la 2D: KHONG dong vao y, de hop dong
// o tren van dung (test/www/test_robot_marker.js muc 4).
//
// Nhom NGOAI duoc dat cao do san (`z`), phep nang wheel_radius van o tang
// trong. Goc: ROS R = Rz(yaw) Ry(pitch) Rx(roll); three.js y-len, z = -y_ros
// -> Ry(yaw) Rz(-pitch) Rx(roll), tuc thu tu 'YZX'.
if (p.z !== undefined) group.position.y = p.z;
if (p.roll !== undefined || p.pitch !== undefined) {
group.rotation.order = 'YZX';
group.rotation.x = p.roll || 0;
group.rotation.z = -(p.pitch || 0);
}
}
// scan: mang [x0,y0, x1,y1, ...] trong frame LASER (xem ghi chu ben trong).

View File

@@ -73,6 +73,8 @@
<!-- Ground truth chi co khi mo phong. Sai so la thuoc do duy nhat
cho biet uoc luong dang tot hay te. -->
<tr><td>sai so</td><td id="gtErr">--</td></tr>
<!-- Do cao san that (mo phong co doc). Uoc luong chua co z. -->
<tr><td>z that</td><td id="gtZ">--</td></tr>
</table>
</section>