My contribution to the IEEE UCSD Quadcopter Team - Simulation and Planning

I am currently on the UCSD IEEE Quadcopter Team, which plans to compete in the 2017 International Aerial Robotics Competition (IARC). On this team, I have contributed heavily on the software side. Firstly, in establishing and developing a reliable simulation enviroment.

Documentation for installing and running the developed simulation can be found here.

Creating the Simulation Environment

Gazebo

In the absence of a physical or finished quadcopter, and for safety reasons, initial testing needed to be done on a simulation. The quadcopter’s software stack exists within the ROS framework, which integrates directly with the 3D simulation software, Gazebo.

Gazebo allows numerous customizations to be done to allow incredible flexibility in robot simulation. It also supports generation of measurements from a multitude of sensors, allowing customizability for additive noise. Gazebo provides extensive documentation and examples of how to implement and simulate various situations. They provide direct access to their API with the use of plugins, allowing for development of control software for robots, sensors and even the environment. As stated previously, it has seemless integration with the ROS framework, which makes it an ideal candidiate for our simulator.

The Reference

The development process for our simulation began by referencing the implementation achieved by Aerial Robotics Kharagpur. Their implementation featured a Gazebo environment which included models for the field, roombas, and even a simplistic quadcopter model. It also included a source code for roomba movement for IARC mission 7, as well as a Gazebo plugin for contact sensors on the roomba.

ARK quad_simulator Aerial Robotics Kharagpur’s quad_simulator

Improvements

Aerial Robotics Kharagpur’s implementation served as an excellent starting point for our team; however, there were many improvements that could be made to allow for a more realistic, more accurate simulation.

Floor Texture and Lines

Firstly, improvements on the gazebo world were made, namely the arena floor. We replaced the texture of the arena floor, increasing its resolution. We also redrew the grid to incorporate the double thick line in the center, as well as the colored goal lines.

gimp_lines Drawing the arena lines with GIMP

field_bare Empty field with new floor texture and new lines in Gazebo

Roomba Models

Next, the vanilla gazebo model for the iRobot Create, provided in the gazebo models library, needed customization to match the mission 7 aesthetic. Thus, using sdf, a derivation from XML specialized for describing robot models and environments, we were able to adapt the roomba models to feature a colored top plate, and a touch paddle more consistent with mission 7.

roomba_evolution Original Roomba Model (Left) Updated Roomba Models (Center and Right)

Also, the roombas designed to be obstacles in mission 7 were also modified, adjusting the size of the ‘PVC’ attachment to match dimensions consistent with the rulebook.

Quadcopter Model and Sensors

Another area needing improvement is the quadcopter model. The included model comes from the hector quadrotor package provided by ROS. This model is more simplistic than we would have liked, as it does not account for the complicated dynamics and movement of a real quadcopter. It also is not compatible with MAVROS, which links ROS to the MAVLink communication protocol used on most physical autopilot systems. Therefore, we decided to replace it with the Erle-Copter.

quadcopter_evolution Original Quadrotor Model (Left) and New Erle-Copter Model (Right)

Following the Erle-Copter simulation documentation provided by Erle Robotics, and with considerable tweaking, we were able to add the Erle-Copter model to our simulation. The Erle-Copter’s movements are incredibly realistic, as it accounts for the quadcopter’s dynamics. The model is realistic looking, with spinning rotors, and a high resolution model. It also features the prized compatibility with MAVROS/MAVLink. Basic movement commands may be sent to the Erle-Copter via the MAVProxy console, or more complicated commands programmatically by overriding the RC input to the quadcopter.

Some of the many sensors included with the Erle-Copter are a forwards facing lidar and camera, and a downwards facing camera. The Erle-Copter model information is written in urdf with xacro, much like sdf it is in XML syntax. We modified the model to better match what we expected for our physical quadcopter, removing unnecessary sensors, and adding a downwards facing camera (optional fisheye image feed), a downwards facing lidar (for accurate altitude measurements), and an optical flow sensor.

Current simulation

Our simulation is an amalgamation of various packages, working seemlessly to deliver an aesthetically pleasing, highly functional, easily customizable, simulation environment for ROS software development. It integrates the Ardupilot SITL plugin, MAVROS, MAVLink/MAVProxy, ROS/GAZEBO, and many other packages, including our own software stack.

close_up

roombas_moving The UCSD IARC Simulation for Mission 7

Because gazebo communicates and integrates with ROS directly, sensor and robot information being published can be accessed via the ROS topics. Therefore, for example the camera image feed information or imu/lidar info can be accessed programmatically at any time.

camera Downwards facing camera

fisheye lens Downwards facing camera through a fisheye lens

imu lidar Topic information from imu (Left) and lidar (Right)

Planning

Once our planning algorithm chooses a roomba to “score,” it moves towards the roomba, and follows the roomba from above. This “following” algorithm utilizes two PID controllers, one for Roll and the other for Pitch. Using the approximate roomba position information output by the perception stack, we are able to calculate the PID coefficients and implement the controllers. By tuning the PID gains, we are able to adjust the response of the aircraft to a change in position of the roomba, resulting in a smooth and accurate position tracking of the roomba.

roomba_follow