• No se han encontrado resultados

2 Componentes y técnicas de ensamblado

5.3 Extensiones

5.3.4 Extensiones ortogonales

Before attempting to develop solutions for the required tasks of the aerial drone, the team was faced with the challenge of communicating with the drones and transmitting data to and from them. This communication needed to be done using Ubuntu 13.10 and ROS Hydro. These software versions were required for other portions of this project for compatibility with software being used to complete the various required tasks. All software must be of the same version in order to successfully integrate the separate components of this project.

One open source ROS package was identified which possessed the capability to communicate with the AR Drone under these constraints. This package, ardrone_autonomy, utilizes the AR Drone API and SDK to connect with and manipulate the various elements of the drone. Use of this package grants the capability to publish takeoff and land messages as well as desired command velocities and the capability to subscribe to data such as the image feeds from both cameras, raw data from the IMU, and the estimated velocities and accelerations calculated from this raw data among several other sources of data the drone provide. Navigation data which can be retrieved from the drone by utilizing an ardrone_autonomy subscriber can be seen in

Table 7.1: Data available through the ardrone_autonomy package from the AR Drones as seen in the documentation. Legacy Navigation Data

Message Description Units

Header ROS message header NA

batteryPercent The remaining charge of the drone’s battery Percentage

state The drone’s current state 0-Unknown,

1-Inited, 2-Landed, 3&7-Flying, 4-Hovering, 5-Test, 6-Taking off, 8-Landing, 9-Looping rotX Left/right tilt, rotation about the X axis of the drone Degrees rotY Forward/backward tilt, rotation about the Y axis of the

drone

Degrees rotZ Orientation, rotation about the Z axis of the drone Degrees

magX, magY, magZ Magnetometer readings TBA

pressure Pressure sensed by the drone’s barometer TBA

temp Temperature sensed by the drone’s sensor TBA

wind_speed Estimated wind speed TBA

wind_angle Estimated wind angle TBA

wind_comp_angle Estimated wind angle compensation TBA

altd Estimated altitude mm

motor1..4 Motor PWM values TBA

vx, vy, vz Linear velocity mm/s

ax, ay, az Linear acceleration g

tm Timestamp of the data returned by the drone since

The package also contains launch files and executables which can be used to start the ardrone_autonomy node and initialize the sensors of the drones. In addition, this package provides capabilities to run the preprogrammed flight animations developed by Parrot.

It was decided to use this package based on team member’s previous experience with it. The package provides the basic capabilities required for completion of the desired tasks of the drones in this project. Furthermore, the ardrone_autonomy package is seemingly the most popular method of interfacing with the AR Parrot drones through ROS. Many other ROS packages designed for control of the AR Drone use this package and many other universities conducting research using the AR Drone also use the ardrone_autonomy package.

The ardrone_autonomy package was cloned from its GitHub repository at the time of required use for the project and compiled from source. However, during this project the executable binaries for this package were made available through the package management system alongside the ROS core, and compiling from source is no longer needed on Linux systems. The team used the provided launch file, ardrone.launch, as a reference when creating a customized launch file to fit the needs of the drones for this project.

To leverage the tools available in MATLAB, the ardrone_autonomy package in ROS was utilized simply as a communication bridge for data transfer to and from the drone. In order to transfer the data retrieved by the ardrone_autonomy package into MATLAB, the team downloaded and attempted to use a software package called IPC Bridge. As previously stated, not all ROS message types were supported and thus the team was required to create files for IPC in order to send empty messages for takeoff and land commands for the drones. In addition, due to differences in the boost libraries, image messages could not be successfully sent between ROS and MATLAB. This was a major issue with respect to the completion of the required tasks of the

drones. This was one of the major issues mentioned in within Chapter 5: Vehicle Software with caused the team to decide to search for another method of communication between ROS and MATLAB.

When the team implemented the ROS-MATLAB Bridge package, MATLAB classes were created for each of the required tasks of the drones. Using the ROS-MATLAB Bridge capabilities, publishers and subscribers were written to retrieve and send the necessary data to complete the desired drone tasks. Figure 7.1 shows the transfer of data from the drone through the various software being used and back.

Figure 7.1: Data transfer from the drone to ROS, through ROS-MATLAB Bridge, to MATLAB and vice versa.

This method of data transfer and code structure simplified the organization of the code needed to complete these tasks as all data retrieved from the drones was available for use anywhere in the MATLAB class. In addition, publishing messages to the drone was simplified to as few as two steps: set variable and publish variable.