# Design and Implementation of an Autonomous Charging Station for Agricultural Electrical Vehicles
## 2 Materials and Methods  
### Hardware and Software Description  
The ACS is a combination of a holonomic mobile platform carrying a collaborative robotic arm (Figure 1). The mobile platform (Programmable Mecanum Wheel Vectoring Robot-IG52 DB, Superdroid Robots, Fuquay-Varina, NC, USA) is a 4 mecanum wheel drive platform, which allows the platform to drive freely in X and Y 2D directions. The mobile platform Electronic Speed Controllers (ESCs) communicates with and Arduino mega board (Arduino Mega 2560, Arduino, Boston, MA, USA), which communicates through a serial connection with the main computer as we will see later. Figure 1: The Autonomous Charging Station composed of: A collaborative robot arm equipped with a gripper and an RGB camera, an aluminum frame, and an omnidirectional mobile platform. A home-made frame was built in order to host the collaborative robotic arm. The frame is based on a Bosch Rexroth aluminum alloy strut, with a 30 \(\times\) 30 mm profile. The different profiles of the frame have been connected using angle brackets, and fixing on the whole frame on the mobile platform was performed using a combination of T-slot nuts and profile screw connectors. The arm is a UR5e (Universal Robot, Odense, Denmark), with a payload of 5 kg. Both the arm, its control box (which includes both the power supply, and the processing unit controlling the arm), and the teaching pendant are hosted on the mobile platform. The end-effector attached to the robotic arm is a two fingered 2F-85 gripper (Robotiq, QC, Canada), which has a stroke of 85 mm with a grip force up to 235 N, which is more than enough for our application. The Robotiq gripper is connected directly to the UR5e arm, and thus controlled via the embedded computer of the arm. For the vision-based guidance of both the mobile platform and the robotic arm, we installed a simple RGB camera (C920, Logitech, Lausanne, Switzerland) on the end-effector. The high level computer (HLC) consists of the NVIDIA Jetson TX2 Developer Kit (NVIDIA, Santa Clara, CA, USA). The board runs the Ubuntu 16.04 Linux distribution, and hosts the robot operating system [21]. ROS is the middleware that ensures the management of the different entities of the ACS. To control the collaborative robot arm, there were two options, whether to use Moveit [22], which is dedicated to calculate the inverse kinematics (translating a point into 3D coordinates to the joint angles of a robot arm) of the robot's manipulators, and is integrated with ROS. The second option is to let the computer that came with the robot arm perform the job, by sending the desired commands via socket communication. We went for the second option as the Robotiq gripper is connected directly to the UR5e embedded computer, and as of the writing of this paper, there is no solution to control both the arm and the gripper via ROS as the gripper is connected to the embedded computer of the arm. A solution would be to detach the connection of the gripper from the arm, and make an external power and a USB serial connection to the Jetson board and connect it separately, a solution that is less ergonomic, which we wanted to avoid. Finally, a PS4 (Playstation 4) gamepad is connected via Bluetooth to the Jetson board in order to ensure the ability of gaining manual control of the ACS at all times during the operations. An overview of the global hardware composition of the different elements of the ACS as well as how the communication links each element to the central processing unit is illustrated in Figure 2.  
When it comes to software architecture, the high-level computer is running Ubuntu 16.04, with the robot operating system (ROS) [21] as a middleware. Figure 3 illustrates the different ROS nodes running during the operation of the ACS. The main node _plug_cycle_ is the manager of the inputs/outputs of the whole system; this node subscribes and publishes (obtain/send information from/to) to different topics that manages the corresponding hardware:  
**usb_cam**: From the _usb_cam_ ROS package [23].