diff --git a/ActiveBOWeb/src/components/PolicyPlot.vue b/ActiveBOWeb/src/components/PolicyPlot.vue index df0f1a8..221ca05 100644 --- a/ActiveBOWeb/src/components/PolicyPlot.vue +++ b/ActiveBOWeb/src/components/PolicyPlot.vue @@ -68,7 +68,7 @@ function buildChart() { display: false, }, verticalLinePlugin: { - xValue: rlstore.current_time, + xValue: rlstore.getCurrentTime, }, }, lineTension: 0, @@ -111,6 +111,8 @@ watch( .fill(0) .map((_, i) => i); chartHandle.data.datasets[0].data = policy; + chartHandle.options.plugins.verticalLinePlugin.xValue = + rlstore.current_time; chartHandle.update(); } @@ -125,6 +127,8 @@ watch( .fill(0) .map((_, i) => i); chartHandle.data.datasets[0].data = policy; + chartHandle.options.plugins.verticalLinePlugin.xValue = + rlstore.current_time; chartHandle.update(); } diff --git a/ActiveBOWeb/src/components/RosBar.vue b/ActiveBOWeb/src/components/RosBar.vue index 0b17d5d..f28ff7f 100644 --- a/ActiveBOWeb/src/components/RosBar.vue +++ b/ActiveBOWeb/src/components/RosBar.vue @@ -105,13 +105,6 @@ watch(stateCounter.value, (newValue) => { } }); -// Policy Service -const policy_service = new ROS.Service({ - ros: ros, - name: "/policy_srv", - serviceType: "active_bo_msgs/srv/WeightToPolicy", -}); - // RL Service + Feedback Subscriber const rl_feedback_subscriber = new ROS.Topic({ ros: ros, @@ -122,6 +115,7 @@ const rl_feedback_subscriber = new ROS.Topic({ rl_feedback_subscriber.subscribe((msg) => { rlstore.setDim(msg.height, msg.width); rlstore.setRgbArrays(msg.red, msg.green, msg.blue); + rlstore.setCurrentTime(msg.current_time); }); const active_rl_eval_sub = new ROS.Topic({ @@ -143,32 +137,12 @@ const active_rl_eval_pub = new ROS.Topic({ messageType: "active_bo_msgs/msg/ActiveRL", }); -// const active_eval_response_first = new ROSLIB.Message({ -// policy: pstore.policy, -// weights: pstore.weights, -// }); -// console.log(active_eval_response_first); -// active_rl_eval_pub.publish(active_eval_response_first); - -// function sleep(ms) { -// return new Promise((resolve) => setTimeout(resolve, ms)); -// } - watch( () => cstore.getSendWeights, () => { const metric = cstore.getMetric; - if (metric === "manually") { - const policy_request = new ROS.ServiceRequest({ - weights: pstore.policy, - nr_steps: pstore.weights, - }); - - policy_service.callService(policy_request, function (result) { - pstore.setPolicy(result.policy); - }); - } else if (metric === "active BO") { + if (metric === "active BO") { if (!pendingRequest.value) { return; } @@ -200,11 +174,6 @@ const bo_service = new ROS.Service({ serviceType: "active_bo_msgs/srv/BO", }); -// const active_bo_service = new ROSLIB.Service({ -// ros: ros, -// name: "/active_bo_srv", -// serviceType: "active_bo_msgs/srv/ActiveBO", -// }); const active_bo_pending = ref(false); const active_bo_request = new ROS.Topic({