mirror of
https://github.com/CopterExpress/clover.git
synced 2026-06-01 15:39:32 +00:00
Compare commits
1 Commits
master
...
web-params
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2930eb9c22 |
@@ -53,6 +53,29 @@ function viewTopic(topic) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function viewParameters() {
|
||||||
|
title.innerHTML = 'Parameters';
|
||||||
|
topicMessage.style.display = 'block';
|
||||||
|
|
||||||
|
let names = ['aruco_detect', 'main_camera', 'main_camera_nodelet_manager', 'mavros', 'optical_flow',
|
||||||
|
'rangefinder', 'rosapi', 'rosbridge_websocket', 'rosdistro', 'roslaunch', 'rosversion',
|
||||||
|
'roswww_static', 'run_id', 'simple_offboard', 'visualization', 'web_video_server'];
|
||||||
|
let params = {};
|
||||||
|
// ros.getParams(function(params) {
|
||||||
|
|
||||||
|
Promise.all(names.map(function(name) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
new ROSLIB.Param({ ros, name }).get(function(value) {
|
||||||
|
params[name] = value;
|
||||||
|
resolve();
|
||||||
|
})
|
||||||
|
});
|
||||||
|
})).then(function() {
|
||||||
|
console.log(params);
|
||||||
|
topicMessage.innerHTML = yamlStringify(params);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let mouseDown;
|
let mouseDown;
|
||||||
|
|
||||||
topicMessage.addEventListener('mousedown', function() { mouseDown = true; });
|
topicMessage.addEventListener('mousedown', function() { mouseDown = true; });
|
||||||
@@ -61,6 +84,9 @@ topicMessage.addEventListener('mouseup', function() { mouseDown = false; });
|
|||||||
function init() {
|
function init() {
|
||||||
const params = Object.fromEntries(new URLSearchParams(window.location.search).entries());
|
const params = Object.fromEntries(new URLSearchParams(window.location.search).entries());
|
||||||
|
|
||||||
|
viewParameters();
|
||||||
|
return;
|
||||||
|
|
||||||
if (!params.topic) {
|
if (!params.topic) {
|
||||||
viewTopicsList();
|
viewTopicsList();
|
||||||
} else {
|
} else {
|
||||||
@@ -70,3 +96,5 @@ function init() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.ros = ros;
|
||||||
|
|||||||
Reference in New Issue
Block a user