Develop #5

Merged
IliaMiheev merged 19 commits from develop into master 2026-03-09 19:14:27 +03:00
4 changed files with 59 additions and 31 deletions
Showing only changes of commit f97d8e80c2 - Show all commits
+11 -8
View File
@@ -616,7 +616,6 @@
"integrity": "sha512-zx0EIq78WlY/lBb1uXlziZmDZI4ubcCXIMJ4uGjXzZW0nS19TjSPeXPAjzzTmKQlJUZm0SbmZhPKP7tuQ1SsEw==", "integrity": "sha512-zx0EIq78WlY/lBb1uXlziZmDZI4ubcCXIMJ4uGjXzZW0nS19TjSPeXPAjzzTmKQlJUZm0SbmZhPKP7tuQ1SsEw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"chalk": "^4.1.1", "chalk": "^4.1.1",
"fs-extra": "^9.0.1", "fs-extra": "^9.0.1",
@@ -1753,7 +1752,6 @@
"integrity": "sha512-yl43JD/86CIj3Mz5mvvLJqAOfIup7ncxfJ0Btnl0/v5TouVUyeEdcpknfgc+yMevS/48oH9WAkkw93m7otLb/A==", "integrity": "sha512-yl43JD/86CIj3Mz5mvvLJqAOfIup7ncxfJ0Btnl0/v5TouVUyeEdcpknfgc+yMevS/48oH9WAkkw93m7otLb/A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@inquirer/checkbox": "^3.0.1", "@inquirer/checkbox": "^3.0.1",
"@inquirer/confirm": "^4.0.1", "@inquirer/confirm": "^4.0.1",
@@ -2912,7 +2910,6 @@
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"bin": { "bin": {
"acorn": "bin/acorn" "acorn": "bin/acorn"
}, },
@@ -2979,7 +2976,6 @@
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1", "fast-uri": "^3.0.1",
@@ -3197,7 +3193,6 @@
} }
], ],
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"baseline-browser-mapping": "^2.9.0", "baseline-browser-mapping": "^2.9.0",
"caniuse-lite": "^1.0.30001759", "caniuse-lite": "^1.0.30001759",
@@ -4504,6 +4499,17 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/encoding": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
"integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"iconv-lite": "^0.6.2"
}
},
"node_modules/end-of-stream": { "node_modules/end-of-stream": {
"version": "1.4.5", "version": "1.4.5",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
@@ -8024,7 +8030,6 @@
"integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"esbuild": "^0.21.3", "esbuild": "^0.21.3",
"postcss": "^8.4.43", "postcss": "^8.4.43",
@@ -8084,7 +8089,6 @@
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.28.tgz", "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.28.tgz",
"integrity": "sha512-BRdrNfeoccSoIZeIhyPBfvWSLFP4q8J3u8Ju8Ug5vu3LdD+yTM13Sg4sKtljxozbnuMu1NB1X5HBHRYUzFocKg==", "integrity": "sha512-BRdrNfeoccSoIZeIhyPBfvWSLFP4q8J3u8Ju8Ug5vu3LdD+yTM13Sg4sKtljxozbnuMu1NB1X5HBHRYUzFocKg==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@vue/compiler-dom": "3.5.28", "@vue/compiler-dom": "3.5.28",
"@vue/compiler-sfc": "3.5.28", "@vue/compiler-sfc": "3.5.28",
@@ -8138,7 +8142,6 @@
"integrity": "sha512-gX/dMkRQc7QOMzgTe6KsYFM7DxeIONQSui1s0n/0xht36HvrgbxtM1xBlgx596NbpHuQU8P7QpKwrZYwUX48nw==", "integrity": "sha512-gX/dMkRQc7QOMzgTe6KsYFM7DxeIONQSui1s0n/0xht36HvrgbxtM1xBlgx596NbpHuQU8P7QpKwrZYwUX48nw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@types/eslint-scope": "^3.7.7", "@types/eslint-scope": "^3.7.7",
"@types/estree": "^1.0.8", "@types/estree": "^1.0.8",
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

+5
View File
@@ -5,3 +5,8 @@ def qr_detection(data):
if barcodes: if barcodes:
qr_data = barcodes[0].data.decode('utf-8') qr_data = barcodes[0].data.decode('utf-8')
return qr_data return qr_data
<<separator>>
qr_sub = rospy.Subscriber('main_camera/image_raw', Image, qr_detection, queue_size=1)
rospy.sleep(2)
qr_sub.unregister()
+41 -21
View File
@@ -12,12 +12,6 @@ const clickCount = ref(1); // Счетчик нажатий
const listOfTrips = ref([]); const listOfTrips = ref([]);
const isModalVisible = ref(false); const isModalVisible = ref(false);
let finallyText = ref(""); let finallyText = ref("");
const qr_sub_text = `
\tqr_sub = rospy.Subscriber('main_camera/image_raw',Image, qr_detection,queue_size=1)\n
\trospy.sleep(2)\n
\tqr_sub.unregister()\n
`
let is_qr__head_used = 0;
onMounted(() => { onMounted(() => {
for (let i = 0; i < 100; i++) { for (let i = 0; i < 100; i++) {
@@ -27,6 +21,7 @@ onMounted(() => {
y: 9 - Math.floor(i / 10), y: 9 - Math.floor(i / 10),
index: i, index: i,
isPlatform: false, isPlatform: false,
isQR: false,
BgImg: 'images/ArUco-marker.jpg' BgImg: 'images/ArUco-marker.jpg'
}); });
} }
@@ -58,8 +53,11 @@ async function saveResult() {
finallyText.value = ""; finallyText.value = "";
const mainCode = ref(""); const mainCode = ref("");
const colorDetectClass = ref(""); const colorDetectClass = ref("");
const QRDetectClass = ref("");
const colorDetectCode = ref(""); const colorDetectCode = ref("");
const QRDetectCode = ref("");
const isUsedPlatform = listOfTrips.value.some(item => item.isPlatform); const isUsedPlatform = listOfTrips.value.some(item => item.isPlatform);
const isUsedQR = listOfTrips.value.some(item => item.isQR);
if (isUsedPlatform) { if (isUsedPlatform) {
const response = await fetch("/shablons/color.txt") const response = await fetch("/shablons/color.txt")
@@ -69,11 +67,22 @@ async function saveResult() {
colorDetectCode.value += `\t${textOfCode[1].trim()}\n`; colorDetectCode.value += `\t${textOfCode[1].trim()}\n`;
} }
if (isUsedQR) {
const response = await fetch("/shablons/qr.txt")
let textOfCode = await response.text()
textOfCode = textOfCode.split('<<separator>>')
QRDetectClass.value = textOfCode[0]
QRDetectCode.value += `\t${textOfCode[1].trim()}\n`;
}
for (const item of listOfTrips.value) { for (const item of listOfTrips.value) {
mainCode.value += `\tnavigate_wait(${item.x}, ${item.y})\n`; mainCode.value += `\tnavigate_wait(${item.x}, ${item.y})\n`;
if (isUsedPlatform) { if (item.isPlatform) {
mainCode.value += colorDetectCode.value + '\n' mainCode.value += colorDetectCode.value + '\n'
} }
if (item.isQR) {
mainCode.value += QRDetectCode.value + '\n'
}
} }
const response = await fetch("/shablons/emergency_and_navigate.txt") const response = await fetch("/shablons/emergency_and_navigate.txt")
let textOfCode = await response.text() let textOfCode = await response.text()
@@ -81,20 +90,11 @@ async function saveResult() {
if (isUsedPlatform) { if (isUsedPlatform) {
finallyText.value = finallyText.value.replace("<<ColorDetect>>", colorDetectClass.value); finallyText.value = finallyText.value.replace("<<ColorDetect>>", colorDetectClass.value);
} }
isModalVisible.value = true; if (isUsedQR) {
if (is_qr__head_used === 1) { finallyText.value = finallyText.value.replace("<<qr_function>>", QRDetectClass.value);
Qr_head()
is_qr__head_used +=1
} }
} isModalVisible.value = true;}
function Qr_head() {
fetch("/shablons/qr.txt")
.then((response) => response.text())
.then((textOfCode) => {
finallyText = finallyText.replace("<<qr_function>>", textOfCode);
})
}
function cancel() { function cancel() {
@@ -177,6 +177,26 @@ function deletePlatform(item) {
clickCount.value-- clickCount.value--
} }
function createQR(item) {
if (!item.isQR) {
listOfTrips.value.push(item)
numbers.value[item.index].variable.push(clickCount.value);
}
item['isQR'] = true
numbers.value[item.index].BgImg = `images/qr.jpg`
clickCount.value++
}
function deleteQR(item) {
item['isQR'] = false
const index = listOfTrips.value.indexOf(item);
if (index !== -1) {
listOfTrips.value.splice(index, 1);
}
numbers.value[item.index].BgImg = 'images/ArUco-marker.jpg'
clickCount.value--
}
function onContextMenu(e, item) { function onContextMenu(e, item) {
ContextMenu.showContextMenu({ ContextMenu.showContextMenu({
theme: 'mac dark', theme: 'mac dark',
@@ -209,11 +229,11 @@ function onContextMenu(e, item) {
children: [ children: [
{ {
label: "Добавить", label: "Добавить",
onClick: () => alert('Здесь ещё предстоит написать код') onClick: () => createQR(item)
}, },
{ {
label: "Удалить", label: "Удалить",
onClick: () => alert('Здесь ещё предстоит написать код') onClick: () => deleteQR(item)
}, },
], ],
}, },