Posted by @xiyuoh:
Hi there! Dynamic charging is a feature that allows robots to switch between their designated chargers at different periods throughout the day. Prior to this, each robot in the fleet is typically assigned to a specific charger in its fleet config (example for Office demos).
Could you please provide an example of dynamic charging?
To use the dynamic charging feature, you would have to bring up the ROS 2 node and provide a charging schedule yaml config. For example,
ros2 run rmf_charging_schedule charging_schedule schedule.yaml
The schedule.yaml config may look something like this:
tinyRobot:
"00:00": { tinyRobot1: tinyRobot1_charger, tinyRobot2: tinyRobot2_charger }
"08:00": { tinyRobot1: tinyRobot2_charger, tinyRobot2: pantry }
"16:00": { tinyRobot2: tinyRobot1_charger }
parking: ["pantry"]
This would mean tinyRobots 1 and 2 will head to chargers 1 and 2 respectively at 00:00 when they are assigned a charging task (by RMF). From 08:00 to 15:59, whenever given a charging task, tinyRobot1 would head to tinyRobot2_charger
for charging, and tinyRobot2 would head to the pantry
waypoint. Since there are no chargers at pantry
, the robot would simply park there and not charge. From 16:00 to 23:59, tinyRobot2 would head to tinyRobot1_charger
whenever a charging task is assigned, and tinyRobot1 would remain at tinyRobot2_charger
.
By adding the last line parking: ["pantry"]
, we are indicating that the pantry
waypoint is a parking spot. This helps to ensure that the correct robot status is reflected. When the robot is charging, the status would be CHARGING
. When the robot is parking, the status would be IDLE
For more details about formatting the schedule yaml file, you may refer to the package README.
Additionally, I have a scenario where a robot needs to determine its next action based on its battery level after completing a task. If the battery level is sufficient, the robot should go to a parking spot; if the battery level is insufficient, it should go to charge. How can this be implemented?
To achieve this, we won’t need to use the dynamic charging feature. You can configure your robot fleet’s idle behavior using the finishing_request
field in the fleet config to park
, so that whenever the robot is free, it will park at any waypoint that is indicated to be a parking spot instead of charging. Do also make sure that account_for_battery_drain
is set to True.
If the robot’s current battery SOC falls below a certain level, a charging task would automatically be assigned by RMF. This value is derived from the recharge_threshold
configured, after adding some safety factor to make sure that the robot has enough battery to reach the charger, so you might want to modify this value too. It might also be helpful to point out that you can set the battery level that the robot should charge up to using recharge_soc
.
This automatic retreat to charger can be configured or disabled by setting a retreat_to_charger_interval
parameter in the fleet config. If a null
value is provided, the fleet adapter will not trigger a retreat even if the robot’s battery level falls below the recharge threshold. By providing an integer X, the fleet adapter would check the robot’s battery level every X seconds to determine whether a retreat is necessary.
Let me know if this works for your use case or if you have any other questions.