This week was experimenting with Stacked PilotNet and integrating jderobot_drone with Behavior Metrics.
- Preliminaries and Explore Issues
- Solve Issues with Pull Requests
- Analyze the New Drone integration
Preliminaries and Explore Issues
With this as the beginning, this week’s task was to sort the proper randomization of the initial positions. And then explore the intrdoution of drone into BehaviorMetrics. I found the following directions (as issues):
Issue 1: Proper Randomization in GUI and Script mode
The issue is observed when we select indexes greater than half for random initialization node from the data bag. An improper randomization causes brains to crash early which is not a good practice. Although, any such evaluation where the brain crashes early is ignored, but such a situation should be avoided.
Issue 2: Add PilotNet stacked config, trained models and brain
After preparing and training the stacked PilotNet framework in DL-Studio, its time to see how they perform in Behavior Metrics.
Issue 3: Add Drone explicit brain for line following objective
With MAVROS and PX4 support, it is time to setup Iris drone on the same circuit as the F1 car and make it complete the line following task.
Issue 4: Add drone assets for BehaviorMetrics drone F1 setup
Once the drone integration is done, the installation of the drone assets should be included in the setup files of Behavior Metrics and proper installation instructions should be given.
Solve Issues with Pull Requests
To solve the above issues and add update features, the following PRs were created:
PR 1: Randomization added and only one function for both GUI and SCRIPT mode
Now there is only one function
tmp_random_initializer in  which does all the work of randomization both in GUI and script mode. The function definition is given below. Such a function creates a temporary file derived from the primary circuit world and launch files.
def tmp_random_initializer( current_world, # Current circuit from config stats_perfect_lap, # Statistics of the perfect lap in that circuit randomize=False, # Randomize initial pose gui=False, # Enable display (in GUI) or background (in Script) launch=False # Launch the tmp files (for script mode) ):
PR 2: Added PilotNet Stacked execution files
The stacked PilotNet brain, config and trained network weights were added and tested on all the circuits. The brain is able to complete all teh circuits except Montmelo at the max speed. However, with a hack, it completes the Montmelo circuit too but with a lesser speed. A video showing the performance of the stacked pilotnet framework in Montmelo circuit is shown below.
A future line of thought is to modulate the dataset such that the brains get an intuition of when to follow a lesser speed and when to go for maximum speeds. The failure of my trained brains in montmelo circuit is shown in the second half of a previous video .
PR 3: Added explicit brain setup for drone
This was an interesting task as it introduces drones in the Behavior Metrics framework. The pipeline of drones is a bit different from that of the F1 car. The
DroneWrapper developed in  does most of the work and there are no explicit sensors or actuators which are required. Thus, this difference between the car and drone pipeline had to be taken care of and hence, proper condition statements were introduced in the base Behavior Metrics pipeline. I understood how:
- the setup files are setting up the assets
- px4 mavlink launches the drone
- custom world setups are made
This task was accompanied by replicating a similar explicit brain for drone as developed in  for car. The same principle worked except that a height control was added to command the z-velocity based on a PD control law. Below is a video showing the performance of explicit brain with Iris drone and PX4-Mavros backend.
PR 4: Added drone assets for BehaviorMetrics
Now, after setting up the custom drone worlds and launch files for all the circuits, the assets should be updated in order to make it avaiable to others. Considering the baseline setup and following the
CustomRobots  structure, a similar structure was formulated and added as a PR to the repository. However, as
JdeRobot/drones  is the primary repository for this setup, the assets will be moved there soon.
Issues and Pull Requests
Pull Requests Created
Pull Requests Closed