From 840804703389c86f44b0edb51669e8a8d4f9b766 Mon Sep 17 00:00:00 2001 From: h-wata Date: Fri, 24 May 2024 14:53:51 +0900 Subject: [PATCH] Update getting battery level from robot in Zenoh connection.- Get actual battery level from robot- Use battery info from 'get_battery_info' method --- scripts/connect_openrmf_by_zenoh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/connect_openrmf_by_zenoh.py b/scripts/connect_openrmf_by_zenoh.py index a479dc0..53c5e9c 100644 --- a/scripts/connect_openrmf_by_zenoh.py +++ b/scripts/connect_openrmf_by_zenoh.py @@ -104,8 +104,8 @@ async def publish_pose(self) -> None: async def publish_battery(self) -> None: """Publish the current robot battery to Zenoh.""" - # TODO Get the actual battery level from the robot - battery = 0.8 + battery_info = await self.run_method("get_battery_info") + battery = battery_info[0] self.battery_pub.put(json.dumps(battery).encode(), encoding=zenoh.Encoding.APP_JSON()) async def publish_map_name(self) -> None: