Abstract: The aim of the project is to create easy-to-use APIs for the hardware on the BB Blue. This would consist of developing/improving kernel drivers for the on-board devices and then reimplementing the Strawson APIs to use these kernel drivers. These APIs will then be used by real-time applications which can be run on BB Blue. In the later phase of the project, support for BB Blue will be added in Ardupilot and ROS will be ported to BB Blue using these APIs.
BB Blue is the latest educational robotics controller built around the popular BeagleBone open hardware computer. With a suite of sensors very useful for robotics and a supported software stack ideal for robots and drones, the BeagleBone Blue is the perfect board for all kinds of robots. There are many robotic applications which are limited to some specific hardware. By developing APIs for BB Blue it would be easy for developers to blend in the latest versions of these applications with the unmatched architecture for the BB Blue.
Project Goals and challenges:
Following are the complete set of project goals and their challenges which I plan to deliver at the end of the tenure:
Enabling Kernel drivers: The very first step of this project is to develop the kernel drivers for the devices/modules on BB Blue. Presently most of the kernel drivers for the onboard modules are present in 4.1 kernel. I have already configured the kernel driver for MPU-9250 which is a combination of MPU-6050 and AKM8963.
Developing PRU servo kernel driver: Currently the pruss driver is based for kernel 3.8. During the first week I will be developing the kernel driver for PRU servo and DC. This would essentially involve porting the pruss driver to 4.1 to communicate with the modified remoteproc framework. A userspace API will then be written for implementing PWM downcalls.
BB Blue debian image: After kernel drivers for the onboard devices are completed, I will generate the config file and compile the kernel with the base BB Blue overlay which will be created. Finally, a debian image will be built by using the appropriate EEPROM database. After booting the image onto the board, I will check for any eMMc errors and system level bugs.
BB Blue APIs: I will make the APIs which would be communicating with the device kernel driver. By the end of 6th Week, all the APIs will be implemented, tested and well documented. The goal here should that for any program using the current APIs to not break when run on BB Blue. Also, since the APIs are a reimplementation of the strawson APIs, the syntax of the BB Blue APIs will adhere to the strawson APIs so as to make the BB Blue APIs more compatible. Most importantly, the performance of this kernel+API system will be compared with the standard mmap version
Ardupilot support for BB Blue: By the end of this project BB Blue support for Ardupilot will be developed which essentially involves implementing the AP_HAL APIs using the BB Blue APIs. mavlink will also be integrated with the APIs which would enable the board to communicate with other mavlink supported applications.
Standalone ROS for BB Blue: The APIs will also be used for interfacing the onboard devices with the ROS middleware by creating some custom packages.
Following ROS packages will also be tested on BB Blue to check the connectivity:
mavros: ROS interface for mavlink
roscopter: ROS interface for ArduCopter using Mavlink 1.0. Using this package, a quadcopter can be controlled directly from ROS overriding the RC commands.
Documentation and examples: I will provide extensive and accurate documentation for whatever I build in this project. Functional documentation for the APIs will be done in doxygen. Code documentation will be as comments in the source file.
Timeline and Milestones:
Google Summer of Code stretches over a period of 12 weeks with the Mid-Term evaluations in the 6th week and End-term evaluations in the end. Following are the timelines and milestones which I want to strictly follow throughout the project tenure:
May 15 – May 22 Week-0
Aim: Reading the Documentation.
Description: I’ll familiarize myself by going through the documentation of building the kernel drivers, Strawson APIs, Ardupilot and ROS. By this end of this week, I would be getting a rough estimate of what to do in the coming weeks. Also since BB Blue is roughly based on BB Black, I would be testing the board with the latest debian image and check for any hardware bugs.
May 23 – June 6 Week-1,2
Aim: Developing kernel driver for PRU servo and compiling kernel.
Description: Developing a PRU userspace API after porting prussdrv to 4.1 kernel to communicate with the modified remoteproc framework. After all the kernel drivers are developed and enabled and the base dto modified, the kernel will be compiled with the beaglebone_blue_defconfig file. Then, with the uImage file, I will build the image by modifying the necessary values in the BB Blue EEPROM data.
June 6 – June 13 Week-3
Aim: Fixing bugs and performance issues for kernel drivers
Description: The debian image will be thoroughly tested this week.
June 14 – June 21 Week-4
Aim: Developing BB Blue API’s(Part-1)
Description: Following the design and structure of the strawson API’s in implementing the BB Blue APIs. I’ll also be making the test APIs for unit testing.
June 22 – June 27 Week-5
Aim: MID-TERM EVALUATION !!
Description: Refactoring the code and increase its readability. Some time would be spent in rechecking the API source code with the unit tests for any bugs. During this week, usage documentation for all the APIs would be clearly outlined and written.
June 28 – July 7 Week-6
Aim: Developing BB Blue API’s(Part-2)
Description: In Part-2, The next list of BB Blue APIs will be written.
July 8 – July 15 Week-7
Description: Reserve week for any unseen problems faced. Meanwhile, API’s will be thoroughly tested by the examples present in the Strawson APIs git repository. Final documentation will be committed to github. The communication ports will be tested.
July 16 – July 31 Week-8,9
Aim: Writing ardupilot interfaces on the BB Blue using APIs
Description: Using the APIs, BB Blue support for the Ardupilot will be added. This would involve implementing the APIs mentioned in the AP_HAL directory in Ardupilot. The entire code would thereby go to AP_HAL_Linux directory. After coding, Ardupilot(Arducopter) will be tested by interfacing BB Blue with a mini quadcopter which I have built including the sensors mentioned above. The connections between ESCs and the brushless motors will be soldered and the input pins will be connected to the PRU servo ports. A DSM receiver will be interfaced to BB Blue which can be controlled by a transmitter. All the issues related to hardware and performance will also be address in this week. Once the coding and testing is done, I will be submitting merge requests to upstream Ardupilot repository.
August 1 – August 7 Week-10
Aim: Configuring mavlink and porting ROS to BB Blue
Description: Since mavlink is a header-only library, we need not compile it on BB Blue. It can simply be used by adding it to the API directory. I’ll also be Installing ROS on BB Blue and checking for bugs. BB Blue support for mavros, roscopter will be tested this week.
August 8 – August 15 Week-11
Aim: Documentation and making ROS nodes for BB Blue.
Description: Detailed testing will be done by controlling the experimental quadcopter by a ground station using mavlink and by using mavros. ROS support for the devices on BB Blue would be written. Finally I will be releasing all the alpha packages and adding them to the packages.ros.org list.
August 16 – August 23 Week-12
Aim: FINAL EVALUATION !!
Description: Checking for code smells and bugs. Refining the previous documentation so that it is more easy to understand. Checking the final implementation and doing the runthrough again.