diff --git a/README.md b/README.md index a0207c6..ffb0e71 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,9 @@ Ros2d-quasar基于[Quasar Framework](https://quasar.dev/)开发,因此可以 与ROS的连接使用的是原生WebSocket,没有使用[roslibjs](https://github.com/RobotWebTools/roslibjs) -如果想体验这个程序,可以使用[legubiao/amr_platform](https://github.com/legubiao/amr_platform)来使用Turtlebot启动仿真 - -## 启动项目 +## 1. 启动项目 启动项目之前,请确保已安装LTS版本(双数版本号)的[Node.js](https://nodejs.org/en)和[Yarn](https://classic.yarnpkg.com/lang/en/docs/install)。如果已经安装好了nodejs,可以通过以下的指令安装yarn @@ -42,12 +40,17 @@ yarn quasar dev ``` +如果需要更新项目使用的quasar框架版本,可以使用以下指令: + +```bash +yarn upgrade quasar +``` + +如果需要启动一个ROS仿真程序来进一步体验,可以参考:[legubiao/AMR-Remote-Control-Toolkit: A rospkg enable launch mapping through topic command and provide support for quasar-ros2d (github.com)](https://github.com/legubiao/AMR-Remote-Control-Toolkit) -## 连接机器人 -## 构建项目并打包为Docker镜像 -也可以直接通过[DockerHub](https://hub.docker.com/repository/docker/legubiao/ros2d-quasar/general)下载使用 +## 2. 编译Docker镜像 构建项目 ```bash @@ -58,3 +61,8 @@ quasar build ```bash docker build -t ros2d-quasar . ``` + +已经配置Github Actions自动打包,也可以直接通过[DockerHub](https://hub.docker.com/repository/docker/legubiao/ros2d-quasar/general)下载使用镜像 + + + diff --git a/src/components/amr-control/MapCreate.vue b/src/components/amr-control/MapCreate.vue index 99d7be2..676ae42 100644 --- a/src/components/amr-control/MapCreate.vue +++ b/src/components/amr-control/MapCreate.vue @@ -28,22 +28,9 @@ function saveMap () { mapCommand('save ' + data) }) } - -function stopProcess () { - $q.dialog({ - title: t('amr2d_stop_process'), - message: t('amr2d_stop_process_description'), - cancel: { label: t('cancel'), flat: true, color: 'secondary' }, - ok: { label: t('ok'), flat: true, color: 'primary', class: 'text-bold' }, - persistent: true - }).onOk(() => { - mapCommand('stop') - }) -} diff --git a/src/components/amr-control/RosMap2d.vue b/src/components/amr-control/RosMap2d.vue index 0220c92..f6af285 100644 --- a/src/components/amr-control/RosMap2d.vue +++ b/src/components/amr-control/RosMap2d.vue @@ -9,6 +9,7 @@ import MapCreate from 'components/amr-control/MapCreate.vue' import PoseManager from 'components/map-pose/PoseManager.vue' import { useControlParams } from 'stores/control-params' import { useVisualization } from 'stores/visualization' +import TerminateProcess from 'components/amr-control/TerminateProcess.vue' const rosClient = inject('rosClient') const connected = inject('connected') @@ -56,10 +57,12 @@ const robotRelocate = ref()
- - + - + + + - -
@@ -86,14 +90,3 @@ const robotRelocate = ref() - - diff --git a/src/components/amr-control/TerminateProcess.vue b/src/components/amr-control/TerminateProcess.vue new file mode 100644 index 0000000..7307aa3 --- /dev/null +++ b/src/components/amr-control/TerminateProcess.vue @@ -0,0 +1,27 @@ + + + diff --git a/src/components/ros/RosClient.js b/src/components/ros/RosClient.js index bdf3886..2f82878 100644 --- a/src/components/ros/RosClient.js +++ b/src/components/ros/RosClient.js @@ -104,7 +104,7 @@ export default function RosClient () { case laserScanTopic: rosClient.loadLaserScan.value(rosObject.msg); break case pathTopic: rosClient.loadPath.value(rosObject.msg); break case trajectoryTopic: rosClient.loadTrajectory.value(rosObject.msg); break - case '/map_state': mapState.value = rosObject.msg.data; break + case '/map_state': rosClient.mapState.value = rosObject.msg.data; break } } @@ -151,8 +151,8 @@ export default function RosClient () { } rosClient.init = createWs - const mapState = ref('idle') - provide('mapState', mapState) + rosClient.mapState = ref('idle') + provide('mapState', rosClient.mapState) provide('robotPose', rosClient.robotPose) provide('subscribe', rosClient.subscribe) provide('unsubscribe', rosClient.unsubscribe) diff --git a/src/i18n/en-US/index.js b/src/i18n/en-US/index.js index b705451..db56fa2 100644 --- a/src/i18n/en-US/index.js +++ b/src/i18n/en-US/index.js @@ -34,6 +34,7 @@ export default { amr2d_navigation_relocate: 'Navigation & Relocate', amr2d_focus: 'Focus on AMR', + amr2d_wait: 'Please wait for processing...', amr2d_no_focus: 'Cancel Focus', amr2d_relocate: '2D Pose Estimation', amr2d_navigation: 'Set Nav Goal', diff --git a/src/i18n/zh-CN/index.js b/src/i18n/zh-CN/index.js index 98dfe5d..2b6b678 100644 --- a/src/i18n/zh-CN/index.js +++ b/src/i18n/zh-CN/index.js @@ -34,6 +34,7 @@ export default { amr2d_navigation_relocate: '导航与重定位', amr2d_focus: '视角跟随机器人', + amr2d_wait: '请等待后台程序处理...', amr2d_no_focus: '取消视角跟随', amr2d_relocate: '重定位机器人', amr2d_navigation: '设定导航目标', diff --git a/src/pages/AmrControl.vue b/src/pages/AmrControl.vue index a1ee54f..f88eaef 100644 --- a/src/pages/AmrControl.vue +++ b/src/pages/AmrControl.vue @@ -1,11 +1,12 @@