This commit is contained in:
trung09122002
2026-09-19 18:40:12 +07:00
parent 62b611a3eb
commit b6bd238295
3 changed files with 21 additions and 4 deletions

View File

@@ -129,9 +129,13 @@ endif()
# $VSLAM_CONFIG_DIR / $VSLAM_RESOURCE_DIR -- do la cach mot ban cai khong theo
# FHS van tim thay config cua no.
# ---------------------------------------------------------------------------
# *.dcf di cung *.yaml: lely doc file DCF luc khoi dong, nen mot ban cai
# thieu no se build xong, cai xong, roi chet luc chay voi mot loi tu trong
# ruot lely. Loc theo duoi file la cho rat de bo sot khi them mot loai file
# cau hinh moi.
install(DIRECTORY configuration_files/
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/vslam/configuration_files
FILES_MATCHING PATTERN "*.yaml")
FILES_MATCHING PATTERN "*.yaml" PATTERN "*.dcf")
install(DIRECTORY resources/
DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/vslam/resources)

View File

@@ -173,7 +173,17 @@ StatusResponse LoadAppConfig(const std::string& dir, AppConfig* out) {
out->base_driver.can_channel = b.get<std::string>("can_channel", "can0");
out->base_driver.can_node_id =
static_cast<uint8_t>(b.get<int>("can_node_id", 1));
out->base_driver.dcf_path = b.get<std::string>("dcf_path", "");
// Duong dan TUONG DOI duoc giai theo thu muc config, giong moi file khac.
// Tuyet doi thi giu nguyen.
//
// Ly do khong de nguoi dung go duong dan tuyet doi: no se la
// /home/<ai do>/... trong mot file duoc commit, tuc chay duoc tren dung
// mot may. Da mac dung loi nay o test/www -- xem git log.
{
const std::string p = b.get<std::string>("dcf_path", "master.dcf");
out->base_driver.dcf_path =
(!p.empty() && p.front() == '/') ? p : (dir + "/" + p);
}
out->base_driver.encoder_counts_per_rev =
static_cast<uint32_t>(b.get<int>("encoder_counts_per_rev", 0));

View File

@@ -106,8 +106,11 @@ base:
can_node_id: 1
# File DCF sinh bang `dcfgen` tu master.yml. lely KHONG chay duoc neu thieu.
# Duong dan TUYET DOI, va phai ton tai luc khoi dong.
dcf_path: /opt/vslam/share/vslam/master.dcf
#
# Duong dan TUONG DOI duoc giai theo chinh thu muc config nay, nen no chay
# duoc ca tu cay nguon lan sau khi cai vao /etc/vslam. Muon tro ra ngoai thi
# dung duong dan tuyet doi -- nhung dung commit mot duong dan /home/<ai do>.
dcf_path: master.dcf
# Increment/vong cua encoder, doc qua 0x6064. 0 = hoi thiet bi luc Open()
# qua 0x608F:1 thay vi chep tay mot hang so.