What regulates that in the Webpage appears the battery percentage? (#240)

Posted by @TheConstructAi:

Hi ,

I am using the slotcar plugin and for some reason, the battery percentage is not shown, although I’m publishing the battery state. In robots that don use the slotcar, it works perfectly, but for some reason the slotcar doesn’t allow this to appear in the webpage.

Any ideas of why this could be happening? How does the information of the battery state reach the webpage? What are the nodes involved an the communication channels used?

Thanks

Posted by @Yadunund:

The battery % comes from the battery_percent field for each robot in the FleetState msg for a given fleet. If you’re running a full control fleet adapter with a registered FleetUpdateHandle, it will take care of publishing the battery % if your adapter calls update_battery_soc().

When you say you’re using the slotcar plugin, which fleet adapter are you using to control the robots in simulation? Is it the rmf_demos_fleet_adapter?

Also, from the screenshot above, it looks like you’re using the deprecated rmf-panel. We strongly recommend switching to rmf-web which is better maintained and has a lot more features.

Posted by @TheConstructAi:

Yes exactly, we are using the rmf_demos_fleet_adapter. The setup is:

  1. The simulation uses the slotcar plugin for each robot
  2. We use the fullcontrol an the rmf_demos_fleet_adapters

As for the rmf_web wasn’t aware of it.

Just tried to start it following the instructions for galactic, but getting this issue:

Downloading Chromium r1002410 - 149 Mb [=== ] 15% 3.1s ERROR: Failed to set up Chromium r1002410! Set “PUPPETEER_SKIP_DOWNLOAD” env variable to skip download.
[Error: ENOSPC: no space left on device, write] {
errno: -28,
code: ‘ENOSPC’,
syscall: ‘write’
}
npm ERR! code 1
npm ERR! path /home/tgrip/TheConstruct/fleet_management/fleet_management_ws/src/rmf-web/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c – node install.js

npm ERR! A complete log of this run can be found in:
npm ERR! /home/tgrip/.npm/_logs/2022-09-27T10_40_53_746Z-debug-0.log

Posted by @aaronchongth:

Hello @TheConstructAi! Could you share with us what sort of device you are running the dashboard on? This error looks like a generic error when the device runs out of disk space.

Posted by @TheConstructAi:

Its an Ubuntu 20, in a Thinkpad Laptop. Nothing out of the ordinary
I followed these tseps to install:


sudo apt update && sudo apt install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
source ~/.nvm/nvm.sh
nvm install 14

pip3 install pipenv
cd ~/rmf_worskpace/src
git clone https://github.com/open-rmf/rmf-web
cd rmf-web
git checjout galactic
npm install -g npm@latest
scripts/bootstrap.sh

Anything else that has to be done?

Posted by @aaronchongth:

Not that I know of. Are you sure that your device is not running out of disk space?

I just spun up an ubuntu:20.04 docker image and ran the same commands, and ./scripts/bootstrap.sh completed fine.

Here is the gist: gist:adf58d8a02ab794a022e6e1e5c35b386 · GitHub


Edited by @aaronchongth at 2022-09-27T11:29:27Z

Posted by @TheConstructAi:

Great Advice! It worked! What a dumb error message!

Anyway, Is there anyplace where there is a kind fo tutorial on how to port existing old version dashboard to this new format?
Any example on that matter? Or any indication or docs?

Thanks Lot

Posted by @aaronchongth:

May I know what you mean by port? The use of rmf-web is documented in rmf_demos, GitHub - open-rmf/rmf_demos: Demonstrations of Open-RMF, and further information about the dashboard can be found on the repository itself, GitHub - open-rmf/rmf-web.

It seems like we have also diverged from the original question. Any further question should be a different discussion, or issue on its own. Do you still have any other questions regarding the battery percentages?

Posted by @TheConstructAi:

Well I didnt get the slotcar to at least make in the webpage appear the battery percentages, if that’s question.
I don’t quite understand how the battery status info gets to the webpage through the slotcar. Using the free fleet system, it shows but with simulated only slotcar simulations, it just appears that check box, no percentages

Posted by @aaronchongth:

The battery percentage is calculated in slotcar, rmf_simulation/rmf_robot_sim_common/src/slotcar_common.cpp at main · open-rmf/rmf_simulation · GitHub, and published as a RobotState which the demo fleet manager keeps track of, rmf_demos/rmf_demos_fleet_adapter/rmf_demos_fleet_adapter/fleet_manager.py at main · open-rmf/rmf_demos · GitHub.

the fleet adapter sends a request to get to obtain this battery rmf_demos/rmf_demos_fleet_adapter/rmf_demos_fleet_adapter/RobotClientAPI.py at main · open-rmf/rmf_demos · GitHub, and this gets populated into the robot state API, which the rmf-web dashboard uses.

The rmf_demos panel is not actively being maintained at the moment, the web dashboard should be the way to go to work with the demos.