This tutorial will guide you through the procedure of docking your Leo Rover autonomously to the charging station.
To be able to perform the autonomous docking, you need to install two packages on your rover. One is responsible for detecting the board on the station and the other for moving the rover. You can get the first package by executing this command on your rover (connect to it through ssh):
The second package has to be built from source, so it requires a ROS workspace on your rover (if you don't have one or don't know whether there is already a workspace on your rover, you can follow this guide). To install the package, enter the src directory inside your workspace and execute these commands:
Now that everything is ready, we can proceed to launching some software. This whole section will describe in detail the functionalities provided in the leo_docking package and how to use them.
Here's a brief summary of different parts of the docking software we will run:
The first two functions are provided through the launch file located under the launch directory. All parameters for the running nodes are loaded from the YAML files located under the config directory.
The client is run with rosrun command and takes three optional arguments, but it'll be covered later.
As the state machine needs output from the detector, they are launched with one file. The detector provides the state machine with the station position in the base_link frame, and the state machine performs calculations and moves the rover based on the results. The machine has 3 main parts:
Here's a diagram that illustrates the state machine:
When it comes to the parameters, there are three files in the config directory:
Having everything covered, to run the detector with the state machine, simply run on the rover:
Having the software described above launched, we have the state machine ready for action, but it needs a signal to start the docking. That's where the Docking Client comes in. It's a script that sends an ID of the target charging station (the marker board on the station to be precise) to the state machine. Once the state machine gets the number, it starts the docking process. Here are all the functionalities that the docking client provides:
The command to run the client looks like this:
But as it was mentioned earlier, the arguments are optional, so a simple command to start the docking process is (in another terminal, with sourced workspace):
This will use the default values of the arguments ("1", "3", "2" respectively). Here is a customized example:
This command will result in the state machine trying to dock the rover to the station with ID "3", where the client will wait 2 seconds for getting connection with the state machine actionlib server and will check every 1.5 second if the server is still up.