Skip to content

Commit

Permalink
更新中文部署文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryze authored and Ryze committed Nov 20, 2018
1 parent 15137dd commit 33ed5dc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/zh_CN/DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
3. 地图服务:`ros-kinetic-map-server`
4. 摄像头流服务:`ros-kinetic-web-video-server`
5. USB 摄像头驱动:`ros-kinetic-usb-cam`
6. rosbridge:`sudo apt-get install ros-kinetic-rosbridge-suite`

## 代码部署

Expand Down
11 changes: 9 additions & 2 deletions src/restful/controllers/roslaunch.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ const rosCtrl = require('../../roscontrol');
const path = require('path');

let fn_startROSLaunch = async (ctx, next) => {



let preset = ctx.request.query.preset;
console.log("运行ROS Launch",preset);
if (!preset) {
ctx.response.body = {
message: 'failed: need preset in query!'
}
} else {

console.log("运行ROS Launch 1");

let launchFile;
//TODO: 在此处更新预设 launch
switch (preset) {
Expand All @@ -35,10 +42,10 @@ let fn_startROSLaunch = async (ctx, next) => {
console.log('roslaunch Closed ===> \n', data);
}
if (event == 'stderr') {
// console.log('roslaunch STDERR ===>\n', data);
console.error('roslaunch STDERR ===>\n', data);
}
if (event == 'stdout') {
// console.log('roslaunch STDERR ===>\n', data);
console.log('roslaunch stdout ===>\n', data);
}
});
ctx.response.body = {
Expand Down
2 changes: 2 additions & 0 deletions src/roscontrol/lib/runlaunch.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function runRosLaunch(packageName, fileName, callback, options, args) {
if (args) {
argsArr.push(...args)
}
console.log(`[---info] packageName=${packageName} fileName=${fileName} options=${options} args=${args}`);
console.log("启动ros服务,argsArr",argsArr);
let subprocess = cp.spawn('roslaunch', argsArr);
subprocess.on('close', (data) => {
if (callback) {
Expand Down

0 comments on commit 33ed5dc

Please sign in to comment.