105 lines
4.7 KiB
HTML
105 lines
4.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Title</title>
|
|
<link rel="stylesheet" href="../css/bootstrap.min.css"/>
|
|
<link rel="stylesheet" href="../css/btn.css"/>
|
|
<script src="../jquery-2.1.0.min.js"></script>
|
|
<script src="../jquery.cookie.js"></script>
|
|
<style>
|
|
.btn{
|
|
color: white;
|
|
}
|
|
</style>
|
|
<script type="text/javascript" type="text/javascript">
|
|
function client_NUSLocalizationSetSeed(x,y,t){
|
|
var str="NUSLocalizationSetSeed:"+x.toString("F3")+";"+y.toString("F3")+";"+t.toString("F3")+"#";
|
|
client_request(str);
|
|
}
|
|
|
|
function client_NUSLocalizationSetInitialSeed(x,y,t){
|
|
var str="NUSLocalizationSetInitialSeed:"+x.toString("F3")+";"+y.toString("F3")+";"+t.toString("F3")+"#";
|
|
client_request(str);
|
|
}
|
|
|
|
function client_NUSLocalizationSetImuSeed(x,y,t){
|
|
var str="NUSLocalizationSetImuSeed:"+x.toString("F3")+";"+y.toString("F3")+";"+t.toString("F3")+"#";
|
|
client_request(str);
|
|
}
|
|
|
|
|
|
function client_NUSMapServerMapSaver(free,occ){
|
|
var str="NUSMapServerMapSaver:"+free.toString()+";"+occ.toString()+"#";
|
|
client_request(str);
|
|
}
|
|
|
|
function client_request(str){
|
|
$('#output').html("");
|
|
window.parent.postMessage(
|
|
{
|
|
event_id: 'client_request',
|
|
data: {
|
|
v1: str
|
|
}
|
|
},
|
|
"*" //or "www.parentpage.com"
|
|
);
|
|
}
|
|
|
|
function receiveMessage(event)
|
|
{
|
|
//console.log(event.data);
|
|
switch(event.data.event_id){
|
|
case "client_response":{
|
|
var data=event.data.data;
|
|
var result=data.v1;
|
|
var ROS_String_Output=data.v2;
|
|
var Rec_HMI_String_Input=data.v3;
|
|
var Client_Request_Cmd=Rec_HMI_String_Input.split(':');
|
|
console.log(data);
|
|
switch(Client_Request_Cmd[0]){
|
|
default:
|
|
case "NUSMapServerMapSaver":{
|
|
document.getElementById('output').innerText=ROS_String_Output;
|
|
}
|
|
}
|
|
}break;
|
|
}
|
|
}
|
|
window.addEventListener("message", receiveMessage, false);
|
|
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="output"></div>
|
|
<p><input type=text class="input form-control" id="set_x_m" name=set_x_m value="0.0"></input></p>
|
|
<p><input type=text class="input form-control" id="set_y_m" name=set_y_m value="0.0"></input></p>
|
|
<p><input type=text class="input form-control" id="set_t_deg" name=set_t_deg value="0.0"></input></p>
|
|
<input type=button class="btn" value="NUSLocalizationSetSeed" style="background:#FD4F00FF" onclick=client_NUSLocalizationSetSeed(set_x_m.value,set_y_m.value,set_t_deg.value)></input>
|
|
|
|
<p><input type=text class="input form-control" id="set_initial_x_m" name=set_initial_x_m value="0.0"></input></p>
|
|
<p><input type=text class="input form-control" id="set_initial_y_m" name=set_initial_y_m value="0.0"></input></p>
|
|
<p><input type=text class="input form-control" id="set_initial_t_deg" name=set_initial_t_deg value="0.0"></input></p>
|
|
<input type=button class="btn" value="NUSLocalizationSetInitialSeed" onclick=client_NUSLocalizationSetInitialSeed(set_initial_x_m.value,set_initial_y_m.value,set_initial_t_deg.value)></input>
|
|
|
|
<p><input type=text class="input form-control" id="set_imu_x_m" name=set_imu_x_m value="0.0"></input></p>
|
|
<p><input type=text class="input form-control" id="set_imu_y_m" name=set_imu_y_m value="0.0"></input></p>
|
|
<p><input type=text class="input form-control" id="set_imu_t_deg" name=set_imu_t_deg value="0.0"></input></p>
|
|
<input type=button class="btn" value="NUSLocalizationSetImuSeed" onclick=client_NUSLocalizationSetImuSeed(set_imu_x_m.value,set_imu_y_m.value,set_imu_t_deg.value)></input>
|
|
|
|
<p><input type=text class="input form-control" id="free" name=free value="20"></input></p>
|
|
<p><input type=text class="input form-control" id="occ" name=occ value="65"></input></p>
|
|
<input type=button class="btn" value="NUSMapServerMapSaver" onclick=client_NUSMapServerMapSaver(free.value,occ.value)></input>
|
|
</body>
|
|
<script>
|
|
$(".input").focus(function(){
|
|
window.parent.inputDom = this;
|
|
// $(".simple-keyboard",top.document).css("top",$(this).offset().top - $(window).scrollTop() + 150 +"px")
|
|
var distance = $(parent.document).scrollTop() + 500 + "px";
|
|
$(".simple-keyboard", parent.document).css("top", distance)
|
|
$(".keyboard",parent.document).show();
|
|
window.parent.clearKeyboard();
|
|
})
|
|
</script>
|
|
</html> |