Auto Dock when battery is low keep getting called
Hello there all,
I am trying to implement my own action server robot_action_server
with various goals on Turtlebot 2 with python. One of them is to move the robot close to dock station with move_base
server and then call the dock_drive_action
server.
My class say robotController
spins up this robot_action_server
and a SimpleActionClient
of appropriate type in order to call it if need.
Now, I am trying to make Turtlebot 2 auto dock when laptop battery or its own battery pass a certain threshold. In order to do that, i instantiated an ApproximateTimeSynchronizer
for both batteries. I do simple checks for received battery levels and if is not already charging or already on way to charge, i call a function that calls the robot_action_server
charge goal. The charge goal, first moves the robot to a close point and the call the dock_drive_action
server. All good so far. Move_base
and auto_dock
work great and finish successfully.
However, when the robot docks, the next ApproximateTimeSynchronizer callback
show that turtlebot_battery is still not on charger state and repeats the whole procedure again.
I think the problem is that the synchronzier callback process old messages after the action has completed. How is it possible to overcome this problem?
Sorry for off-context; 1) Are you making your own auto-dock solution, or are you customizing existing tools e.g. http://wiki.ros.org/kobuki/Tutorials/... 2) Is it possible to see your work at a public space (e.g. GitHub.com)?
I have already answered this question, but thanks for trying to help! :)